Commit graph

77 commits

Author SHA1 Message Date
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