Commit graph

379 commits

Author SHA1 Message Date
Olivier Bertrand
3a7f4f241e - Commit merged files from Alexander
added:
  storage/connect/mysql-test/connect/r/odbc_postgresql.result
  storage/connect/mysql-test/connect/t/have_odbc_postgresql.inc
  storage/connect/mysql-test/connect/t/odbc_postgresql.sql
  storage/connect/mysql-test/connect/t/odbc_postgresql.test
modified:
  storage/connect/odbconn.cpp
2013-12-11 16:57:25 +01:00
Olivier Bertrand
f69980c6df - Fix errors and warnings occuring in --embedded tests
modified:
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/mysql.result
  storage/connect/mysql-test/connect/r/unsigned.result
  storage/connect/mysql-test/connect/t/mysql.test
  storage/connect/mysql-test/connect/t/unsigned.test
2013-12-11 16:52:01 +01:00
Alexander Barkov
83416c0fee Fixing the message displayed when the test PostgreSQL data source name
does not exist.
2013-12-11 19:47:37 +04:00
Alexander Barkov
f19f8f0ee4 MDEV-5341 ConnectSE: discovery for ODBC tables does not work if tables
with the same names present in multiple schemas

The "TABNAME" option now supports qualified table names,
to connect to tables residing in a particular schema and catalog.

Qualified table names have the following format:

  [[CatalogName.]SchemaName.]TableName

Qualified table names can be used:

1. In "normal" tables:

CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC
CONNECTION='DSN=ConnectEng;UID=mtr;PWD=mtr'
TABNAME='schema1.t1';

2. In catalog tables (CATFUNC=Tables  and CATFUNC=Columns)

CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC
CONNECTION='DSN=postgresql;UID=user;PWD=password'
TABNAME='schema1.t1';

Note, the % and _ wildcards are supported in
the schema name and the table name parts:

CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC
CONNECTION='DSN=postgresql;UID=user;PWD=password'
TABNAME='%.t1';

CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC
CONNECTION='DSN=postgresql;UID=user;PWD=password'
TABNAME='schema1.%';
2013-12-11 18:47:46 +04:00
Alexander Barkov
57fcf1cbe4 Moving the code checking libxml2 into a *.inc file. 2013-12-10 12:53:46 +04:00
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
Alexander Barkov
be09466e37 Adding basic ODBC tests that do not need a DSN 2013-12-05 17:26:28 +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
54d4589dde - Previous MDEV-5261 was generating wrong warnings
modified:
  storage/connect/ha_connect.cc
2013-12-05 01:00:28 +01:00
Olivier Bertrand
a8b09c14ef - Fix bug MDEV-5261
modified:
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
  storage/connect/mycat.h
2013-12-04 23:53:30 +01:00
Olivier Bertrand
41dbe1c96b - Fix a typo error in tabutil line 213
modified:
  storage/connect/tabutil.cpp
  
- Fix test results to reflect the fact that in discovery, column defaults
  are now retrieved for the MYSQL table type.

modified:
  storage/connect/mysql-test/connect/r/mysql_discovery.result
  storage/connect/mysql-test/connect/r/mysql_new.result

- Restore Unix line endings

modified:
  storage/connect/value.cpp
2013-12-03 23:34:50 +01:00
Olivier Bertrand
ee2f04450b - Add support for unsigned numeric types
added:
  storage/connect/mysql-test/connect/r/unsigned.result
  storage/connect/mysql-test/connect/t/unsigned.test
modified:
  storage/connect/colblk.cpp
  storage/connect/colblk.h
  storage/connect/connect.cc
  storage/connect/ha_connect.cc
  storage/connect/myconn.cpp
  storage/connect/mysql-test/connect/r/mysql_discovery.result
  storage/connect/mysql-test/connect/r/xml.result
  storage/connect/myutil.cpp
  storage/connect/myutil.h
  storage/connect/plgdbsem.h
  storage/connect/tabdos.cpp
  storage/connect/tabfix.cpp
  storage/connect/tabmysql.cpp
  storage/connect/tabutil.cpp
  storage/connect/valblk.cpp
  storage/connect/valblk.h
  storage/connect/value.cpp
  storage/connect/value.h
  storage/connect/xobject.cpp
  storage/connect/xobject.h
