Commit graph

308 commits

Author SHA1 Message Date
Olivier Bertrand
cc38c51191 - Commit merged and resolve
added:
  storage/connect/inihandl.h
  storage/connect/rcmsg.h
modified:
  storage/connect/CMakeLists.txt
  storage/connect/connect.h
  storage/connect/ha_connect.cc
  storage/connect/inihandl.c
  storage/connect/maputil.h
  storage/connect/odbconn.cpp
  storage/connect/osutil.c
  storage/connect/osutil.h
  storage/connect/plgdbutl.cpp
  storage/connect/plugutil.c
  storage/connect/rcmsg.c
  storage/connect/tabmysql.cpp
  storage/connect/tabodbc.cpp
  storage/connect/tabpivot.cpp
  storage/connect/tabsys.cpp
  storage/connect/tabutil.cpp
  storage/connect/tabutil.h
  storage/connect/user_connect.cc
  storage/connect/value.cpp
2013-05-19 19:53:38 +02:00
Olivier Bertrand
c035bde34c - Allowing views and queries as parameters for PROXY base tables
NOTE: Checking for looping references cannot be done when using views
  as parameters. This should not be allowed on production servers and
  should be dependant on a system variable and/or on speciel grant.

modified:
  storage/connect/CMakeLists.txt
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
  storage/connect/myconn.cpp
  storage/connect/myconn.h
  storage/connect/mysql-test/connect/r/fmt.result
  storage/connect/mysql-test/connect/r/pivot.result
  storage/connect/mysql-test/connect/t/fmt.test
  storage/connect/mysql-test/connect/t/pivot.test
  storage/connect/plgdbsem.h
  storage/connect/plugutil.c
  storage/connect/tabcol.cpp
  storage/connect/tabcol.h
  storage/connect/tabfmt.cpp
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
  storage/connect/taboccur.cpp
  storage/connect/taboccur.h
  storage/connect/tabpivot.cpp
  storage/connect/tabpivot.h
  storage/connect/tabtbl.cpp
  storage/connect/tabutil.cpp
  storage/connect/tabutil.h
  storage/connect/xtable.h
2013-05-19 19:25:06 +02: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
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
Alexander Barkov
d22b1a0b35 Fixing a few compilation warnings ("no previous declaration for XXX")
added:
  storage/connect/inihandl.h
modified:
  storage/connect/CMakeLists.txt
  storage/connect/connect.h
  storage/connect/ha_connect.cc
  storage/connect/inihandl.c
  storage/connect/osutil.h
  storage/connect/tabsys.cpp
  storage/connect/user_connect.cc
2013-05-13 14:59:59 +04:00
Olivier Bertrand
35f813143b - Set tdbp to NULL when ignored
modified:
  storage/connect/ha_connect.cc
2013-05-13 10:37:35 +02:00
Olivier Bertrand
8c9ce17359 - Code cleaning.
modified:
  storage/connect/connect.cc
  storage/connect/tabutil.h

- Fix closing invalid tdbp in External_lock.
modified:
  storage/connect/ha_connect.cc

- Fix closing null Tdbp
modified:
  storage/connect/tabpivot.cpp*

- Fix regression error in table type TBL no more accepting missing
  columns in sub-tables even when Accept was set to TRUE.
modified:
  storage/connect/tabtbl.cpp
2013-05-12 18:14:03 +02: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
5fc19f8db8 - Add test for XCOL and OCCUR tables
- Fix a bug causing a crash when doing an ALTER TABLE
  (because create_info->alias is NULL)

added:
  storage/connect/mysql-test/connect/r/occur.result
  storage/connect/mysql-test/connect/r/xcol.result
  storage/connect/mysql-test/connect/t/occur.test
  storage/connect/mysql-test/connect/t/xcol.test
modified:
  storage/connect/ha_connect.cc
2013-05-04 00:47:55 +02:00
Olivier Bertrand
f3e944099e - Adding a loop test to prevent PROXY based table to loop when repointing on itself.
- Fix bug causing PROXY on non CONNECT tables to sometimes use the wrong DB.
- Making some more tests in create that were in pre_create not called anymore
  when columns are defined.
- Updating some test results to reflect new warnings.

