Commit graph

76426 commits

Author SHA1 Message Date
Alexander Barkov
4902861155 Adding test for ENGINE=VEC
added:
  mysql-test/suite/connect/r/vec.result
  mysql-test/suite/connect/t/vec.test
modified:
  storage/connect/plgdbutl.cpp
2013-02-11 17:50:01 +04:00
Alexander Barkov
631272334b Adding a test which crashed in ealier versions (dbf01.sql from Bar)
modified:
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/t/dbf.test
2013-02-11 14:42:23 +04:00
Alexander Barkov
204086bd0d Fixing test failure cause by recent changes in ODBC catalogue functions.
modified:
  mysql-test/suite/connect/r/odbc_xls.result
  mysql-test/suite/connect/t/odbc_xls.test
2013-02-11 12:05:22 +04:00
Alexander Barkov
ebf2da0045 Fixing compilation problems on Unix:
1. Conflicting declarations:

In file included from /usr/include/sql.h:19:0,
     from <path>/storage/connect/odbconn.h:15,
     from <path>/storage/connect/ha_connect.cc:117:
/usr/include/sqltypes.h:98:23: error: conflicting declaration
  ‘typedef unsigned int DWORD’

os.h and unixODBC's sqltypes.h (included from sql.h) have conflicting
declarations, because unixODBC for some reasons incorrectly defines
DWORD as "unsigned int", while we define DWORD as "unsigned long"
(which is the Microsoft way).

We should never include os.h and odbconn.h from the same file.
Inside tabodbc.cpp DWORD must be seen as sql.h defines it.
In all other files DWORD must be seen as os.h defines it.

Fix:
Moving ODBC catalog function prototypes into a separate file odbccat.h.
Fixing ha_connect.cc to include odbccat.h instead of odbcon.h

2. Use of ambiguous overloaded function in myconn.cpp:
There's no a method SetValue(const char *fmt, int i);
There's only a method SetValue(char *fmt, int i);

Fixing the call accordingly:

-    crp->Kdata->SetValue((fmt) ? fmt : "", i);
+    crp->Kdata->SetValue((fmt) ? fmt : (char*) "", i);

Note, this is a quick hack. The correct fix would be to change
the method prototype to have the "fmt" argument as "const char *".
However, it is tightly related to about 300 other places where
"char*" is used instead of "const char *". We'll need to fix
all of them gradually (in separate changes).


added:
  storage/connect/odbccat.h
modified:
  storage/connect/ha_connect.cc
  storage/connect/myconn.cpp
  storage/connect/odbconn.h
  storage/connect/tabodbc.cpp
2013-02-11 10:16:52 +04:00
Olivier Bertrand
f6ca3b05f2 Bug fixed: Column charset were not handled on read.
Modified: ha_connect.cc (MakeRecord)

Moved PlgAllocResult to plgdbutl.cpp
Modified:
mycat.cpp
plgdbutl.cpp

Continuing implementing the "catalog" tables (ex "info").
Already existing were the ODBC data source table and the
WMI column info table.

The common way to handle them was modified to enable each
table types to send personalized data.

Now takes care of all existing catalog functions for table
types that can retrieve and use such information.

Modified:
ha_connect.cc
odbconn.cpp
tabodbc.h
tabodbc.cpp
tabfmt.h
tabfmt.cpp
tabmysql.h
tabmysql.cpp
tabwmi.h
tabwmi.cpp
myconn.h
myconn.cpp
filamdbf.cpp
plgdbsem.h
reldef.h
reldef.cpp
tabdos.h
tabdos.cpp
tabfix.h
xtable.h
table.cpp
2013-02-11 00:31:03 +01:00
Olivier Bertrand
b93db097a3 2013-02-09 01:22:09 +01:00
Olivier Bertrand
82e746ea1b Put almost all function prototypes in header files that are
included by the program using them.

Continuing implementing the "catalog" tables (ex "info").
Already existing were the ODBC data source table and the
WMI column info table.

A common way to handle them will permit to develop many
other such tables. Implemented:

The ODBC column catalog table.
The ODBC tables catalog table.
The ODBC drivers catalog table.

The INFO table option is replaced by the CATFUNC string option
whode first letter specifies the information to retrieve:
C: Columns (of a table)
T: Tables  (of a database)
S: Data sources
D: Drivers

Modified:
ha_connect.cc
odbconn.cpp
odbconn.h
tabodbc.h
tabodbc.cpp
rcmsg.c
tabfmt.h
tabmysql.cpp
tabwmi.cpp
tabwmi.h
resource.h
myconn.h
filamdbf.h
connect.cc
connect.h

Added:
myutil.h
2013-02-09 01:08:15 +01:00
Alexander Barkov
6bd0f5dae7 Removing double new-line markers when doing LOAD_FILE('example.ini').
The libary to handle INI files on Windows XP adds an extra empty
line before sections name.

