Commit graph

76358 commits

Author SHA1 Message Date
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
Alexander Barkov
3d8ef8bf2f ftime does not exist on FreeBSD.
Hiding calls for ftime() as a temporary fix.

This code should be modified to use my_time_microseconds() instead.
2013-02-01 16:11:55 +04:00
Alexander Barkov
d10116292b Adding separate flags to disable MSXML and LIBXML2 libraries on Windows:
-DCONNECT_WITH_LIBXML2=0
-DCONNECT_WITH_MSXML=0

modified:
  storage/connect/CMakeLists.txt
2013-02-01 10:06:32 +04:00
Olivier Bertrand
627d046df5 DBF type N is now BIGINT when length is > 10.
Fix ha_connect::external_lock to use F_RDLCK, F_WRLCK, F_UNLCK.
2013-01-31 22:55:56 +01:00
Alexander Barkov
e8c24a7374 Adding OPTION_LIST='xmlsup=libxml2' to make
sure the tests work in a similar way on Windows
      when both DOMDOC and LIBXML2 are compiled.

      Tests with DOMDOC will go into a separate *.test file.

      modified:
        mysql-test/suite/connect/r/xml.result
        mysql-test/suite/connect/t/xml.test
        storage/connect/CMakeLists.txt
2013-01-31 18:01:55 +04:00
Alexander Barkov
1e3610dd48 Adding basic XML tests. More XML tests coming soon.
added:
  mysql-test/suite/connect/r/xml.result
  mysql-test/suite/connect/std_data/
  mysql-test/suite/connect/std_data/cp1251.xml
  mysql-test/suite/connect/std_data/latin1.xml
  mysql-test/suite/connect/std_data/nocs.xml
  mysql-test/suite/connect/std_data/xsample.xml
  mysql-test/suite/connect/t/xml.test
2013-01-31 17:44:36 +04:00
Alexander Barkov
8eccf8dd72 Adding DBF stored procedures to dump the underlying DBF file structure.
modified:
    mysql-test/suite/connect/r/dbf.result
    mysql-test/suite/connect/t/dbf.test
2013-01-31 13:13:24 +04:00
Olivier Bertrand
ad41e7ee40 Fix incorrect DBF type setting for SORT and BIGINT. 2013-01-31 00:58:22 +01:00
Alexander Barkov
7af8c83df3 Adding more DBF tests for ENGINE=CONNECT.
modified:
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/t/dbf.test
2013-01-30 18:34:03 +04:00
Alexander Barkov
8d49e7ddf1 Adding a test suite for the CONNECT storage engine.
added:
  mysql-test/suite/connect/
  mysql-test/suite/connect/r/
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/suite.opt
  mysql-test/suite/connect/suite.pm
  mysql-test/suite/connect/t/
  mysql-test/suite/connect/t/dbf.test
2013-01-30 16:14:11 +04:00
Olivier Bertrand
29df840a11 Fix problems with ODBC raised by Adding the type TYPE_BIGINT (longlong). 2013-01-30 00:15:54 +01:00
Olivier Bertrand
74b51d9525 Fix problems with ODBC raised by Adding the type TYPE_BIGINT (longlong). 2013-01-30 00:00:10 +01:00
Olivier Bertrand
26b00be332 Fix problems with ODBC raised by Adding the type TYPE_BIGINT (longlong). 2013-01-29 23:40:34 +01:00
Alexander Barkov
c87004d817 Removing os2def.h
removed:
  storage/connect/os2def.h
modified:
  storage/connect/fmdlex.c
  storage/connect/maputil.cpp
  storage/connect/tabcol.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabmul.cpp
  storage/connect/tabmysql.cpp
2013-01-29 23:23:03 +04:00
Alexander Barkov
a9d06e1066 Adding a comment why TranslateSQLType is exported.
modified:
  storage/connect/value.h
2013-01-29 21:37:39 +04:00
Alexander Barkov
258c6d479e Removing redundant declaration of ulonglong.
It's defined in my_global.h which is included through handler.h

modified:
  storage/connect/connect.cc
2013-01-29 20:00:01 +04:00
Alexander Barkov
18e02f0608 Fixing compilation failure caused by wrong definition of DWORD
in unixODBC headers on 64-bit platforms.
Moving function definitions from value.cpp to odbconn.cpp.
Changing scope of GetSQLType and GetSQLCType from public to static.


modified:
  storage/connect/odbconn.cpp
  storage/connect/value.cpp
  storage/connect/value.h
2013-01-29 19:35:17 +04:00
Alexander Barkov
ab76cdb236 Compilation failed on Debian 32-bit.
Fixing DWORD definition once again as "unsigned long",
which is the way how MS defines it.

modified:
  @ storage/connect/os.h
    Changing DWORD defitition

  @ storage/connect/tabodbc.cpp
    Moving "#define NODW" to proper place.
2013-01-29 19:15:22 +04:00
Alexander Barkov
d78d3d4fc9 Removing more duplicate declarations.
Fixing DWORD declaration to "unsigned int".
Fixing BIGINT declatation from uint64_t to longlong.
2013-01-29 17:30:02 +04:00