modified:
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/tbl.result
  storage/connect/mysql-test/connect/r/upd.result
  storage/connect/tabcol.h
  storage/connect/tabmysql.cpp
  storage/connect/taboccur.cpp
  storage/connect/taboccur.h
  storage/connect/tabtbl.cpp
  storage/connect/tabtbl.h
  storage/connect/tabutil.cpp
  storage/connect/tabutil.h
  storage/connect/tabxcl.cpp
  storage/connect/tabxcl.h
2013-05-02 16:33:15 +02:00
Olivier Bertrand
3d4adc3fdf - Change in connect_assisted_discovery the default value for port from MYSQL_PORT
to 0. So it can be later set to mysqld_port if necessary. Doing so, it is no
  more required to specify port when using the current port and the current port
  is not equal to MYSQL_PORT (3306)

modified:
  storage/connect/ha_connect.cc
2013-04-30 17:48:18 +02:00
Olivier Bertrand
4fd74200dd - Adding 3 new table types:
PROXY table base on another table. Used by several other types.
  XCOL  proxy on a table having a colummn containing a list of values
  OCCUR proxy on a table having several columns containing the same type
        of values that can be put in a unique column and several rows.
  TBL   Not new but now internally using the PROXY table class.
- Fix 2 bugs in add_field:
        Change '=' to ' ' after the COMMENT keyword.
        Quote column names between '`' in the SQL string.
- Update xml test result to the CONNECT version

added:
  storage/connect/taboccur.cpp
  storage/connect/taboccur.h
  storage/connect/tabutil.cpp
  storage/connect/tabutil.h
  storage/connect/tabxcl.cpp
  storage/connect/tabxcl.h
modified:
  storage/connect/CMakeLists.txt
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/mycat.cc
  storage/connect/myconn.cpp
  storage/connect/mysql-test/connect/r/xml.result
  storage/connect/plgdbsem.h
  storage/connect/tabmysql.cpp
  storage/connect/tabtbl.cpp
  storage/connect/tabtbl.h
  storage/connect/valblk.cpp
  storage/connect/valblk.h