Newer versions of Windows do not.
Unix replacement implementation also do not.

modified:
  mysql-test/suite/connect/r/ini.result
  mysql-test/suite/connect/t/ini.test
2013-02-08 18:20:40 +04:00
Alexander Barkov
d0f6e9a8ce Adding a test for TABLE_TYPE=DIR
added:
  mysql-test/suite/connect/r/dir.result
  mysql-test/suite/connect/t/dir.test
2013-02-08 14:22:10 +04:00
Alexander Barkov
516e8af860 Adding tests for TABLE_TYPE=INI
added:
  mysql-test/suite/connect/r/ini.result
  mysql-test/suite/connect/std_data/contact.ini
  mysql-test/suite/connect/t/ini.test
2013-02-08 13:33:25 +04:00
Alexander Barkov
3dd08e1f24 Adding REPLACE(xxx, '\r\n','\n'), not to fail on Windows.
pending merges:
  Alexander Barkov 2013-02-08 Adding tests for TABLE_TYPE=CSV
2013-02-08 13:12:17 +04:00
Alexander Barkov
ec838d5663 Adding tests for TABLE_TYPE=CSV 2013-02-08 13:08:25 +04:00
Alexander Barkov
9cfc2e23cc Adding tests for TABLE_TYPE=CSV
added:
  mysql-test/suite/connect/r/csv.result
  mysql-test/suite/connect/std_data/people.csv
  mysql-test/suite/connect/t/csv.test
2013-02-08 12:51:38 +04:00
Alexander Barkov
dd9ee7d157 Adding a test for TABLE_TYPE=BIN
added:
  mysql-test/suite/connect/r/bin.result
  mysql-test/suite/connect/std_data/Testbal.dat
  mysql-test/suite/connect/t/bin.test
2013-02-08 12:22:26 +04:00
Olivier Bertrand
ec2112f32d 1) Fix bug on strange sprintf
2) Fix bug on bad sprintf
3) Fix bug on cast from pointer to int

4) Begin implementing the "info" tables.
Already existing were the ODBC sata source table and the
WMI column info table.

A common way to handle them will permit to develop many
other such tables. Implemented:

The ODBC column info table.

Modified:
ha_connect.cc  (4)
odbconn.cpp    (4)
tabodbc.h      (4)
tabodbc.cpp    (4)
tabsys.h       (3)
rcmsg.c        (4)
tabfmt.cpp     (2)
tabtbl.cpp     (1)
resource.h     (4)
mycat.h        (4)
2013-02-08 03:48:47 +01:00
Olivier Bertrand
2809803ee2 1) Fix bug on strange sprintf
2) Fix bug on bad sprintf
3) Fix bug on cast from pointer to int

4) Begin implementing the "info" tables.
Already existing were the ODBC sata source table and the
WMI column info table.

A common way to handle them will permit to develop many
other such tables. Implemented:

The ODBC column info table.

Modified:
ha_connect.cc  (4)
odbconn.cpp    (4)
tabodbc.h      (4)
tabodbc.cpp    (4)
tabsys.h       (3)
rcmsg.c        (4)
tabfmt.cpp     (2)
tabtbl.cpp     (1)
resource.h     (4)
mycat.h        (4)
2013-02-08 03:27:12 +01:00
Olivier Bertrand
38edf74a3c 1) Fix bug on strange sprintf
2) Fix bug on bad sprintf
3) Fix bug on cast from pointer to int

4) Begin implementing the "info" tables.
Already existing were the ODBC sata source table and the
WMI column info table.

A common way to handle them will permit to develop many
other such tables. Implemented:

The ODBC column info table.

Modified:
ha_connect.cc  (4)
odbconn.cpp    (4)
tabodbc.h      (4)
tabodbc.cpp    (4)
tabsys.h       (3)
rcmsg.c        (4)
tabfmt.cpp     (2)
tabtbl.cpp     (1)
resource.h     (4)
mycat.h        (4)
2013-02-08 00:46:10 +01:00
Alexander Barkov
7f08277b8d Fixing "unused label" warning.
modified:
  storage/connect/CMakeLists.txt
  storage/connect/tabmul.cpp
2013-02-08 01:40:55 +04:00
Alexander Barkov
2787dcb05e Fixing a warning:
> deleting object of polymorphic class type ‘CATALOG’ which
> has non-virtual destructor might cause undefined behaviour
> [-Wdelete-non-virtual-dtor]

Classes whose instances are destroyed using "delete"
should have virtual destructors.

modified:
  storage/connect/catalog.h
2013-02-08 01:31:46 +04:00
Alexander Barkov
03259f8540 Fixing a warning:
Changing result type for the method from "char*" instead of "const char*".

modified:
  storage/connect/odbconn.h
