Commit graph

93 commits

Author SHA1 Message Date
Olivier Bertrand
1e1345c451 - Raise the limit on returned lines for table ODBC catalog tables
to 16384 (MDEV-5393)

modified:
  storage/connect/odbconn.cpp

- Fix sorting catalog table result set (MDEV-5394)

added:
  storage/connect/mysql-test/connect/r/xml_mdev5261.result
  storage/connect/mysql-test/connect/t/xml_mdev5261.test
modified:
  storage/connect/mysql-test/connect/r/odbc_sqlite3.result
  storage/connect/mysql-test/connect/t/odbc_sqlite3.test
  storage/connect/table.cpp
  storage/connect/tabodbc.cpp
  storage/connect/xtable.h

- Remove unnecessary closing of opened table in rnd_init

modified:
  storage/connect/ha_connect.cc
2013-12-06 01:37:56 +01:00
Alexander Barkov
37611b2a32 MDEV-5343 ConnectSE: ODBC: CATFUNC=Tables and CATFUNC=Columns crash when
running against a data source with many tables
2013-12-05 18:31:14 +04:00
Olivier Bertrand
e694ac4193 - Suppress eventual prompting when connecting to an ODBC source
modified:
  storage/connect/odbconn.cpp
2013-12-05 12:32:06 +01:00
Olivier Bertrand
385dbaeae0 - Fix gcc compilation warnings
modified:
  storage/connect/odbconn.cpp

- Prepare Value and Valblk to support unsigned data types
  (not operational yet)

modified:
  storage/connect/colblk.cpp
  storage/connect/filamvct.cpp
  storage/connect/myconn.cpp
  storage/connect/plgdbutl.cpp
  storage/connect/tabdos.cpp
  storage/connect/tabodbc.cpp
  storage/connect/tabvct.cpp
  storage/connect/valblk.cpp
  storage/connect/valblk.h
  storage/connect/value.cpp
  storage/connect/value.h
  storage/connect/xindex.cpp
2013-11-26 11:47:48 +01:00
Olivier Bertrand
aaa982e790 - Fix good recognition of MYSQL table column types.
modified:
  storage/connect/ha_connect.cc
  storage/connect/myconn.cpp
  storage/connect/myutil.cpp
  storage/connect/odbccat.h
  storage/connect/odbconn.cpp
  storage/connect/tabmysql.cpp

- Add tests on new MYSQL features

added:
  storage/connect/mysql-test/connect/my.cnf
  storage/connect/mysql-test/connect/r/mysql_discovery.result
  storage/connect/mysql-test/connect/r/mysql_exec.result
  storage/connect/mysql-test/connect/r/mysql_new.result
  storage/connect/mysql-test/connect/t/myconn.inc
  storage/connect/mysql-test/connect/t/myconn_cleanup.inc
  storage/connect/mysql-test/connect/t/mysql_discovery.test
  storage/connect/mysql-test/connect/t/mysql_exec.test
  storage/connect/mysql-test/connect/t/mysql_new.test
2013-11-22 16:03:54 +01:00
Olivier Bertrand
793f05c321 - Modify the way UPDATE and DELETE statements are sent to ODBC
and MYSQL CONNECT tables to take care of kewords such as IGNORE.

modified:
  storage/connect/myconn.cpp
  storage/connect/odbconn.cpp
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
2013-11-13 00:15:38 +01:00
Olivier Bertrand
eca84a9b18 - Add (limited) support for UPDATE and DELETE to ODBC tables
(also provide the possibility to issue NOTE warnings)

modified:
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/odbconn.cpp
  storage/connect/odbconn.h
  storage/connect/plgdbsem.h
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h

- Return proper error number when modifying read only tables