2013-12-03 22:59:40 +01:00
Alexander Barkov
d240a0418c Merge 10.0-connect -> 10.0 2013-12-03 14:12:53 +04:00
Olivier Bertrand
0d37409fe7 - Fix gcc compiling error
modified:
  storage/connect/valblk.cpp
2013-11-28 23:37:27 +01:00
Olivier Bertrand
f53ad74cd1 - Fix some wrong changes preparing for unsigned data types
modified:
  storage/connect/ha_connect.cc
  storage/connect/value.cpp

- Fix the way GetPlug works (was not updating xp)

modified:
  storage/connect/ha_connect.cc
2013-11-28 01:25:39 +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
Alexander Barkov
8780e1ab24 ConnectSE: Adding CATFUNC=Tables and CATFUC=Columns for the XLS ODBC data source. 2013-11-20 18:27:13 +04:00
Alexander Barkov
a392a911c2 Adding tests for CATFUC=Tables and CATFUNC=Columns into odbc_sqlite3.test. 2013-11-20 14:50:52 +04: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
260c0de918 - Add (limited) UPDATE/DELETE support to MYSQL type CONNECT tables
modified:
  storage/connect/ha_connect.cc
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
  storage/connect/tabodbc.cpp
2013-11-11 18:30:36 +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
e5c589a8da - BUG fixed: When updating, to avoid skipped update, force the table
handler to retrieve write-only fields to be able to compare
  records and detect data change.

modified:
  storage/connect/ha_connect.cc

- Preparing UPDATE ad DELETE on ODBC tables
  (new function added but not used yet)

modified:
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
2013-11-09 17:32:57 +01:00
Michael Widenius
192678e7bf MDEV-5241: Collation incompatibilities with MySQL-5.6
- Character set code & tests from Alexander Barkov
- Integration with ALTER TABLE, REPAIR and open_table from Monty

The problem was that MySQL 5.6 added some croatian and vitanamese character set collations that are incompatible with MariaDB.

The fix is to move the MariaDB conflicting collation numbers out of the region that MySQL is likely to use.
mysql_upgrade, REPAIR TABLE or ALTER TABLE will fix the collations.
If one tries to access and old incompatible table, one will get the error "Table upgrade required...."
After this patch, MariaDB supports all the MySQL character set collations and the old MariaDB croatian collations, which are closer to the latest standard than the MySQL versions.

New character sets:
ucs2_croatian_mysql561_uca_ci
utf8_croatian_mysql561_uca_ci
utf16_croatian_mysql561_uca_ci
utf32_croatian_mysql561_uca_ci
utf8mb4_croatian_mysql561_uca_ci

Other things:
- Fixed some compiler warnings
- mysql_upgrade prints information about repaired tables.
- Increased version number

VERSION:
  Increased VERSION number
client/mysqlcheck.c:
  Print repaired table name when using --verbose
include/m_ctype.h:
  Add new MariaDB collation regions that are not likely to conflict with MySQL
include/my_base.h:
  Added flag to detect if table was opened for ALTER TABLE
mysql-test/r/ctype_ldml.result:
  Updated result
mysql-test/r/ctype_uca.result:
  Updated result
mysql-test/r/ctype_upgrade.result:
  Updated result
mysql-test/r/ctype_utf16_uca.result:
  Updated result
mysql-test/r/ctype_utf32_uca.result:
  Updated result
mysql-test/r/ctype_utf8mb4_uca.result:
  Updated result
mysql-test/std_data/ctype_upgrade:
  Test files for testing upgrading of conflicting collations
mysql-test/suite/engines/funcs/r/db_alter_collate_ascii.result:
  New collations added