2013-04-29 13:50:20 +02:00
Alexander Barkov
b44f11c994 Fixing compilation failure in Solaris/OpenSolaris
error: too many initializers for `tm'

modified:
  storage/connect/ha_connect.cc
2013-04-21 18:38:08 +04:00
Alexander Barkov
a6a4fa1d6f Fixing a few problems found by Build Bot after merging the CONNECT engine.
modified:
  @ mysql-test/r/mysqld--help.result
  @ mysql-test/t/mysqld--help.test
  Supressing information about "--connect" in "mysqld --help" output,
  as it depends on the build parameters.
  As a side effect information about --connect-timeout is now also suppressed :(

  @ storage/connect/CMakeLists.txt
  Removing gcc warning switches that do not exists in some older gcc versions.

  @ storage/connect/ha_connect.cc
  Adding a quick fix: cast from "const char *" to "char *".
  Olivier should do a better fix eventually.
2013-04-20 19:23:33 +04:00
Alexander Barkov
548399f6d0 After-fix for Sergei's merge of the connect engine.
odbc_sqlite3 failed. Fixed.

modified:
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/odbc_sqlite3.result
  storage/connect/mysql-test/connect/t/odbc_sqlite3.test
2013-04-20 00:24:05 +04:00
Sergei Golubchik
6bd49441b5 CONNECT engine fixes after 10.0 merge.
Adaptation to new API, small simplifications and bug fixes
2013-04-19 20:35:43 +02:00
Olivier Bertrand
8cf33505f1 - Extend the TBL type to support sub-tables of any engines. Not CONNECT
sub-tables are accessed via the MySQL API like the MYSQL CONNECT tables.

modified:
  mysql-test/suite/connect/r/tbl.result
  mysql-test/suite/connect/t/tbl.test
  storage/connect/catalog.h
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  storage/connect/mycat.h
  storage/connect/tabmysql.h
  storage/connect/tabtbl.cpp
2013-04-12 18:30:15 +02:00
Olivier Bertrand
1357bffbf3 - Add support of NULLs for file table columns.
Update CONNECT version number and date.

modified:
  mysql-test/suite/connect/r/null.result
  mysql-test/suite/connect/r/xml.result
  mysql-test/suite/connect/t/null.test
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  storage/connect/tabdos.cpp
  storage/connect/tabfix.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabtbl.cpp
  storage/connect/tabvct.cpp
2013-04-10 23:38:27 +02:00
Olivier Bertrand
9b790248c5 - Add routine to test index equality
modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/xindex.h
2013-04-10 14:24:28 +02:00
Olivier Bertrand
6be6b4ab76 - All the processing of creating, dropping, modifying indexes was redesigned.
The code was a legacy from the first versions of the XDB engine dating 2004
  and was not working anymore with recent versions of MySQL/MariaDB. A patch
  in create had been added but is was unsatisfying, recreating all indexes on
  any alter statement and sometimes doing nothing when it should have.
  This is a major update to be tested for stability. It was in most important
  cases et all current tests pass with this new version

modified:
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/mycat.cc
  storage/connect/plugutil.c
  storage/connect/tabdos.cpp
  storage/connect/user_connect.cc
  storage/connect/user_connect.h
  storage/connect/xindex.h
2013-04-09 23:14:45 +02:00
Olivier Bertrand
806ca8ddb5 - Do not check columns name length of dbf catalog tables. They return info
on a dbf table but are not dbf tables.

modified:
  storage/connect/ha_connect.cc
2013-04-05 23:57:30 +02:00
Olivier Bertrand
4adb4256cc - Update some DBUG_PRINT to avois warning on Linux
modified:
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
2013-04-04 23:27:54 +02:00
Olivier Bertrand
7e0f591f6a - Do not accept creating XML2 tables when libxml2 is not available
modified:
  storage/connect/ha_connect.cc
2013-04-04 15:36:42 +02:00
Alexander Barkov
d12e1c92a1 Adding security tests for "ALTER TABLE t1 FILE_NAME='xxx'"
modified:
  mysql-test/suite/connect/r/bin.result
  mysql-test/suite/connect/r/csv.result
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/r/fix.result
  mysql-test/suite/connect/r/vec.result
  mysql-test/suite/connect/r/xml.result
  mysql-test/suite/connect/t/grant.inc
  storage/connect/ha_connect.cc
2013-04-04 11:31:20 +04:00
Olivier Bertrand
b0e07ff5b7 - Commit added test on TBL tables
+ update dbf.result

added:
  mysql-test/suite/connect/r/tbl.result
  mysql-test/suite/connect/t/tbl.test
modified:
  mysql-test/suite/connect/r/dbf.result

- Fix bug on generating default file name for TBL sub-tables

modified:
  storage/connect/ha_connect.cc
2013-04-04 01:14:26 +02:00
Olivier Bertrand
7e7d3ce558 - Block creating tables with auto_incremented colummns (not supported)
+ allow nullable columns for TBL tables

modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/mycat.cc
  storage/connect/mycat.h
2013-04-03 21:54:02 +02:00
Olivier Bertrand
b1031b2359 - Fold type name to lowercase when used for default file type
modified:
  storage/connect/ha_connect.cc
2013-04-02 12:54:57 +02:00
Olivier Bertrand
3389e81dd1 - Commit pulled changes
added:
  mysql-test/suite/connect/r/secure_file_priv.result
  mysql-test/suite/connect/t/secure_file_priv-master.opt
  mysql-test/suite/connect/t/secure_file_priv.test
modified:
  storage/connect/ha_connect.cc
2013-04-02 11:35:38 +02:00
Olivier Bertrand
0f5c5a29f9 - Comment out the last commited change
modified:
  storage/connect/ha_connect.cc
2013-04-02 11:31:46 +02:00
Alexander Barkov
4bba25543d Respect the --secure-file-priv server option when working with
tables having the FILE_NAME='xxx' table option.

added:
  mysql-test/suite/connect/r/secure_file_priv.result
  mysql-test/suite/connect/t/secure_file_priv-master.opt
  mysql-test/suite/connect/t/secure_file_priv.test
modified:
  storage/connect/ha_connect.cc
2013-04-02 13:10:42 +04:00
Alexander Barkov
86eeb04a93 Fixing a crash in the latest push from Olivier.
modified:
  storage/connect/ha_connect.cc
2013-04-01 09:34:39 +04:00
Olivier Bertrand
879be566e0 - Add some warnings to Create Table process
modified:
  storage/connect/filamvct.cpp
  storage/connect/ha_connect.cc
2013-03-30 22:06:35 +01:00
Olivier Bertrand
dd8c89b2f4 - Fix problems related to table file names when not specified:
Split unspecified VEC tables are no more allowed.
  Empty XML files are now accepted.
  Separate index files are now depending upon the SEPINDEX option
  and not allowed when file name is not specified.
  DROP now can erase table and index file.

modified:
  storage/connect/ha_connect.cc
  storage/connect/tabdos.cpp
  storage/connect/tabxml.cpp
2013-03-29 01:28:48 +01:00
Olivier Bertrand
cd9e1938ef - Add a new table option SEPINDEX (not used yet) and remove an unused
parameter to all catalog info functions.

modified:
  storage/connect/catalog.h
  storage/connect/filamvct.cpp
  storage/connect/filamzip.cpp
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  storage/connect/mycat.h
  storage/connect/reldef.cpp
  storage/connect/reldef.h
  storage/connect/tabdos.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabmul.cpp
  storage/connect/tabmysql.cpp
  storage/connect/tabodbc.cpp
  storage/connect/tabsys.cpp
  storage/connect/tabtbl.cpp
  storage/connect/tabvct.cpp
  storage/connect/tabwmi.cpp
  storage/connect/tabxml.cpp
  storage/connect/xindex.cpp
2013-03-25 11:07:45 +01:00
Olivier Bertrand
6a15b5f870 - Wrong FLAG values transmitted to created table by the AS SELECT table:
It is not enough to ignore the flags while populating the table. They have
  to be removed from the definition in pre_create. The issue is to pass the
  info from the selected table handler to the created table handler.
  It is done via the only common item between them: the GLOBAL structure.

modified:
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
  storage/connect/plugutil.c
2013-03-23 19:47:51 +01:00
Olivier Bertrand
6c6d6fbf41 - Fix bug: When a table is created ... AS SELECT ... the offsets (FLAG value)
of the source table columns must be ignored by the created table.

modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
2013-03-23 16:00:09 +01:00
Olivier Bertrand
322a99b097 - Fix check_if_incompatible_data to correctly get thd.
modified:
  storage/connect/ha_connect.cc
2013-03-22 12:57:24 +01:00
Olivier Bertrand
2ad6e653eb - Fix bug to allow creating views.
modified:
  storage/connect/ha_connect.cc
2013-03-22 12:49:41 +01:00
Alexander Barkov
70622eaac8 Fixing compilation failure in Windows: unknown symbol "any_db".
modified:
  storage/connect/ha_connect.cc
2013-03-22 14:05:15 +04:00
Alexander Barkov
8087daaeb3 Require FILE privilege to DROP a table with FILE_NAME.
modified:
  mysql-test/suite/connect/r/bin.result
  mysql-test/suite/connect/t/grant.inc
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
2013-03-22 13:44:21 +04:00
Alexander Barkov
79f84fdc77 - Require FILE privilege for the file based TABLE_TYPEs
when FILE_NAME is specified

- Require FILE privileges for the TABLE_TYPEs that
  access to the underlying operating system:
  ODBC, MYSQL, DIR, MAC, WMI, OEM.

added:
  mysql-test/suite/connect/t/grant.inc
modified:
  mysql-test/suite/connect/r/bin.result
  mysql-test/suite/connect/t/bin.test
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
2013-03-22 11:28:58 +04:00
Alexander Barkov
356402356a Removing executable flag.
modified:
  storage/connect/ha_connect.cc*
2013-03-21 11:34:58 +04:00
Olivier Bertrand
fff28085d8 - A specified table type not supported is now flagged as an error
instead of being replaced by the default type DOS.

modified:
  mysql-test/suite/connect/r/general.result
  mysql-test/suite/connect/t/general.test
  storage/connect/ha_connect.cc
2013-03-20 23:42:23 +01:00
Olivier Bertrand
964a423d2c - Fix a bug causing the index file not being made or erased on statements
such as CREATE INDEX, DROP INDEX, ALTER TABLE... ADD INDEX etc.

modified:
  storage/connect/ha_connect.cc
2013-03-20 00:52:32 +01:00
Olivier Bertrand
19e9fa45ea - Use all columns in case of INSERT so default values are generated for
columns not specified in the statemant.

modified:
  storage/connect/ha_connect.cc
2013-03-19 18:45:05 +01:00
Olivier Bertrand
5008a3e897 - Add in create a check for nullable columns not supported by some table types.
modified:
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  storage/connect/mycat.h
2013-03-17 11:31:11 +01:00
Olivier Bertrand
d2b6d80bc8 - A quick and dirty fix for erased or not erased files when executing an
Alter table on an auto-generated CONNECT table.

modified:
  storage/connect/ha_connect.cc
2013-03-15 00:11:46 +01:00
Olivier Bertrand
1c4a3eb9a6 - Fix bug on ALTER TABLE t1 MODIFY a VARCHAR(10) NOT NULL;
modified:
  storage/connect/ha_connect.cc
2013-03-13 16:06:02 +01:00
Olivier Bertrand
74115f5fa3 - Commit changes from ubuntu
modified:
  storage/connect/ha_connect.cc*
2013-03-13 02:02:44 +01:00
unknown
14f3d5a6c3 - Fix a GCC compile error (crosses initialization of pos) an change
_O_CREAT to O_CREAT

modified:
  storage/connect/ha_connect.cc
  
- Change mode to -x

modified:
  mysql-test/suite/connect/t/index.test*
  storage/connect/filamap.cpp*
2013-03-13 01:56:01 +01:00
Olivier Bertrand
b210168752 - Handle delete_table and rename_table for CONNECT tables whose files are
auto generated and must be erased or renamed on Drop or Rename Table.
  TODO: Take care of eventual index files.

modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
2013-03-13 01:10:20 +01:00
Olivier Bertrand
7572315ecd - New handling of default file name:
Not added as an option but handled when the table is used.
  An empty file is created in the database directory if not exists.

modified:
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  storage/connect/tabdos.cpp
  storage/connect/tabmul.cpp
  storage/connect/tabsys.cpp
  storage/connect/tabxml.cpp
2013-03-12 01:20:52 +01:00
Olivier Bertrand
17fb343a5c - Add tiny integer as a supported type by CONNECT
modified:
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/myutil.cpp
  storage/connect/plgdbutl.cpp
  storage/connect/tabdos.cpp
  storage/connect/tabwmi.cpp
  storage/connect/valblk.cpp
  storage/connect/valblk.h
  storage/connect/value.cpp
  storage/connect/value.h
  storage/connect/xobject.cpp
2013-03-11 16:52:59 +01:00
Olivier Bertrand
cb1847df32 - Make indexes to be rebuilt on Update only when an indexed column was updated.
modified:
  mysql-test/suite/connect/r/index.result
  mysql-test/suite/connect/t/index.test
  storage/connect/ha_connect.cc
  storage/connect/tabdos.cpp
  storage/connect/xindex.cpp
2013-03-10 19:48:45 +01: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
eab8fcfa3f - Set file name when unspecified as tablename.tabletype.
modified:
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  storage/connect/mycat.h
2013-03-07 21:38:00 +01:00
Olivier Bertrand
bc9c872483 - Calculate default date field length from the specified format.
modified:
  storage/connect/ha_connect.cc
2013-03-07 18:53:41 +01:00
Olivier Bertrand
6452fd3065 - Fix wrong format used in ScanRecord for MYSQL_TYPE_TIME
- Change field option BUF_LENGTH to FIELD_LENGTH. It now used to specify
  the field length of DATE columns (MySQL doesn't allow to give a length)

modified:
  storage/connect/ha_connect.cc
2013-03-05 19:30:40 +01:00
Olivier Bertrand
6a09944072 - FIX a BUG: error (wrong value set) in:
update xempl set ddentree = adddate(ddentree, interval 16 year);
  The same value sdval was used to convert MySQL dates to CONNECT date
  value and CONNECT dates to MySQL date. This was wrong in update because
  the second time the wrong value was used converting to incoherent values.
  There are now 2 separate values used: sdvalin and sdvalout.

modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
2013-03-03 15:37:27 +01:00
Olivier Bertrand
5972b56a6d - Fix conversion bug for MS-DOM XML tables. The node content was written
and read as if the table DATA_CHARSET was ANSI instead of UTF-8. Warning
  are now provided when the read content of a node is truncated.

modified:
  storage/connect/domdoc.cpp
  storage/connect/domdoc.h
  storage/connect/libdoc.cpp
  storage/connect/libdoc.h
  storage/connect/plgxml.h
  storage/connect/tabxml.cpp

- Conditional compilation of pre_create depending on the MARIADB setting.

modified:
  storage/connect/ha_connect.cc
  storage/connect/ha_connect.h
2013-03-02 17:58:18 +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
2b60525d57 - Add support to NULL values. This concern the MYSQL
and ODBC table types. Not supported yet for indexes.

modified:
  storage/connect/colblk.cpp
  storage/connect/colblk.h
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
  storage/connect/tabmysql.cpp
  storage/connect/tabodbc.cpp
  storage/connect/valblk.cpp
  storage/connect/valblk.h
  storage/connect/value.cpp
  storage/connect/value.h
  storage/connect/xindex.cpp
2013-02-24 01:23:18 +01:00
Olivier Bertrand
0a280eb8bd - Commiting merges
Simplify update in pre_create

modified:
  mysql-test/suite/connect/r/mysql.result
  mysql-test/suite/connect/t/mysql.test
  mysql-test/suite/connect/t/xml.test
  storage/connect/CMakeLists.txt
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
2013-02-22 22:04:47 +01:00
Olivier Bertrand
b535cb9874 - Add the support of URL connection string fo MYSQL tables
Federated servers are not yet supported.

modified:
  storage/connect/ha_connect.cc
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
2013-02-22 17:26:08 +01:00
Alexander Barkov
d899840afb - Adding tests for DBNAME=<unknown database name>.
- Fixing a bug that DBNAME value was forgotten when followed by OPTION_LIST.

modified:
  mysql-test/suite/connect/r/mysql.result
  mysql-test/suite/connect/t/mysql.test
  storage/connect/ha_connect.cc
2013-02-22 13:12:09 +04:00
Olivier Bertrand
24672d2db8 - Oops! db was no more initialized in pre-create. Fixed
modified:
  storage/connect/ha_connect.cc
  mysql-test/suite/connect/r/mysql.result  (merged)
  mysql-test/suite/connect/t/mysql.test    (merged)
2013-02-21 17:59:58 +01:00
Olivier Bertrand
183698b779 - Change DB_NAME option name to DBNAME. Temporarily, "database" is still
accepted in OPTION_LIST for compatibity but DB_NAME is no more recognized.

modified:
  storage/connect/ha_connect.cc
2013-02-21 17:48:35 +01:00
Alexander Barkov
ea0e250669 Fixing valgrind warning: uninitialized memory read.
modified:
  storage/connect/ha_connect.cc
2013-02-20 16:05:53 +04:00
Olivier Bertrand
c448839c4f - Fix crash on making an XML table with encoding=XXX
- Set parameters so libxml2 does not anymore add extra characters
  when retrieving several subnodes of a node.
- Make a CONNECT file header (was PlugDB)

modified:
  storage/connect/domdoc.cpp
  storage/connect/libdoc.cpp
  storage/connect/tabxml.cpp

- Change the version number

modified:
  storage/connect/ha_connect.cc

- Begin eliminate use of libmysql functions in MYSQL table type
  Not finished yet

modified:
  storage/connect/myconn.cpp
  storage/connect/myconn.h
2013-02-20 01:30:37 +01:00
Olivier Bertrand
2f48842a0f Commit merged changes. 2013-02-19 12:07:11 +01:00
Alexander Barkov
29cd5363b9 Removing unused code.
modified:
  storage/connect/ha_connect.cc
2013-02-19 14:29:55 +04:00
Olivier Bertrand
c1f244610b Don't why bazaar asked me to commit what was merged 2013-02-18 18:46:50 +01:00
Alexander Barkov
f41aadfaed Adding DATA_CHARSET table option. 2013-02-18 19:21:52 +04:00
Olivier Bertrand
739632cbe0 Moved PushWarning out of HAVE_PSI_INTERFACE brackets
Modified:
ha_connect.cc
2013-02-18 12:23:50 +01:00
Olivier Bertrand
33b2c6fe7b Fixed a bug in ha_connect::GetListOption causing a crash
when passed a NULL oplist argument.

Modified:
ha_connect.cc
2013-02-15 02:15:48 +01:00
Olivier Bertrand
f83588a0f9 Implementing pre_create option test and setting of default values.
Currently, only TABLE_TYPE is tested, and if wrong or unspecified,
is replaced by the default value DOS.

- Test on type was moved from create to pre_create
- pre_create is now called unconditionally and must return true
  on error and false otherwise.
- Warnings are produced if the table type was changed.
- The errors have specific error messages (instead of being warnings
  with an error message telling that a table must have columns)

Modified:
ha_connect.cc
ha_connect.h
handler.h
sql_table.cc
2013-02-15 01:33:23 +01:00
Alexander Barkov
3a91f1a998 Code reorganization in the initialization and clean-up code.
- Getting rid of some duplicate code in the Windows and Linux sections
- Moving the initializationa and clean-up code to connect_init_func()
  and connect_done_func(). This allows to use services provided by
  mysqld, for example my_snprintf(), which do not work in
  "__attribute__((constructor))init()".
- Removing the "__attribute__((constructor)) init()" and
  "__attribute__((destructor)) fini()" functions
- Using MariaDB's my_getpw() instead of different calls for Windows
  and Linux.
- Fixing a potentially wrong memory write in strcat() when creating
  the full connect.ini file name.
  strcat() can go outside of the buffer size when directory name is
  long enough. Using safe my_snprintf() instead.

modified:
  storage/connect/ha_connect.cc
2013-02-14 17:41:10 +04:00
Olivier Bertrand
3f2d762aa8 2013-02-14 01:51:05 +01:00
Olivier Bertrand
15470f5d12 Warning message changed in ha_connect::check_if_incompatible_data.
Modified:
ha_connect.cc
2013-02-14 01:37:17 +01:00
Olivier Bertrand
481916ffda Update ha_connect::pre_create to restore the code translating
of SQL types previously done in the removed function MyODBCCols.

Modified:
ha_connect.cc
2013-02-14 00:32:29 +01:00
Olivier Bertrand
c523370389 Fix bug on readonly table option not recognized
in TABDEF::Define line 104

Modified:
reldef.cpp

Add a warning on alter in check_if_incompatible_data.

Modified:
ha_connect.cc
2013-02-13 00:51:41 +01:00
Olivier Bertrand
5fc2a7dadd Add a test on table types in ha_connect::create
- The plan was to provide a default type (DOS) when the table type
was unspecified, wring, or not supported.
- However, this is not possible here because create is called after
the FRM file was generated.
- Currently, this is flagged as an error and the create aborts.

Modified:
ha_connect.cc
2013-02-12 22:37:38 +01:00
Olivier Bertrand
83b7fb0f47 Fix a bug causing all tests to fail.
In mycat.cc line 308
+ correc typo in plgdbsem

Modified:
mycat.cc
plgdbsem.h
2013-02-12 18:39:29 +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
Alexander Barkov
b91386c2f6 Changing maximum possible column length for DBF tables from 11 to 10.
There is actually one extra byte for the 11th character, however it seems
to be meant for the '\0' terminating byte in the DBF specifications.
Also, the third party software (e.g. OpenOffice) do not correctly open
tables with column length=11.

modified:
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/t/dbf.test
  storage/connect/ha_connect.cc
2013-02-12 14:58:58 +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
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
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
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
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
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
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
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
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
Olivier Bertrand
ba82edd41e Fix problems with ODBC raised by Adding the type TYPE_BIGINT (longlong). 2013-01-24 19:18:54 +01:00
Olivier Bertrand
6ec8f00ae3 Added to CONNECT the missing type TYPE_BIGINT (longlong). 2013-01-23 22:45:25 +01:00
Alexander Barkov
a8f0f93a2a A Changeset from Olivier:
Added some #if define(... for WIN32, ODBC and MYSQL in case they not defined.

modified:
  storage/connect/ha_connect.cc
2013-01-22 20:08:22 +04: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