2013-02-07 19:19:20 +04:00
Alexander Barkov
587a40c17e Fixing a warning:
KXYCOL::Kof’ will be initialized after ‘void*& KXYCOL::To_Bkeys’ [-Wreorder]

modified:
  storage/connect/xindex.cpp
2013-02-07 19:10:35 +04:00
Alexander Barkov
2cc5fd06b1 Commenting switches that are specific to C or C++ only.
modified:
  storage/connect/CMakeLists.txt
2013-02-07 18:35:32 +04:00
Alexander Barkov
494ef9d073 Fixing compilation problems on Windows (due to the previous commit).
modified:
  storage/connect/ha_connect.cc
2013-02-07 18:27:48 +04:00
Alexander Barkov
850220d1c4 Disable only *some* warning types instead of *all* types.
We need to fix and enable all warnings gradually.

modified:
  storage/connect/CMakeLists.txt
2013-02-07 18:20:05 +04:00
Alexander Barkov
f8f79d9334 Fixing wrong sprintf() calls.
modified:
  storage/connect/filamap.cpp
  storage/connect/filamdbf.cpp
  storage/connect/filamfix.cpp
  storage/connect/filamtxt.cpp
  storage/connect/filamvct.cpp
  storage/connect/ha_connect.cc
  storage/connect/osutil.c
  storage/connect/plgdbutl.cpp
  storage/connect/plugutil.c
  storage/connect/tabfix.cpp
  storage/connect/tabxml.cpp
  storage/connect/user_connect.cc
  storage/connect/value.cpp
  storage/connect/xindex.cpp
2013-02-07 17:56:48 +04:00
Alexander Barkov
40398f3660 Fixing some of the compilation warnings. 2013-02-07 16:37:44 +04:00
Alexander Barkov
8cfa84ca87 Fixing compilation warnings:
Using "bool" in pure C code is not a good idea.
- Defining BOOL as "long" on Unix (this is how MS defines it)
- Replacing bool to BOOL in pure C code.

modified:
  storage/connect/global.h
  storage/connect/inihandl.c
  storage/connect/os.h
  storage/connect/osutil.c
  storage/connect/osutil.h
2013-02-07 15:21:56 +04:00
Alexander Barkov
48ca5c6b44 Fixing redundant declaration.
modified:
  storage/connect/os.h
  storage/connect/osutil.h
2013-02-07 14:47:08 +04:00
Alexander Barkov
f3302230bd Removing reduntant ODBC constants.
Use "#include <sql.h>" when needed.

modified:
  storage/connect/catalog.h
2013-02-07 14:26:44 +04:00
Alexander Barkov
30c4b0ebc2 - Fixing TAB to 2 spaces
- Fixing line endings from "\r\n" to "\n"
2013-02-07 13:34:27 +04:00
Alexander Barkov
60c4cab3bd Adding missing DROP TABLE.
Otherwise, the further tests fail on "table t1 already exists"
2013-02-06 20:09:46 +04:00
Alexander Barkov
0758b2bded Adding a test for ODBC/XLS.
Currently only for ASCII data.
TODO: add tests for extended letters (e.g. Latin1, Cyrillic, etc).


added:
  mysql-test/suite/connect/r/odbc_xls.result
  mysql-test/suite/connect/std_data/contacts.xls
  mysql-test/suite/connect/t/odbc_xls.test
2013-02-06 20:04:17 +04:00
Alexander Barkov
22a8fb03db Introducing functions global_open() and global_fopen() for these purposes:
- Removing duplicate code to generate error message text
- In the future they will most likely check secure_file_priv directory.


modified:
  storage/connect/filamdbf.cpp
  storage/connect/filamfix.cpp
  storage/connect/filamtxt.cpp
  storage/connect/filamvct.cpp
  storage/connect/libdoc.cpp
  storage/connect/maputil.cpp
  storage/connect/plgdbsem.h
  storage/connect/plgdbutl.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabmul.cpp
  storage/connect/tabxml.cpp
  storage/connect/xindex.cpp
2013-02-06 15:17:34 +04:00
Alexander Barkov
9aa88d5050 Adding tests for TABLE_TYPE=FIX
added:
  mysql-test/suite/connect/r/fix.result
  mysql-test/suite/connect/std_data/boys.txt
  mysql-test/suite/connect/std_data/boyswin.txt
  mysql-test/suite/connect/std_data/dept.dat
  mysql-test/suite/connect/t/fix.test
2013-02-06 15:15:39 +04:00
Alexander Barkov
06dd5ea43e Adding basic tests for TABLE_TYPE=fmt
added:
  mysql-test/suite/connect/r/fmt.result
  mysql-test/suite/connect/std_data/funny.txt
  mysql-test/suite/connect/std_data/funny2.txt
  mysql-test/suite/connect/t/fmt.test
