Commit graph

118 commits

Author SHA1 Message Date
Sergei Golubchik
0a01953c1a compiler warnings 2013-06-03 14:43:47 +02:00
Olivier Bertrand
0aa4fb73a4 - Fix crash when a null qrp is returned for OCCUR tables
in connect_assisted_discovery

modified:
  storage/connect/ha_connect.cc

- Change CRLF line endings to LF

modified:
  storage/connect/tabpivot.cpp
  storage/connect/tabpivot.h
2013-05-28 21:06:15 +02:00
Olivier Bertrand
9f7c3fedfa - Extending connect_assisted_discovery column automatic definition
to OCCUR and PIVOT table types.

modified:
  storage/connect/ha_connect.cc
  storage/connect/myconn.cpp
  storage/connect/myconn.h
  storage/connect/plgdbsem.h
  storage/connect/plgdbutl.cpp
  storage/connect/taboccur.cpp
  storage/connect/taboccur.h
  storage/connect/tabpivot.cpp
  storage/connect/tabpivot.h

- Fix wrong definition of GetVlen for TYPE template

modified:
  storage/connect/valblk.h
2013-05-28 17:22:38 +02:00
Alexander Barkov
5b0e3a5332 Removing more cases of direct use of thd.
Also, TABLE_TYPE=MySQL now uses "root@localhost" by default,
instead of current user and current host name.

modified:
  storage/connect/ha_connect.cc
2013-05-24 11:31:43 +04:00
Alexander Barkov
f2e1473653 Removing direct access to thd, using functions:
- thd_query_string() insted of thd->query_string
- thd_sql_command() instead ot thd->lex->sql_command
- table_share->s.db.str instead of thd->db

modified:
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
2013-05-24 09:56:04 +04:00
Olivier Bertrand
33b9531568 - Fix setting default type to MYSQL->PROXY->DOS in some places where it
was not done correctly.
- Fix a bug causing add_field to generate a syntax error on DOUBLE columns
  with a 0 decimal value.
- Column can be undefined when Srcdef is specified.

modified:
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  storage/connect/tabmysql.cpp
  storage/connect/tabutil.cpp
  storage/connect/tabutil.h
2013-05-24 00:19:26 +02:00
Olivier Bertrand
aebcd56ca9 - Changing CONNECT version number and date
modified:
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/xml.result

- Testing default pivot columns for srcdef
  Fixing order by MariaDB bug for pivot tables
modified:
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
  storage/connect/tabpivot.cpp
  storage/connect/tabpivot.h
2013-05-22 13:35:21 +02:00
Alexander Barkov
41bda068a5 "mtr --suite=connect --embedded" tests did not work for two reasons:
1. The Connect engine code assumed that mysql_home_directory is always "./",
which is not the fact in case of embedded server.
Fixing the routines creating file names to add the mysql_home_directory prefix.

2. FILE privilege is not checked in embedded server.
Moving FILE related tests into separate files.
Skipping the FILE related tests when running with --embedded.

added:
  storage/connect/mysql-test/connect/r/grant.result
  storage/connect/mysql-test/connect/r/ini_grant.result
  storage/connect/mysql-test/connect/r/mysql_grant.result
  storage/connect/mysql-test/connect/r/xml_grant.result
  storage/connect/mysql-test/connect/t/grant.test
  storage/connect/mysql-test/connect/t/ini_grant.test
  storage/connect/mysql-test/connect/t/mysql_grant.test
  storage/connect/mysql-test/connect/t/xml_grant.test
modified:
  storage/connect/global.h
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  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/dir.result
  storage/connect/mysql-test/connect/r/fix.result
  storage/connect/mysql-test/connect/r/ini.result
  storage/connect/mysql-test/connect/r/mysql.result
  storage/connect/mysql-test/connect/r/vec.result
  storage/connect/mysql-test/connect/r/xml.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/dir.test
  storage/connect/mysql-test/connect/t/fix.test
  storage/connect/mysql-test/connect/t/ini.test
  storage/connect/mysql-test/connect/t/mysql.test
  storage/connect/mysql-test/connect/t/vec.test
  storage/connect/mysql-test/connect/t/xml.test
  storage/connect/plgdbsem.h
  storage/connect/plugutil.c
2013-05-21 18:29:10 +04:00
Olivier Bertrand
ca024d1c21 - Correct misplaced parenthesis in last change
modified:
  storage/connect/ha_connect.cc

- Tdbp must be assigned before calling PRX column init

modified:
  storage/connect/tabtbl.cpp
2013-05-20 18:17:09 +02:00
Olivier Bertrand
38a5bb2c1b - Save and restore srcdef when getting a sub-table (could stay in cache)
modified:
  storage/connect/tabutil.cpp

- Change order of tests when looking for valid tdbp. In rare cases an invalid
  tdbp was still existing causing a crash of the server.

modified:
  storage/connect/ha_connect.cc
2013-05-20 13:12:34 +02:00
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