modified:
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/mysql-test/connect/r/bin.result
  storage/connect/mysql-test/connect/r/csv.result
  storage/connect/mysql-test/connect/r/dbf.result
  storage/connect/mysql-test/connect/r/fix.result
  storage/connect/mysql-test/connect/r/ini.result
  storage/connect/mysql-test/connect/r/vec.result
  storage/connect/mysql-test/connect/t/bin.test
  storage/connect/mysql-test/connect/t/csv.test
  storage/connect/mysql-test/connect/t/dbf.test
  storage/connect/mysql-test/connect/t/fix.test
  storage/connect/mysql-test/connect/t/ini.test
  storage/connect/mysql-test/connect/t/vec.test
  storage/connect/table.cpp
  storage/connect/taboccur.cpp
  storage/connect/tabpivot.cpp
  storage/connect/tabutil.cpp
  storage/connect/tabwmi.cpp
  storage/connect/tabxcl.cpp
2013-11-11 13:00:39 +01:00
Olivier Bertrand
056f35d0c1 - Move all enum AMT definitions in one place (plgdbsem.h)
modified:
  storage/connect/filamtxt.h
  storage/connect/filamzip.h
  storage/connect/myconn.h
  storage/connect/plgdbsem.h
  storage/connect/taboccur.h
  storage/connect/tabutil.h
  storage/connect/tabxcl.h

- Add the possibility to execute several commands in one query of
  an EXECSRC tables (using ...where command in (cmd list);)

modified:
  storage/connect/ha_connect.cc
  storage/connect/odbconn.cpp
  storage/connect/odbconn.h
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
  storage/connect/tabtbl.cpp
  storage/connect/tabwmi.cpp
  storage/connect/xtable.h

- Enhance retrieving column definitions in discovery:
  From SRCDEF adding LIMIT 0 to the executed query
  Testing if type, length, and precision are compatible
  Making the distinction between CHAR and VARCHAR

modified:
  storage/connect/ha_connect.cc
  storage/connect/myconn.cpp
  storage/connect/mysql-test/connect/r/mysql.result
  storage/connect/mysql-test/connect/r/odbc_sqlite3.result
  storage/connect/mysql-test/connect/r/odbc_sqlite3_grant.result
  storage/connect/myutil.h
  storage/connect/myutil.h
  storage/connect/odbconn.cpp
  storage/connect/value.h
2013-11-06 18:22:09 +01:00
Olivier Bertrand
89e71ffb40 - Fix some GCC compiler eroors and warnings
modified:
  storage/connect/ha_connect.cc
  storage/connect/odbconn.cpp
  storage/connect/odbconn.h
2013-10-27 14:32:54 +01:00
Olivier Bertrand
ba3f4a2cc9 - Add new features to ODBC table type
Srcdef definition
  Execute command tables
  uncomplete connect string

modified:
  storage/connect/ha_connect.cc
  storage/connect/odbccat.h
  storage/connect/odbconn.cpp
  storage/connect/odbconn.h
  storage/connect/plgdbsem.h
  storage/connect/plgdbutl.cpp
  storage/connect/tabodbc.cpp
2013-10-26 00:43:03 +02:00
Olivier Bertrand
c0907d57b1 - Fix compile error on some plarforms (64bits?)
modified:
  storage/connect/odbconn.cpp
2013-10-12 00:31:09 +02:00
Olivier Bertrand
ca4c54aaee - Fix bug when closing some table types
modified:
  storage/connect/tabmul.cpp
  storage/connect/tabmysql.cpp
  storage/connect/tabodbc.cpp

- Add Insert support for ODBC table
  Add the send command feature to ODBC tables
  (not documented yet)

modified:
  storage/connect/ha_connect.cc
  storage/connect/myconn.cpp
  storage/connect/odbccat.h
  storage/connect/odbconn.cpp
  storage/connect/odbconn.h
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
2013-10-11 13:57:56 +02:00
Olivier Bertrand
dd0872eb9c - Handle TINY in ODBC type conversion
modified:
  storage/connect/odbconn.cpp

- Enhance TYPBLK<TYPE>::GetMaxLength