2013-02-06 14:15:55 +04:00
Alexander Barkov
1b40c7c76b Commenting ALTER test which changes the DBF file size.
It does not work on Windows.

modified:
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/t/dbf.test
2013-02-06 13:25:36 +04:00
Olivier Bertrand
1830e732fb Make possible to get ODBC DataSources name and description by:
create table datasrc (
`anyname` varchar(256) flag=1,
`anyother name` varchar(256) flag=2)
engine=CONNECT table_type=ODBC option_list='info=yes';

or simply by:

create table datasrc engine=CONNECT table_type=ODBC option_list='info=yes';

then:

select * from datasrc;

Modified:
ha_connect.cc
odbconn.h
odbconn.cpp
tabodbc.h
tabodbc.cpp
2013-02-05 01:56:22 +01:00
Alexander Barkov
9d8d62eeff Adding preliminary code to skip the test "xml".
It's incomplete, because CONNECT engine allows
to create the table even if libxml2 is not compiled.
Asked Olivier to reject CREATE TABLE in such cases.

modified:
  mysql-test/suite/connect/t/xml.test
2013-02-04 17:51:36 +04:00
Alexander Barkov
ead2372e55 Adding tests for NULL column values.
modified:
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/t/dbf.test
2013-02-04 14:47:30 +04:00
Alexander Barkov
49e3bb028c Adding tests for ALTER TABLE
modified:
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/t/dbf.test
2013-02-04 14:42:56 +04:00
Alexander Barkov
a38ae86951 Removing iconv dependency.
Using MariaDB in-house character set conversion routines.

modified:
  storage/connect/CMakeLists.txt
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
2013-02-04 13:28:34 +04:00
Alexander Barkov
dc6e20bda4 Fixing my_charset_utf8_bin to my_charset_utf8_general_ci.
The formed required strings.lib in Windows.
The latter is an exported symbol from mysqld and does not need strings.lib.

modified:
  storage/connect/ha_connect.cc
  storage/connect/libdoc.cpp
2013-02-04 11:37:35 +04:00
Olivier Bertrand
e89cb7f27a Translate column names to UTF-8 in ha_connect::pre_create. 2013-02-03 01:13:13 +01:00
Olivier Bertrand
9ca150aa2c 2>libdoc.cpp
2>D:\CommonSource\mariadb-10.0\include\my_pthread.h(120) : warning C4005: '_REENTRANT' : redéfinition de macro
2>        D:\Libxml\include\libxml/xmlexports.h(77) : voir la définition précédente de '_REENTRANT'
2>.\libdoc.cpp(378) : error C2664: 'strlen' : impossible de convertir le paramètre 1 de 'xmlChar *' en 'const char *'
2>        Les types pointés n'ont aucun rapport entre eux ; conversion nécessitant reinterpret_cast, cast de style C ou cast de style fonction
2>.\libdoc.cpp(379) : error C2664: 'copy_and_convert' : impossible de convertir le paramètre 4 de 'xmlChar *' en 'const char *'
2>        Les types pointés n'ont aucun rapport entre eux ; conversion nécessitant reinterpret_cast, cast de style C ou cast de style fonction
2>

Fix for that.
2013-02-02 00:18:32 +01:00
Alexander Barkov
f1b87189c6 Fixing a typo:
#ifdef defined(XXX) ->
#ifdef XXX
2013-02-01 21:42:36 +04:00
Alexander Barkov
7a8402c98d Replacing iconv converstion routines in libdoc.cc to MariaDB routines.
TODO: Access to Field->charset() instead of hardcoded latin1 conversion.

modified:
  storage/connect/libdoc.cpp
  storage/connect/libdoc.h
2013-02-01 17:28:13 +04:00
Alexander Barkov
1e976f420e Adding tests for SMALLINT and BIGINT for DBF.
modified:
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/t/dbf.test
2013-02-01 15:09:41 +04:00
Alexander Barkov
dde8622c20 More XML related definitions are now more friendly:
- LIBXML2_SUPPORT is defined if LibXml2 is found
- DOMDOC_SUPPORT  is defined if msxml is found
- XML_SUPPORT is defined if either of them are found

NOXML2 was removed

modified:
  storage/connect/CMakeLists.txt
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/plgdbutl.cpp
  storage/connect/plgxml.cpp
2013-02-01 14:55:11 +04:00
Alexander Barkov
733ab86c25 Adding an option to switch off ICONV support:
cmake -DCONNECT_WITH_ICONV=0

modified:
  storage/connect/CMakeLists.txt
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
2013-02-01 13:36:56 +04:00
Alexander Barkov
f09ae60d30 Fixing to use my_interval_timer() instead of ftime().
The later is not portable (e.g. it does not exist on FreeBSD)

modified:
  storage/connect/ha_connect.cc
  storage/connect/user_connect.cc
  storage/connect/user_connect.h
2013-02-01 12:49:04 +04:00