mysql-test/suite/engines/funcs/r/db_alter_collate_utf8.result:
  New collations added
mysql-test/suite/innodb/r/innodb_ctype_ldml.result:
  Updated test result
mysql-test/suite/innodb/t/innodb_ctype_ldml.test:
  Updated test result
mysql-test/suite/plugins/r/show_all_plugins.result:
  Updated version number
mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result:
  Updated version number
mysql-test/t/ctype_ldml.test:
  Updated test
mysql-test/t/ctype_uca.test:
  Testing of new collations
mysql-test/t/ctype_upgrade.test:
  Testing of upgrading tables with old collations
  The test ensures that:
  - We will get an error if we try to open a table with old collations.
  - CHECK TABLE will detect that the table needs to be upgraded.
  - ALTER TABLE and REPAIR will fix the table.
  - mysql_upgrade works as expected
mysql-test/t/ctype_utf16_uca.test:
  Testing of new collations
mysql-test/t/ctype_utf32_uca.test:
  Testing of new collations
mysql-test/t/ctype_utf8mb4_uca.test:
  Testing of new collations
mysys/charset-def.c:
  Added new character sets
mysys/charset.c:
  Always give an error, if requested, if a character set didn't exist
sql/handler.cc:
  - Added upgrade_collation() to check if collation is compatible with old version
  - check_collation_compatibility() checks if we are using an old collation from MariaDB 5.5 or MySQL 5.6
  - ha_check_for_upgrade() returns HA_ADMIN_NEEDS_ALTER if we have an incompatible collation
sql/handler.h:
  Added new prototypes
sql/sql_table.cc:
  - Mark that tables are opened for ALTER TABLE
  - If table needs to be upgraded, ensure we are not using online alter table.
sql/table.cc:
  - If we are using an old incompatible collation, change to use the new one and mark table as incompatible.
  - Give an error if we try to open an incompatible table.
sql/table.h:
  Added error that table needs to be rebuild
storage/connect/ha_connect.cc:
  Fixed compiler warning
strings/ctype-uca.c:
  New character sets
2013-11-09 00:20:07 +02: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
Alexander Barkov
f1325549e9 - Adding cmake code to install ConnectSE mtr tests
- Including "connect" suite into the list of the default suites
2013-10-31 11:53:00 +04:00
Olivier Bertrand
671e5cbb7f - Update version number and date
- Replace test on args[i]->type() by args[i]->field_type() in ha_connect::CheckCond.
  This to take care of cached items generated by executing a query in a procedure.

modified:
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/r/xml.result
2013-10-29 16:21:57 +01:00
Alexander Barkov
3a424fc119 ConnectSE: fixing memory leaks reported by valgrind 2013-10-29 13:44:05 +04:00
Alexander Barkov
7dc48ae327 Merge 10.0-connect -> 10.0 2013-10-29 10:14:45 +04:00
Alexander Barkov
727c1f62a5 MDEV-4877 mysqldump dumps all data from a connect table 2013-10-29 10:09:11 +04: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
bb597a765d - Add test on MYSQL table self reference during CREATE TABLE
Fix option other ignored when parsing URL

modified:
  storage/connect/ha_connect.cc
  storage/connect/mysql-test/connect/t/mysql.test
  storage/connect/mysql-test/connect/t/mysql_grant.test
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
2013-10-27 10:37:12 +01:00
Olivier Bertrand
0f6bcf73de - Implement the "exec source" feature for table type MYSQL.
modified:
  storage/connect/ha_connect.cc
  storage/connect/myconn.h
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
2013-10-26 17:14:58 +02: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
4ab970ab8f - Commit merged file (on Linux)
modified:
  storage/connect/ha_connect.cc
  storage/connect/myconn.cpp
  storage/connect/odbccat.h
  storage/connect/odbconn.cpp
  storage/connect/odbconn.h
  storage/connect/tabmul.cpp
  storage/connect/tabmysql.cpp
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
  