modified:
  storage/connect/valblk.cpp
2013-08-25 11:12:54 +02:00
Alexander Barkov
18fc51f5a4 Merge with 10.0-connect 2013-08-15 13:31:49 +04:00
Olivier Bertrand
0993d4b4f5 - Change the Blanks parameter from true to false in catalog getting
information function. This solve the problem of uninitialised zone
  that was detected by valgrind.

modified:
  storage/connect/myconn.cpp
  storage/connect/odbconn.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabutil.cpp
  storage/connect/tabwmi.cpp
2013-08-14 16:07:32 +02:00
Sergey Vojtovich
e8d593fbda MDEV-4786 - merge 10.0-monty - 10.0
Fixed connect compilation failure (with ODBC).

storage/connect/odbconn.cpp:
  min/max are not defined by my_global.h anymore, include osutil.h instead.
2013-07-24 16:45:24 +04:00
Olivier Bertrand
d24e1fc82a - cleaning code and show some functions return code
modified:
  storage/connect/odbconn.cpp
2013-07-11 17:44:15 +02:00
Olivier Bertrand
b3ad9a97e9 - Suppress some ubuntu compiler warnings
modified:
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  storage/connect/odbconn.cpp
  storage/connect/osutil.c
  storage/connect/tabutil.cpp
2013-07-08 19:03:15 +02:00
Alexander Barkov
d7283bc59a Fixing some of the memory leaks in ODBCColumns().
modified:
  storage/connect/odbconn.cpp
2013-07-08 13:11:40 +04:00
Alexander Barkov
a8fb8e141e Fixing a warning:
- cast to pointer from integer of different size 

modified:
  storage/connect/odbconn.cpp
2013-07-08 11:43:45 +04:00
Alexander Barkov
66c1665e89 Fixing numerous "variable is set but never used" warnings.
modified:
  storage/connect/filamfix.cpp
  storage/connect/filamtxt.cpp
  storage/connect/filamvct.cpp
  storage/connect/odbconn.cpp
  storage/connect/tabodbc.cpp
  storage/connect/xindex.cpp
2013-07-08 10:20:53 +04:00
Alexander Barkov
54f3292831 Fixing warnings (mostly "no previous declaration")
modified:
  storage/connect/ha_connect.cc
  storage/connect/maputil.h
  storage/connect/odbconn.cpp
  storage/connect/osutil.c
  storage/connect/osutil.h
  storage/connect/tabmysql.cpp
  storage/connect/tabutil.cpp
  storage/connect/tabutil.h
2013-05-13 16:48:03 +04:00
Alexander Barkov
33d1689fcf Fixing compiler warnings ("no previous declaration for ...")
added:
  storage/connect/rcmsg.h
modified:
  storage/connect/CMakeLists.txt
  storage/connect/odbconn.cpp
  storage/connect/plgdbutl.cpp
  storage/connect/plugutil.c
  storage/connect/rcmsg.c
  storage/connect/tabodbc.cpp
2013-05-13 15:57:49 +04:00
Alexander Barkov
35a879d06d Fixing a few "no previous declaration" warnings
modified:
  storage/connect/ha_connect.cc
  storage/connect/odbconn.cpp
  storage/connect/plgdbutl.cpp
  storage/connect/plugutil.c
  storage/connect/value.cpp
2013-05-13 15:23:24 +04:00
Olivier Bertrand
99d95c8a2f - Added table type PIVOT
modified:
  storage/connect/filamdbf.cpp
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/mycat.cc
  storage/connect/myconn.cpp
  storage/connect/odbconn.cpp
  storage/connect/plgcnx.h
  storage/connect/plgdbsem.h
  storage/connect/plgdbutl.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabpivot.cpp
  storage/connect/tabpivot.h
  storage/connect/tabutil.cpp
  storage/connect/tabwmi.cpp
  storage/connect/tabxcl.cpp
  storage/connect/value.cpp
  storage/connect/value.h
2013-05-10 20:22:21 +02:00
Olivier Bertrand
7a30ec7231 - XML and INI tables now return NULL when a node does not exist in a row (XML)
or if the key is missing in a section (INI)

modified:
  mysql-test/suite/connect/r/ini.result
  mysql-test/suite/connect/r/xml.result
  storage/connect/tabsys.cpp
  storage/connect/tabxml.cpp

- Do a sub-storage cleanup on info commands and fix a limit of column number
  in ODBCColumns. This was doing a crash for unexpected longjmp when many info
  commands were executed in a row.

modified:
  storage/connect/ha_connect.cc
  storage/connect/odbconn.cpp
2013-03-10 15:10:00 +01:00
Olivier Bertrand
7132c590ca - Fix a miscalculation of column length in ODBCTables
- Clean code in Value.h

modified:
  storage/connect/odbconn.cpp
  storage/connect/value.h
2013-02-27 22:42:50 +01:00
Olivier Bertrand
edd161587e - Catalog table: Use XFLD as Flag value instead of column index.
- Use the COLDEF flag to initialize column nullable value.
- Fix a bug on inserting null values in MYSQL tables.

modified:
  storage/connect/colblk.cpp
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
  storage/connect/odbconn.cpp
  storage/connect/plgdbsem.h
  storage/connect/table.cpp
  storage/connect/tabmysql.cpp
2013-02-25 22:44:42 +01:00
Olivier Bertrand
8e1c194904 Modification of the ODBConn class to change m_henv member from
static to dynamic. Apparently this caused errors with a obscure
message saying "Invalid handle vale" (probably m_henv).

Modified:
odbconn.h
odbconn.cpp
2013-02-18 00:18:32 +01:00
Olivier Bertrand
618ce65aff Modification of the DBX class to have more information
in case of error while processing ODBC type tables.

Modified:
odbconn.h
odbconn.cpp
2013-02-17 11:34:40 +01:00
Olivier Bertrand
df1dfcff6c Put trace in ODBC source files
modified:
  storage/connect/odbconn.cpp
  storage/connect/tabodbc.cpp
2013-02-15 22:31:13 +01:00
Olivier Bertrand
88c76f3b70 All use of a character to represent table types or
catalog functions have been changed:

Table_types are now internally represented be enum TABTYPE.
Catalog function names are internally translated to a uint.

The function GetTypeID was modified accordingly and a new
function GetFuncID was implemented in mycat.cc.

Modified:
ha_connect.cc
odbccat.h
odbconn.cpp
tabodbc.cpp
tabfmt.cpp
tabmysql.h
tabmysql.cpp
tabwmi.cpp
mycat.h
mycat.cc
plgdbsem.h
reldef.h
tabdos.cpp
rcmsg.h
2013-02-12 12:34:14 +01: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
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
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
30c4b0ebc2 - Fixing TAB to 2 spaces
- Fixing line endings from "\r\n" to "\n"
2013-02-07 13:34:27 +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
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
Olivier Bertrand
ba82edd41e Fix problems with ODBC raised by Adding the type TYPE_BIGINT (longlong). 2013-01-24 19:18:54 +01:00
Alexander Barkov
37465ea2fe Adding an Olivier's changeset:
pre_create function and one is now able to create table
without giving the column specifications for tables of types:
DBF, ODBC, MYSQL, CSV, and WMI (on Windows)

modified:
  sql/handler.h
  sql/sql_table.cc
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/mycat.cc
  storage/connect/odbconn.cpp
  storage/connect/plgcnx.h
  storage/connect/tabfmt.cpp
  storage/connect/tabmysql.cpp
  storage/connect/tabwmi.cpp
2013-01-22 18:14:34 +04:00
Alexander Barkov
d7143a4160 Adding the CONNECT storage engine sources. 2013-01-18 19:21:44 +04:00