- Fix typo error in TDBDIR::CloseDB

modified:
  storage/connect/tabmul.cpp

- Fix format in TDBXDBC::MakeCMD (was not accepted on Linux)

modified:
  storage/connect/tabodbc.cpp
2013-10-11 15:44:28 +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
8619da05d9 - Fix the default length for DOUBLE to 255 (was 256, max is 255)
Add a trace in MakeSQL

modified:
  storage/connect/myconn.cpp
  storage/connect/tabmysql.cpp
2013-10-02 19:58:49 +02:00
Olivier Bertrand
069edfe125 - Reset some variables when closing just in case the XML tre is re-used.
modified:
  storage/connect/libdoc.cpp
2013-09-25 18:41:20 +02:00
Olivier Bertrand
65b0e5455b - Fix several bugs causing memory leak or invalid access detected
by Valgrind. This concerns the XML libxml2 support.

modified:
  storage/connect/domdoc.cpp
  storage/connect/domdoc.h
  storage/connect/ha_connect.cc
  storage/connect/libdoc.cpp
  storage/connect/plgdbsem.h
  storage/connect/plgxml.h
  storage/connect/tabxml.cpp
  storage/connect/tabxml.h
2013-09-22 13:40:31 +02:00
Sergei Golubchik
181b13d926 simplify CMakeLists.txt for cassandra/connect engines
now, if the dynamic plugin puts itself in a distinct component, then
* ${plugin}.cnf file is generated and installed automatically
* a separate RPM is generated automatically
* necessary FILELIST/PROVIDES/OBSOLETES/REQUIRES are filled in automatically
2013-09-25 19:32:14 +02:00
Alexander Barkov
bd37d644d6 Fixing a typo in the previous commit
defined(OpenBSD) -> defined(__OpenBSD__)


modified:
  storage/connect/os.h
2013-09-16 17:14:44 +04:00
Olivier Bertrand
c4405fef23 - Fix compilation error on some platforms
modified:
  storage/connect/os.h

- Uniforms line endings

modified:
  storage/connect/tabutil.cpp
2013-09-16 14:59:25 +02:00
Olivier Bertrand
e57fbef12e - Get rid of a compiler warning
modified:
  storage/connect/tabfmt.cpp
2013-08-29 15:12:03 +02:00
Olivier Bertrand
b344a49f7e - Fix a bug causing a crash when an XCOL table was the source of
a PROXY or PROXY based table.

modified:
  storage/connect/colblk.cpp
  storage/connect/tabutil.cpp
  storage/connect/tabutil.h
  storage/connect/tabxcl.cpp
  storage/connect/tabxcl.h
2013-08-29 12:01:27 +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
730bf6906b Merge from 10.0.
modified:
  storage/connect/tabxml.h
pending merges:
  Alexander Barkov 2013-08-22 Fixing a compilation failure in ConnectSE ca...
2013-08-22 13:39:52 +04:00
Alexander Barkov
879629e6b2 Fixing a compilation failure in ConnectSE caused by revno 3803.
modified:
  storage/connect/tabxml.h
2013-08-22 13:10:31 +04:00
Alexander Barkov
b4a7542f5b Merging from 10.0
pending merges:
  Michael Widenius 2013-08-21 Fixed compiler warnings
    Alexander Barkov 2013-08-16 A post-fix for MDEV-4871: Fixing a faili...
    Sergey Vojtovich 2013-08-15 MDEV-4897 - Assertion `share->tdc.prev =...
    Sergey Vojtovich 2013-08-15 MDEV-4864 - Merge tests for EXCHANGE PAR...
    Alexander Barkov 2013-08-15 An additional test for MDEV-4871 Tempora...
    Alexander Barkov 2013-08-15 MDEV-4871 Temporal literals do not accep...
    Sergei Golubchik 2013-08-15 fix tests that were relying on @@have_pa...
2013-08-22 12:33:11 +04:00