Commit graph

7220 commits

Author SHA1 Message Date
Olivier Bertrand
69154073d9 - Until the problem is fixed, temporarily not use mapping on Linux for Update.
modified:
  storage/connect/tabdos.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabvct.cpp
2013-03-08 01:09:53 +01:00
Olivier Bertrand
07beddc421 - Working on the problem of writing to mapped files on Linux
modified:
  storage/connect/maputil.cpp*
2013-03-08 00:41:24 +01:00
Olivier Bertrand
274b2f8c4a - Fix a bug causing the server to crash when writing on a memory mapped
file on Linux.

modified:
  storage/connect/maputil.cpp
2013-03-07 23:05:54 +01:00
Olivier Bertrand
079f053c66 - Fix bug causing a crash when writing to a memory mapped file on Linux.
modified:
  storage/connect/maputil.cpp
2013-03-07 22:56:52 +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
Sergei Golubchik
9d8ee74b38 MDEV-4186 Test case main.myisampack fails on ppc32 (only)
fix the declaration to use the correct type for st_handler_check_param::sort_buffer_length.
remove redundant casts.
2013-03-08 19:09:45 +01:00
Sergei Golubchik
0d9a6d52d7 merge with XtraDB as of Percona-Server-5.5.30-rel30.1 2013-03-08 19:08:45 +01:00
Olivier Bertrand
5d7d579c8f - In index.test t1 was back to T1! fixed
modified:
  mysql-test/suite/connect/t/index.test*

- Line endings restored to LF only

modified:
  storage/connect/CMakeLists.txt
2013-03-06 11:27:47 +01:00
unknown
1e114f73ad - Changing mode to -x
modified:
  mysql-test/suite/connect/t/index.test
  storage/connect/connect.cc*
  storage/connect/myconn.cpp*
  storage/connect/value.cpp*
2013-03-06 11:16:29 +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 on SAMSUNG 64-bits
25fc1b0308 - Add domdoc.h in source list
modified:
  storage/connect/CMakeLists.txt
2013-03-04 17:49:20 +01:00
Olivier Bertrand
50beff5cbf - FIX a bug causing a crash when deleting a mapped table
modified:
  storage/connect/filamap.cpp
2013-03-04 00:42:39 +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
8103dd5e88 - Some end of lines changed from CRLF to LF
modified:
  storage/connect/reldef.h
  storage/connect/tabxml.h
  storage/connect/value.h
2013-03-02 22:30:40 +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
3734dfb3b6 - MySQL connection was not close if mysql_real_connect failed.
modified:
  storage/connect/myconn.cpp
2013-03-02 01:02:59 +01:00
unknown
073b0e7731 - MySQL connection was not closed in case of error
modified:
  storage/connect/myconn.cpp
2013-03-02 00:09:15 +01:00
Olivier Bertrand
63798ef4a5 - Rewrite some VALBLK classes as templates
- Correct typo initializing datm in DTVAL::MakeDate as {0,0,0,2,0,70,0,0,0}
  instead of {0,0,0,1,0,70,0,0,0}

modified:
  storage/connect/valblk.cpp
  storage/connect/valblk.h
  storage/connect/value.cpp
  storage/connect/value.h
2013-03-01 22:23:40 +01:00
Olivier Bertrand
cdf3606b38 - Begin fixing memory leaks
modified:
  storage/connect/connect.cc
  storage/connect/plugutil.c
2013-03-01 22:21:48 +01:00
Michael Widenius
4cace76d4d Automatic merge 2013-03-01 18:09:06 +02:00
Olivier Bertrand
612b8c5500 - Fix warning on missing initial values on Linux
modified:
  storage/connect/connect.cc*
  storage/connect/value.cpp*
2013-03-01 00:41:04 +01:00
unknown
0a05caf29f - Fix memory leak
modified:
  storage/connect/connect.cc
  
- GCC requires template<> headers

modified:
  storage/connect/value.cpp
2013-03-01 00:29:48 +01:00
Sergei Golubchik
9d72bbf84c merge with XtraDB as of Percona-Server-5.5.29-rel30.0 2013-02-28 23:56:17 +01:00
Olivier Bertrand
bf6c3f5133 - Second version of template value classes
The first one did not compile with GCC on Linux

modified:
  storage/connect/value.cpp
  storage/connect/value.h
2013-02-28 22:50:26 +01:00
Sergei Golubchik
213f1c76a0 5.3->5.5 merge 2013-02-28 22:47:29 +01:00
Sergei Golubchik
c4341d5095 5.2 -> 5.3 2013-02-28 21:48:47 +01:00
Sergei Golubchik
5dec570d7c 5.1 -> 5.2 merge 2013-02-28 19:00:58 +01:00
Sergei Golubchik
8161c6772d merge with mysql-5.5.30 minus few incorrect or not applicable changesets 2013-02-28 18:42:49 +01:00
Michael Widenius
6a2d730a7f Fixed BUG#51763 Can't delete rows from MEMORY table with HASH key 2013-02-28 10:00:07 +01:00
Sergei Golubchik
08ba257846 mysql-5.1 merge
mysys/errors.c:
  revert upstream's fix. use a much simpler one
mysys/my_write.c:
  revert upstream's fix. use a simpler one
sql/item_xmlfunc.cc:
  useless, but ok
sql/mysqld.cc:
  simplify upstream's fix
storage/heap/hp_delete.c:
  remove upstream's fix.
  we'll use a much less expensive approach.
2013-02-28 09:58:39 +01:00
Michael Widenius
2d78ef1d3b Added support for --crash-script in mysqld_safe.
Trivial cleanup

scripts/mysqld_safe.sh:
  Added support for --crash-script.
  Don't remove socket file (not needed as server will re-create it if needed)
  Patch by Eric Bergen
storage/maria/ha_maria.h:
  Removed not existing variable.
2013-02-28 08:42:05 +02:00
Olivier Bertrand
812c1a7f6b - Modify the way value.h and valblk.h are included to try fixing
the gcc error: invalid use of incomplete type

modified:
  storage/connect/myconn.cpp
  storage/connect/xobject.h
2013-02-27 23:32:34 +01:00
Olivier Bertrand
7879632cea - Change Subclass name from TYPE to T
modified:
  storage/connect/value.h
2013-02-27 22:54:42 +01:00
Olivier Bertrand
7132c590ca - Fix a miscalculation of column length in ODBCTables
- Clean code in Value.h

modified:
  storage/connect/odbconn.cpp
  storage/connect/value.h
2013-02-27 22:42:50 +01:00
Olivier Bertrand
fa4aa616a1 - Rewriting the VALUE classes as template classes
modified:
  storage/connect/tabdos.cpp
  storage/connect/tabdos.h
  storage/connect/tabmysql.cpp
  storage/connect/tabodbc.cpp
  storage/connect/tabsys.cpp
  storage/connect/tabxml.cpp
  storage/connect/value.cpp
  storage/connect/value.h
  storage/connect/xobject.h
2013-02-27 16:42:59 +01:00
Vladislav Vaintroub
65831bca6f MDEV-4203 : fix maria SE repair functions (wrong operator precedence) 2013-02-26 21:20:15 +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
Vladislav Vaintroub
2c97d5a305 Compilation : fix oqgraph's system check, in case where boost header aren't in standard include directory. 2013-02-24 20:05:26 +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
a769cb2fc5 - Add header files to source files
modified:
  storage/connect/CMakeLists.txt
2013-02-22 22:46:52 +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
553964dc70 - Suppress warning on non virtual descriptor
modified:
  storage/connect/CMakeLists.txt
2013-02-22 19:21:34 +01:00
Olivier Bertrand
ebc8a6ef0c - Fix connect string wrongly used when zero length
modified:
  storage/connect/tabmysql.cpp
2013-02-22 18:32: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
aa92de5a70 Adding a reminder.
modified:
  storage/connect/CMakeLists.txt
2013-02-22 16:53:42 +04: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
Alexander Barkov
38210b1145 Skip test XML if no XML support is compiled.
modified:
  mysql-test/suite/connect/t/xml.test
  storage/connect/mycat.cc
2013-02-22 12:52:56 +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
Olivier Bertrand
9d7f134186 - Fix bad conversion from "bigint" to TYPE_FLOAT.
modified:
  storage/connect/myutil.cpp
2013-02-21 12:30:40 +01:00
Olivier Bertrand
9716acfcc3 - Re-install blank trimming to have the xml test pass.
Note that the problem if far more complex. To be revisited.

modified:
  storage/connect/libdoc.cpp
  storage/connect/tabxml.h
2013-02-20 23:23:35 +01:00
Olivier Bertrand
b63eb1d8b4 - Fix the elimination of control characters from node content
- Take care of XML special chars (<>& etc.)
- Remove Encode, Decode

modified:
  storage/connect/libdoc.cpp
  storage/connect/libdoc.h

- Neither libmysql.lib nor mysqlclient.lib needed for MYSQL table type

modified:
  storage/connect/CMakeLists.txt
2013-02-20 18:49:18 +01:00
Olivier Bertrand
26bf803c04 - Update the MYSQL table handling to use only client API functions.
It is no more necessary to be liked to libmysql.lib nor mysqlclient.lib.

modified:
  storage/connect/libdoc.cpp
  storage/connect/myconn.cpp
  storage/connect/myconn.h
  storage/connect/tabmysql.cpp
  storage/connect/tabmysql.h
2013-02-20 16:57:38 +01:00
Olivier Bertrand
818d0a5622 Suppress a warning on unused variable.
modified:
  storage/connect/reldef.cpp
2013-02-20 16:54:57 +01:00
Alexander Barkov
d99d3da1d1 Removing the MODULE_ONLY option, to be able to run with valgrind.
(with MODULE_ONLY valgrind does not display file name and line number
if a problem happens inside a dlopen-ed plugin)

modified:
  storage/connect/CMakeLists.txt
2013-02-20 16:43:38 +04: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
Alexander Barkov
59e95fe6bb Cmake clean-ups:
- Removing -DMYSQL_DYNAMIC_PLUGIN. Its automatically
  added by MYSQL_ADD_PLUGIN
- Replacing "IF(!XXX)" to "IF(NOT XXX)". The former is a wrong cmake syntax.

modified:
  storage/connect/CMakeLists.txt
2013-02-19 13:53:24 +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
8e1c194904 Modification of the ODBConn class to change m_henv member from
static to dynamic. Apparently this caused errors with a obscure
message saying "Invalid handle vale" (probably m_henv).

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

Modified:
odbconn.h
odbconn.cpp
2013-02-17 11:34:40 +01:00
Olivier Bertrand
df1dfcff6c Put trace in ODBC source files
modified:
  storage/connect/odbconn.cpp
  storage/connect/tabodbc.cpp
2013-02-15 22:31:13 +01:00
Michael Widenius
7042dd38c6 Fixed BUG#51763 Can't delete rows from MEMORY table with HASH key
mysql-test/suite/heap/heap.result:
  Added test case
mysql-test/suite/heap/heap.test:
  Added test case
storage/heap/hp_delete.c:
  Fixed that we don't change order of keys for the current key when we delete them from the hash table.
  Fixed that 'current_hash_ptr' is correct after heap_delete_key().
  Don't "reset current_hash_ptr" on delete; This will improve time a lot for delete of rows when not all rows matches the search criteria.
2013-02-15 20:25:27 +02:00
Olivier Bertrand
a2cf90d9ce Suppress multiple blanks and control characters from the
node text retrieved by libxml2.

Modified:
libdoc.cpp
2013-02-15 15:53:27 +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
fb1ff4e9f5 Fix a typo that caused CONNECT to crash on ODBC catalog tables
in ODBCDEF::DefineAM line 106

Modified:
tabodbc.cpp
2013-02-14 00:26:03 +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
2adf52b85e Fixing ini.test failure on Linux:
No need to print "\n" before the very first section.

modified:
  storage/connect/inihandl.c
2013-02-11 18:32:40 +04:00
Alexander Barkov
4902861155 Adding test for ENGINE=VEC
added:
  mysql-test/suite/connect/r/vec.result
  mysql-test/suite/connect/t/vec.test
modified:
  storage/connect/plgdbutl.cpp
2013-02-11 17:50:01 +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
7f08277b8d Fixing "unused label" warning.
modified:
  storage/connect/CMakeLists.txt
  storage/connect/tabmul.cpp
2013-02-08 01:40:55 +04:00
Alexander Barkov
2787dcb05e Fixing a warning:
> deleting object of polymorphic class type ‘CATALOG’ which
> has non-virtual destructor might cause undefined behaviour
> [-Wdelete-non-virtual-dtor]

Classes whose instances are destroyed using "delete"
should have virtual destructors.

modified:
  storage/connect/catalog.h
2013-02-08 01:31:46 +04:00
Alexander Barkov
03259f8540 Fixing a warning:
Changing result type for the method from "char*" instead of "const char*".

modified:
  storage/connect/odbconn.h
2013-02-07 19:19:20 +04:00
Alexander Barkov
587a40c17e Fixing a warning:
KXYCOL::Kof’ will be initialized after ‘void*& KXYCOL::To_Bkeys’ [-Wreorder]

modified:
  storage/connect/xindex.cpp
2013-02-07 19:10:35 +04:00
Alexander Barkov
2cc5fd06b1 Commenting switches that are specific to C or C++ only.
modified:
  storage/connect/CMakeLists.txt
2013-02-07 18:35:32 +04: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
850220d1c4 Disable only *some* warning types instead of *all* types.
We need to fix and enable all warnings gradually.

modified:
  storage/connect/CMakeLists.txt
2013-02-07 18:20:05 +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
8cfa84ca87 Fixing compilation warnings:
Using "bool" in pure C code is not a good idea.
- Defining BOOL as "long" on Unix (this is how MS defines it)
- Replacing bool to BOOL in pure C code.

modified:
  storage/connect/global.h
  storage/connect/inihandl.c
  storage/connect/os.h
  storage/connect/osutil.c
  storage/connect/osutil.h
2013-02-07 15:21:56 +04:00
Alexander Barkov
48ca5c6b44 Fixing redundant declaration.
modified:
  storage/connect/os.h
  storage/connect/osutil.h
2013-02-07 14:47:08 +04:00
Alexander Barkov
f3302230bd Removing reduntant ODBC constants.
Use "#include <sql.h>" when needed.

modified:
  storage/connect/catalog.h
2013-02-07 14:26: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
Alexander Barkov
22a8fb03db Introducing functions global_open() and global_fopen() for these purposes:
- Removing duplicate code to generate error message text
- In the future they will most likely check secure_file_priv directory.


modified:
  storage/connect/filamdbf.cpp
  storage/connect/filamfix.cpp
  storage/connect/filamtxt.cpp
  storage/connect/filamvct.cpp
  storage/connect/libdoc.cpp
  storage/connect/maputil.cpp
  storage/connect/plgdbsem.h
  storage/connect/plgdbutl.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabmul.cpp
  storage/connect/tabxml.cpp
  storage/connect/xindex.cpp
2013-02-06 15:17:34 +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
a38ae86951 Removing iconv dependency.
Using MariaDB in-house character set conversion routines.

modified:
  storage/connect/CMakeLists.txt
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
2013-02-04 13:28:34 +04: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
Sergey Petrunya
6ae14e6cd2 MDEV-3997: Querying a Cassandra table on a server with query cache enabled is likely to cause problems
- Disable query cache for Cassandra tables.
2013-02-04 10:14:20 +04:00
Olivier Bertrand
e89cb7f27a Translate column names to UTF-8 in ha_connect::pre_create. 2013-02-03 01:13:13 +01:00
Elena Stepanova
7f444caa0a MDEV-4028 - Converted rdiff files to uniform
MDEV-11 - Modifed tests and result files to use explicit column lists
          in INSERT and SELECT statements
2013-02-03 02:53:57 +04: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
f1b87189c6 Fixing a typo:
#ifdef defined(XXX) ->
#ifdef XXX
2013-02-01 21:42:36 +04:00
Alexander Barkov
7a8402c98d Replacing iconv converstion routines in libdoc.cc to MariaDB routines.
TODO: Access to Field->charset() instead of hardcoded latin1 conversion.

modified:
  storage/connect/libdoc.cpp
  storage/connect/libdoc.h
2013-02-01 17:28:13 +04: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
733ab86c25 Adding an option to switch off ICONV support:
cmake -DCONNECT_WITH_ICONV=0

modified:
  storage/connect/CMakeLists.txt
  storage/connect/tabodbc.cpp
  storage/connect/tabodbc.h
2013-02-01 13:36:56 +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
Alexander Barkov
d10116292b Adding separate flags to disable MSXML and LIBXML2 libraries on Windows:
-DCONNECT_WITH_LIBXML2=0
-DCONNECT_WITH_MSXML=0

modified:
  storage/connect/CMakeLists.txt
2013-02-01 10:06:32 +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
Sergei Golubchik
ab83952f29 10.0-base merge 2013-01-31 09:48:19 +01:00
Olivier Bertrand
ad41e7ee40 Fix incorrect DBF type setting for SORT and BIGINT. 2013-01-31 00:58:22 +01:00
Olivier Bertrand
29df840a11 Fix problems with ODBC raised by Adding the type TYPE_BIGINT (longlong). 2013-01-30 00:15:54 +01:00
Olivier Bertrand
74b51d9525 Fix problems with ODBC raised by Adding the type TYPE_BIGINT (longlong). 2013-01-30 00:00:10 +01:00
Olivier Bertrand
26b00be332 Fix problems with ODBC raised by Adding the type TYPE_BIGINT (longlong). 2013-01-29 23:40:34 +01:00
Alexander Barkov
c87004d817 Removing os2def.h
removed:
  storage/connect/os2def.h
modified:
  storage/connect/fmdlex.c
  storage/connect/maputil.cpp
  storage/connect/tabcol.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabmul.cpp
  storage/connect/tabmysql.cpp
2013-01-29 23:23:03 +04:00
Sergei Golubchik
6f2680a73c move cassandra-related code from cmake/cpack_rpm.cmake
to storage/cassandra/CMakeLists.txt
2013-01-29 19:14:43 +01:00
Alexander Barkov
a9d06e1066 Adding a comment why TranslateSQLType is exported.
modified:
  storage/connect/value.h
2013-01-29 21:37:39 +04:00
Sergei Golubchik
97d3402b9c buildbot fixes for storage/cassandra/CMakeLists.txt
storage/cassandra/CMakeLists.txt:
  more thourough CHECK_CXX_SOURCE_COMPILES test, that checks whether
  boost::shared_ptr can work with --fno-rtti
  
  don't install anything in INSTALL_SYSCONFDIR, if the latter is unset
2013-01-29 17:42:51 +01:00
Alexander Barkov
258c6d479e Removing redundant declaration of ulonglong.
It's defined in my_global.h which is included through handler.h

modified:
  storage/connect/connect.cc
2013-01-29 20:00:01 +04:00
Alexander Barkov
18e02f0608 Fixing compilation failure caused by wrong definition of DWORD
in unixODBC headers on 64-bit platforms.
Moving function definitions from value.cpp to odbconn.cpp.
Changing scope of GetSQLType and GetSQLCType from public to static.


modified:
  storage/connect/odbconn.cpp
  storage/connect/value.cpp
  storage/connect/value.h
2013-01-29 19:35:17 +04:00
Alexander Barkov
ab76cdb236 Compilation failed on Debian 32-bit.
Fixing DWORD definition once again as "unsigned long",
which is the way how MS defines it.

modified:
  @ storage/connect/os.h
    Changing DWORD defitition

  @ storage/connect/tabodbc.cpp
    Moving "#define NODW" to proper place.
2013-01-29 19:15:22 +04:00
Sergei Golubchik
0af4b6c6ee 5.5 merge 2013-01-29 15:10:47 +01:00
Alexander Barkov
d78d3d4fc9 Removing more duplicate declarations.
Fixing DWORD declaration to "unsigned int".
Fixing BIGINT declatation from uint64_t to longlong.
2013-01-29 17:30:02 +04:00
Alexander Barkov
eb1633776a Adding os.h forgotten in the previous changeset.
added:
  storage/connect/os.h
2013-01-29 21:16:56 +04:00
Alexander Barkov
7d0887e0d8 Moving duplicate data type declatations into os.h.
modified:
  storage/connect/global.h
  storage/connect/inihandl.c
  storage/connect/osutil.h
2013-01-29 21:14:59 +04:00
Alexander Barkov
780463cc25 Adding detection of msxml library version:
msxml2, msxml3, msxml4, msxml6

modified:
  storage/connect/CMakeLists.txt
  storage/connect/domdoc.cpp
2013-01-28 19:49:46 +04:00
Alexander Barkov
501fc7642f Defining __STDC__, otherwise it does not compile on Windows
modified:
  storage/connect/fmdlex.c
2013-01-28 18:11:51 +04:00
Alexander Barkov
4f9e09efb4 Fixing ODBC related compilation failures:
- without ODBC: adding a few "#ifdef CONNECT_SUPPORT"
- with ODBC on Linux: conflicting definitions for DWORD
  in sql.h (unixODBC) vs global.h.
  Using "typedef unsigned int DWORD", as this is how MS SQK defines it
  and matches unixODBC definition.

Removing sqlutil.h. value.cpp now uses sql.h and sqlext.h instead.


removed:
  storage/connect/sqlutil.h
modified:
  storage/connect/global.h
  storage/connect/value.cpp
  storage/connect/value.h
2013-01-28 13:42:14 +04:00
Alexander Barkov
6690bafca9 Adding a possibility to disable ODBC, XML and MySQL support in CONNECT:
cmake . -DCONNECT_WITH_ODBC=0 -DCONNECT_WITH_XML=0 -DCONNECT_WITH_MYSQL=0

modified:
  storage/connect/CMakeLists.txt
2013-01-28 13:37:50 +04:00
Michael Widenius
ea1d5943c5 Fixed MDEV-3890: Server crash inserting record on a temporary table after truncating it
The problem was that a temporary table was re-created as a non-temporary table.


mysql-test/suite/maria/truncate.result:
  Added test cases
mysql-test/suite/maria/truncate.test:
  Added test cases
sql/sql_truncate.cc:
  Mark that table to be created is a temporary table
storage/maria/ha_maria.cc:
  Ensure that temporary tables are not transactional.
2013-01-25 21:40:42 +02:00
Olivier Bertrand
ba82edd41e Fix problems with ODBC raised by Adding the type TYPE_BIGINT (longlong). 2013-01-24 19:18:54 +01:00
Sergei Golubchik
a48c2f461e fix ha_cassandra to compile 2013-01-24 17:52:25 +01:00
Alexander Barkov
1d67d9bf2f Adding automatic LibXml2 detection for Windows
with searching in a number of typical places.
2013-01-24 15:31:56 +04:00
Alexander Barkov
0ffc852355 Making the OS specific part more readable (indentation).
modified:
  storage/connect/CMakeLists.txt
2013-01-24 14:16:13 +04:00
Olivier Bertrand
9ff78c618c 2013-01-23 22:58:13 +01:00
Alexander Barkov
6242f1bffa Additional change for iphlpapi.lib.
Forgot to add this chunk in the previous commit.
2013-01-24 01:48:00 +04:00
Olivier Bertrand
6ec8f00ae3 Added to CONNECT the missing type TYPE_BIGINT (longlong). 2013-01-23 22:45:25 +01:00
Alexander Barkov
19d98a331d Adding iphlpapi.lib library on Windows.
Needed for Mac utils.
2013-01-24 01:43:37 +04:00
Alexander Barkov
939bfb039f Adding /EHsc flags when compiling on windows.
Required for mycat.cc

modified:
  storage/connect/CMakeLists.txt
2013-01-24 00:08:02 +04:00
Sergei Golubchik
6ac52386bb fix the failing federated.federated_innodb test:
update all start_bulk_insert() methods to the new signature.
2013-01-23 16:24:04 +01:00
Sergei Golubchik
5205188200 cleanup:
* remove unused mysql_option
* don't allocate 5GB of memory in the mtr tests
* restore the behavior in dynamic_column_offset_byte(), put the ifdef correctly
* prefer __attribute__((unused)) to #ifdef
* prefer UNINIT_VAR to LINT_INIT
* make most Warning_info users blissfully unaware of the postponed initialization
* use my_offsetof instead of offsetof where the compiler thinks the latter is incorrect
2013-01-23 16:19:37 +01:00
Sergei Golubchik
e3f08e7e0b cleanup: remove unused init_dynamic_array and init_dynamic_array2 symbols,
as only my_init_dynamic_array and my_init_dynamic_array2 are used everywhere.
fix ha_cassandra to compile.
2013-01-23 16:18:53 +01:00
Sergei Golubchik
682da0aa75 cleanup: use MYF() for mysys flags 2013-01-23 16:18:09 +01:00
Michael Widenius
a260b15554 MDEV-4011 Added per thread memory counting and usage
Base code and idea from a patch from by plinux at Taobao.

The idea is that we mark all memory that are thread specific with MY_THREAD_SPECIFIC.
Memory counting is done per thread in the my_malloc_size_cb_func callback function from my_malloc().
There are plenty of new asserts to ensure that for a debug server the counting is correct.

Information_schema.processlist gets two new columns: MEMORY_USED and EXAMINED_ROWS.
- The later is there mainly to show how query is progressing.

The following changes in interfaces was needed to get this to work:
- init_alloc_root() amd init_sql_alloc() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
- One now have to use alloc_root_set_min_malloc() to set min memory to be allocated by alloc_root()
- my_init_dynamic_array()  has extra option so that one can mark memory with MY_THREAD_SPECIFIC
- my_net_init() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
- Added flag for hash_init() so that one can mark hash table to be thread specific.
- Added flags to init_tree() so that one can mark tree to be thread specific.
- Removed with_delete option to init_tree(). Now one should instead use MY_TREE_WITH_DELETE_FLAG.
- Added flag to Warning_info::Warning_info() if the structure should be fully initialized.
- String elements can now be marked as thread specific.
- Internal HEAP tables are now marking it's memory as MY_THREAD_SPECIFIC.
- Changed type of myf from int to ulong, as this is always a set of bit flags.

Other things:
- Removed calls to net_end() and thd->cleanup() as these are now done in ~THD()
- We now also show EXAMINED_ROWS in SHOW PROCESSLIST
- Added new variable 'memory_used'
- Fixed bug where kill_threads_for_user() was using the wrong mem_root to allocate memory.
- Removed calls to the obsoleted function init_dynamic_array()
- Use set_current_thd() instead of my_pthread_setspecific_ptr(THR_THD,...)


client/completion_hash.cc:
  Updated call to init_alloc_root()
client/mysql.cc:
  Updated call to init_alloc_root()
client/mysqlbinlog.cc:
  init_dynamic_array() -> my_init_dynamic_array()
  Updated call to init_alloc_root()
client/mysqlcheck.c:
  Updated call to my_init_dynamic_array()
client/mysqldump.c:
  Updated call to init_alloc_root()
client/mysqltest.cc:
  Updated call to init_alloc_root()
  Updated call to my_init_dynamic_array()
  Fixed compiler warnings
extra/comp_err.c:
  Updated call to my_init_dynamic_array()
extra/resolve_stack_dump.c:
  Updated call to my_init_dynamic_array()
include/hash.h:
  Added HASH_THREAD_SPECIFIC
include/heap.h:
  Added flag is internal temporary table.
include/my_dir.h:
  Safety fix: Ensure that MY_DONT_SORT and MY_WANT_STAT don't interfer with other mysys flags
include/my_global.h:
  Changed type of myf from int to ulong, as this is always a set of bit flags.
include/my_sys.h:
  Added MY_THREAD_SPECIFIC and MY_THREAD_MOVE
  Added malloc_flags to DYNAMIC_ARRAY
  Added extra mysys flag argument to my_init_dynamic_array()
  Removed deprecated functions init_dynamic_array() and my_init_dynamic_array.._ci
  Updated paramaters for init_alloc_root()
include/my_tree.h:
  Added my_flags to allow one to use MY_THREAD_SPECIFIC with hash tables.
  Removed with_delete. One should now instead use MY_TREE_WITH_DELETE_FLAG
  Updated parameters to init_tree()
include/myisamchk.h:
  Added malloc_flags to allow one to use MY_THREAD_SPECIFIC for checks.
include/mysql.h:
  Added MYSQL_THREAD_SPECIFIC_MALLOC
  Used 'unused1' to mark memory as thread specific.
include/mysql.h.pp:
  Updated file
include/mysql_com.h:
  Used 'unused1' to mark memory as thread specific.
  Updated parameters for my_net_init()
libmysql/libmysql.c:
  Updated call to init_alloc_root() to mark memory thread specific.
libmysqld/emb_qcache.cc:
  Updated call to init_alloc_root()
libmysqld/lib_sql.cc:
  Updated call to init_alloc_root()
mysql-test/r/create.result:
  Updated results
mysql-test/r/user_var.result:
  Updated results
mysql-test/suite/funcs_1/datadict/processlist_priv.inc:
  Update to handle new format of SHOW PROCESSLIST
mysql-test/suite/funcs_1/datadict/processlist_val.inc:
  Update to handle new format of SHOW PROCESSLIST
mysql-test/suite/funcs_1/r/is_columns_is.result:
  Update to handle new format of SHOW PROCESSLIST
mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result:
  Updated results
mysql-test/suite/funcs_1/r/processlist_val_no_prot.result:
  Updated results
mysql-test/t/show_explain.test:
  Fixed usage of debug variable so that one can run test with --debug
mysql-test/t/user_var.test:
  Added test of memory_usage variable.
mysys/array.c:
  Added extra my_flags option to init_dynamic_array() and init_dynamic_array2() so that one can mark memory with MY_THREAD_SPECIFIC
  All allocated memory is marked with the given my_flags.
  Removed obsolete function init_dynamic_array()
mysys/default.c:
  Updated call to init_alloc_root()
  Updated call to my_init_dynamic_array()
mysys/hash.c:
  Updated call to my_init_dynamic_array_ci().
  Allocated memory is marked with MY_THREAD_SPECIFIC if HASH_THREAD_SPECIFIC is used.
mysys/ma_dyncol.c:
  init_dynamic_array() -> my_init_dynamic_array()
  Added #if to get rid of compiler warnings
mysys/mf_tempdir.c:
  Updated call to my_init_dynamic_array()
mysys/my_alloc.c:
  Added extra parameter to init_alloc_root() so that one can mark memory with MY_THREAD_SPECIFIC
  Extend MEM_ROOT with a flag if memory is thread specific.
  This is stored in block_size, to keep the size of the MEM_ROOT object identical as before.
  Allocated memory is marked with MY_THREAD_SPECIFIC if used with init_alloc_root()
mysys/my_chmod.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_chsize.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_copy.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_create.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_delete.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_error.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_fopen.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_fstream.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_getwd.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_lib.c:
  Updated call to init_alloc_root()
  Updated call to my_init_dynamic_array()
  Updated DBUG_PRINT because of change of myf type
mysys/my_lock.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_malloc.c:
  Store at start of each allocated memory block the size of the block and if the block is thread specific.
  Call malloc_size_cb_func, if set, with the memory allocated/freed.
  Updated DBUG_PRINT because of change of myf type
mysys/my_open.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_pread.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_read.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_redel.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_rename.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_seek.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_sync.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_thr_init.c:
  Ensure that one can call my_thread_dbug_id() even if thread is not properly initialized.
mysys/my_write.c:
  Updated DBUG_PRINT because of change of myf type
mysys/mysys_priv.h:
  Updated parameters to sf_malloc and sf_realloc()
mysys/safemalloc.c:
  Added checking that for memory marked with MY_THREAD_SPECIFIC that it's the same thread that is allocation and freeing the memory.
  Added sf_malloc_dbug_id() to allow MariaDB to specify which THD is handling the memory.
  Added my_flags arguments to sf_malloc() and sf_realloc() to be able to mark memory with MY_THREAD_SPECIFIC.
  Added sf_report_leaked_memory() to get list of memory not freed by a thread.
mysys/tree.c:
  Added flags to init_tree() so that one can mark tree to be thread specific.
  Removed with_delete option to init_tree(). Now one should instead use MY_TREE_WITH_DELETE_FLAG.
  Updated call to init_alloc_root()
  All allocated memory is marked with the given malloc flags
mysys/waiting_threads.c:
  Updated call to my_init_dynamic_array()
sql-common/client.c:
  Updated call to init_alloc_root() and my_net_init() to mark memory thread specific.
  Updated call to my_init_dynamic_array().
  Added MYSQL_THREAD_SPECIFIC_MALLOC so that client can mark memory as MY_THREAD_SPECIFIC.
sql-common/client_plugin.c:
  Updated call to init_alloc_root()
sql/debug_sync.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/event_scheduler.cc:
  Removed calls to net_end() as this is now done in ~THD()
  Call set_current_thd() to ensure that memory is assigned to right thread.
sql/events.cc:
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/filesort.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/filesort_utils.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/ha_ndbcluster.cc:
  Updated call to init_alloc_root()
  Updated call to my_net_init()
  Removed calls to net_end() and thd->cleanup() as these are now done in ~THD()
sql/ha_ndbcluster_binlog.cc:
  Updated call to my_net_init()
  Updated call to init_sql_alloc()
  Removed calls to net_end() and thd->cleanup() as these are now done in ~THD()
sql/ha_partition.cc:
  Updated call to init_alloc_root()
sql/handler.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
  Added missing call to my_dir_end()
sql/item_func.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/item_subselect.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/item_sum.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/log.cc:
  More DBUG
  Updated call to init_alloc_root()
sql/mdl.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/mysqld.cc:
  Added total_memory_used
  Updated call to init_alloc_root()
  Move mysql_cond_broadcast() before my_thread_end()
  Added mariadb_dbug_id() to count memory per THD instead of per thread.
  Added my_malloc_size_cb_func() callback function for my_malloc() to count memory.
  Move initialization of mysqld_server_started and mysqld_server_initialized earlier.
  Updated call to my_init_dynamic_array().
  Updated call to my_net_init().
  Call my_pthread_setspecific_ptr(THR_THD,...) to ensure that memory is assigned to right thread.
  Added status variable 'memory_used'.
  Updated call to init_alloc_root()
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/mysqld.h:
  Added set_current_thd()
sql/net_serv.cc:
  Added new parameter to my_net_init() so that one can mark memory with MY_THREAD_SPECIFIC.
  Store in net->thread_specific_malloc if memory is thread specific.
  Mark memory to be thread specific if requested.
sql/opt_range.cc:
  Updated call to my_init_dynamic_array()
  Updated call to init_sql_alloc()
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/opt_subselect.cc:
  Updated call to init_sql_alloc() to mark memory thread specific.
sql/protocol.cc:
  Fixed compiler warning
sql/records.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/rpl_filter.cc:
  Updated call to my_init_dynamic_array()
sql/rpl_handler.cc:
  Updated call to my_init_dynamic_array2()
sql/rpl_handler.h:
  Updated call to init_sql_alloc()
sql/rpl_mi.cc:
  Updated call to my_init_dynamic_array()
sql/rpl_tblmap.cc:
  Updated call to init_alloc_root()
sql/rpl_utility.cc:
  Updated call to my_init_dynamic_array()
sql/slave.cc:
  Initialize things properly before calling functions that allocate memory.
  Removed calls to net_end() as this is now done in ~THD()
sql/sp_head.cc:
  Updated call to init_sql_alloc()
  Updated call to my_init_dynamic_array()
  Added parameter to warning_info() that it should be fully initialized.
sql/sp_pcontext.cc:
  Updated call to my_init_dynamic_array()
sql/sql_acl.cc:
  Updated call to init_sql_alloc()
  Updated call to my_init_dynamic_array()
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_admin.cc:
  Added parameter to warning_info() that it should be fully initialized.
sql/sql_analyse.h:
  Updated call to init_tree() to mark memory thread specific.
sql/sql_array.h:
  Updated call to my_init_dynamic_array() to mark memory thread specific.
sql/sql_audit.cc:
  Updated call to my_init_dynamic_array()
sql/sql_base.cc:
  Updated call to init_sql_alloc()
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_cache.cc:
  Updated comment
sql/sql_class.cc:
  Added parameter to warning_info() that not initialize it until THD is fully created.
  Updated call to init_sql_alloc()
  Mark THD::user_vars has to be thread specific.
  Updated call to my_init_dynamic_array()
  Ensure that memory allocated by THD is assigned to the THD.
  More DBUG
  Always acll net_end() in ~THD()
  Assert that all memory signed to this THD is really deleted at ~THD.
  Fixed set_status_var_init() to not reset memory_used.
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_class.h:
  Added MY_THREAD_SPECIFIC to allocated memory.
  Added malloc_size to THD to record allocated memory per THD.
sql/sql_delete.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/sql_error.cc:
  Added 'initialize' parameter to Warning_info() to say if should allocate memory for it's structures.
  This is used by THD::THD() to not allocate memory until THD is ready.
  Added Warning_info::free_memory()
sql/sql_error.h:
  Updated Warning_info() class.
sql/sql_handler.cc:
  Updated call to init_alloc_root() to mark memory thread specific.
sql/sql_insert.cc:
  More DBUG
sql/sql_join_cache.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/sql_lex.cc:
  Updated call to my_init_dynamic_array()
sql/sql_lex.h:
  Updated call to my_init_dynamic_array()
sql/sql_load.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/sql_parse.cc:
  Removed calls to net_end() and thd->cleanup() as these are now done in ~THD()
  Ensure that examined_row_count() is reset before query.
  Fixed bug where kill_threads_for_user() was using the wrong mem_root to allocate memory.
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
  Don't restore thd->status_var.memory_used when restoring thd->status_var
sql/sql_plugin.cc:
  Updated call to init_alloc_root()
  Updated call to my_init_dynamic_array()
  Don't allocate THD on the stack, as this causes problems with valgrind when doing thd memory counting.
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_prepare.cc:
  Added parameter to warning_info() that it should be fully initialized.
  Updated call to init_sql_alloc() to mark memory thread specific.
sql/sql_reload.cc:
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_select.cc:
  Updated call to my_init_dynamic_array() and init_sql_alloc() to mark memory thread specific.
  Added MY_THREAD_SPECIFIC to allocated memory.
  More DBUG
sql/sql_servers.cc:
  Updated call to init_sql_alloc() to mark memory some memory thread specific.
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_show.cc:
  Updated call to my_init_dynamic_array()
  Mark my_dir() memory thread specific.
  Use my_pthread_setspecific_ptr(THR_THD,...) to mark that allocated memory should be allocated to calling thread.
  More DBUG.
  Added malloc_size and examined_row_count to SHOW PROCESSLIST.
  Added MY_THREAD_SPECIFIC to allocated memory.
  Updated call to init_sql_alloc()
  Added parameter to warning_info() that it should be fully initialized.
sql/sql_statistics.cc:
  Fixed compiler warning
sql/sql_string.cc:
  String elements can now be marked as thread specific.
sql/sql_string.h:
  String elements can now be marked as thread specific.
sql/sql_table.cc:
  Updated call to init_sql_alloc() and my_malloc() to mark memory thread specific
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
  Fixed compiler warning
sql/sql_test.cc:
  Updated call to my_init_dynamic_array() to mark memory thread specific.
sql/sql_trigger.cc:
  Updated call to init_sql_alloc()
sql/sql_udf.cc:
  Updated call to init_sql_alloc()
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_update.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/table.cc:
  Updated call to init_sql_alloc().
  Mark memory used by temporary tables, that are not for slave threads, as MY_THREAD_SPECIFIC
  Updated call to init_sql_alloc()
sql/thr_malloc.cc:
  Added my_flags argument to init_sql_alloc() to be able to mark memory as MY_THREAD_SPECIFIC.
sql/thr_malloc.h:
  Updated prototype for init_sql_alloc()
sql/tztime.cc:
  Updated call to init_sql_alloc()
  Updated call to init_alloc_root() to mark memory thread specific.
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/uniques.cc:
  Updated calls to init_tree(), my_init_dynamic_array() and my_malloc() to mark memory thread specific.
sql/unireg.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
storage/csv/ha_tina.cc:
  Updated call to init_alloc_root()
storage/federated/ha_federated.cc:
  Updated call to init_alloc_root()
  Updated call to my_init_dynamic_array()
  Ensure that memory allocated by fedarated is registered for the system, not for the thread.
storage/federatedx/federatedx_io_mysql.cc:
  Updated call to my_init_dynamic_array()
storage/federatedx/ha_federatedx.cc:
  Updated call to init_alloc_root()
  Updated call to my_init_dynamic_array()
storage/heap/ha_heap.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
storage/heap/heapdef.h:
  Added parameter to hp_get_new_block() to be able to do thread specific memory tagging.
storage/heap/hp_block.c:
  Added parameter to hp_get_new_block() to be able to do thread specific memory tagging.
storage/heap/hp_create.c:
  - Internal HEAP tables are now marking it's memory as MY_THREAD_SPECIFIC.
  - Use MY_TREE_WITH_DELETE instead of removed option 'with_delete'.
storage/heap/hp_open.c:
  Internal HEAP tables are now marking it's memory as MY_THREAD_SPECIFIC.
storage/heap/hp_write.c:
  Added new parameter to hp_get_new_block()
storage/maria/ma_bitmap.c:
  Updated call to my_init_dynamic_array()
storage/maria/ma_blockrec.c:
  Updated call to my_init_dynamic_array()
storage/maria/ma_check.c:
  Updated call to init_alloc_root()
storage/maria/ma_ft_boolean_search.c:
  Updated calls to init_tree() and init_alloc_root()
storage/maria/ma_ft_nlq_search.c:
  Updated call to init_tree()
storage/maria/ma_ft_parser.c:
  Updated call to init_tree()
  Updated call to init_alloc_root()
storage/maria/ma_loghandler.c:
  Updated call to my_init_dynamic_array()
storage/maria/ma_open.c:
  Updated call to my_init_dynamic_array()
storage/maria/ma_sort.c:
  Updated call to my_init_dynamic_array()
storage/maria/ma_write.c:
  Updated calls to my_init_dynamic_array() and init_tree()
storage/maria/maria_pack.c:
  Updated call to init_tree()
storage/maria/unittest/sequence_storage.c:
  Updated call to my_init_dynamic_array()
storage/myisam/ft_boolean_search.c:
  Updated call to init_tree()
  Updated call to init_alloc_root()
storage/myisam/ft_nlq_search.c:
  Updated call to init_tree()
storage/myisam/ft_parser.c:
  Updated call to init_tree()
  Updated call to init_alloc_root()
storage/myisam/ft_stopwords.c:
  Updated call to init_tree()
storage/myisam/mi_check.c:
  Updated call to init_alloc_root()
storage/myisam/mi_write.c:
  Updated call to my_init_dynamic_array()
  Updated call to init_tree()
storage/myisam/myisamlog.c:
  Updated call to init_tree()
storage/myisam/myisampack.c:
  Updated call to init_tree()
storage/myisam/sort.c:
  Updated call to my_init_dynamic_array()
storage/myisammrg/ha_myisammrg.cc:
  Updated call to init_sql_alloc()
storage/perfschema/pfs_check.cc:
  Rest current_thd
storage/perfschema/pfs_instr.cc:
  Removed DBUG_ENTER/DBUG_VOID_RETURN as at this point my_thread_var is not allocated anymore, which can cause problems.
support-files/compiler_warnings.supp:
  Disable compiler warning from offsetof macro.
2013-01-23 16:16:14 +01:00
Jani Tolonen
09665bfd0e MDEV-3931 Cassandra SE packaging
Added autodetection for thrift library and includes
Added Cassandra Storage Engine rpm
2013-01-23 15:52:59 +01:00
Olivier Bertrand
5c8c4f4f8e Test for CSV file imported from Windows. 2013-01-23 00:36:00 +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
bb6b87fdcf Fixing CMakeLists.txt:
- Olivier's changes for Linux/Windows
- Splitting cmake code by feature
2013-01-22 19:36:47 +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
2e175a4652 Automatic detection for LIBXML2 and ODBC includes/libraries. 2013-01-22 17:26:12 +04:00
Sergei Golubchik
7925bf6b40 MDEV-4069 thd_wait_end does not called in some cases in buf_page_read_low in XtraDB engine 2013-01-21 12:20:54 +01:00
Sergei Golubchik
d41d43f421 MDEV-4065 thd_kill_statement service 2013-01-18 19:04:23 +01:00
Alexander Barkov
d7143a4160 Adding the CONNECT storage engine sources. 2013-01-18 19:21:44 +04:00
unknown
3546644220 Fix missing #include 2013-01-16 16:12:50 +01:00
Sergei Golubchik
cf013ff949 xtradb merge. Percona-Server-5.5.28-rel29.3 2013-01-16 11:13:08 +01:00
Sergei Golubchik
d3935adf7a mysql-5.5.29 merge 2013-01-15 19:13:32 +01:00
Sergei Golubchik
aca8e7ed6b 5.3 merge 2013-01-15 19:07:46 +01:00
Sergei Golubchik
750b9147fc remove thd_mark_as_hard_kill()
(because it's conceptually wrong. only the user can decide whether the kill is
allowed to leave tables in the inconsistent state, storage engine has no say in that)
2013-01-15 17:46:46 +01:00
Elena Stepanova
7269530938 MDEV-3990: engine tests went out of sync with current MariaDB code
Reasons:
  alter_tablespace.rdiff: 
  tc_rename_error.result:
    from monty@askmonty.org-20120529213755-876ptdhhaj0t7l8r 
    (Added text for errno in error messages)
  insert_time.result:
    from sergii@pisem.net-20120908101555-37w00eyfrd9noc06 
    (MDEV-457 - Inconsistent data truncation)
  misc.result:
    from igor@askmonty.org-20130109033433-5awdv0w6vbpigltw
    (MDEV-3806/mwl248 - Engine independent statistics)
  tbl_opt_row_format.rdiff:
    from monty@askmonty.org-20120706161018-y5teinbuqpchle2m
    (Fixed wrong error codes)
  vcol.rdiff:  
    sergii@pisem.net-20121217100039-ikj1820nrku7p6d5
    (simplify the handler api)
2013-01-13 17:01:34 +04:00
Igor Babaev
1ef07d0845 Merge 10.0-base -> 10.0.
Also fixed a bug in sql_update.cc: the code of mysql_update() lacked
a call of set_statistics_for_table().
2013-01-10 22:33:23 -08:00
Michael Widenius
5f68820cd4 Fixed problem with failing mysql_upgrade when proc table was not correct.
Moved out creation of performance schema tables from mysql_system_tables.sql as
the performance_tables creation scripts needs a working mysql.proc to work.

client/mysql_upgrade.c:
  Added option -V, --version
debian/dist/Debian/mariadb-server-5.5.files:
  Added mysql_performance_tables.sql
debian/dist/Ubuntu/mariadb-server-5.5.files:
  Added mysql_performance_tables.sql
mysql-test/lib/v1/mysql-test-run.pl:
  Added mysql_performance_tables.sql
mysql-test/mysql-test-run.pl:
  Added mysql_performance_tables.sql
scripts/CMakeLists.txt:
  Moved out creation of performance schema tables from mysql_system_tables.sql 
  as the performance_tables creation scripts needs a working mysql.proc to work
scripts/mysql_install_db.sh:
  Added mysql_performance_tables.sql
scripts/mysql_performance_tables.sql:
  Moved out creation of performance schema tables from mysql_system_tables.sql 
  as the performance_tables creation scripts needs a working mysql.proc to work
scripts/mysql_system_tables.sql:
  Move creation of performance schema tables to mysql_performance_tables.sql
  Added 'flush tables' to get things to work if someone deletes a table like mysql.proc before run
scripts/mysql_system_tables_fix.sql:
  ove performance table things to mysql_performance_tables.sql
storage/perfschema/pfs.cc:
  Fixed comment
2013-01-11 00:53:07 +02:00
Michael Widenius
6e9a48b67f Fixed some race conditons and bugs related to killed queries
KILL now breaks locks inside InnoDB
Fixed possible deadlock when running INNODB STATUS
Added ha_kill_query() and kill_query() to send kill signal to all storage engines
Added reset_killed() to ensure we don't reset killed state while awake() is getting called


include/mysql/plugin.h:
  Added thd_mark_as_hard_kill()
include/mysql/plugin_audit.h.pp:
  Added thd_mark_as_hard_kill()
include/mysql/plugin_auth.h.pp:
  Added thd_mark_as_hard_kill()
include/mysql/plugin_ftparser.h.pp:
  Added thd_mark_as_hard_kill()
sql/handler.cc:
  Added ha_kill_query() to send kill signal to all storage engines
sql/handler.h:
  Added ha_kill_query() and kill_query() to send kill signal to all storage engines
sql/log_event.cc:
  Use reset_killed()
sql/mdl.cc:
  use thd->killed instead of thd_killed() to abort on soft kill
sql/sp_rcontext.cc:
  Use reset_killed()
sql/sql_class.cc:
  Fixed possible deadlock in INNODB STATUS by not getting thd->LOCK_thd_data if it's locked.
  Use reset_killed()
  Tell storge engines that KILL has been sent
sql/sql_class.h:
  Added reset_killed() to ensure we don't reset killed state while awake() is getting called.
  Added mark_as_hard_kill()
sql/sql_insert.cc:
  Use reset_killed()
sql/sql_parse.cc:
  Simplify detection of killed queries.
  Use reset_killed()
sql/sql_select.cc:
  Use reset_killed()
sql/sql_union.cc:
  Use reset_killed()
storage/innobase/handler/ha_innodb.cc:
  Added innobase_kill_query()
  Fixed error reporting for interrupted queries.
storage/xtradb/handler/ha_innodb.cc:
  Added innobase_kill_query()
  Fixed error reporting for interrupted queries.
2013-01-11 00:22:14 +02:00
Sergei Golubchik
4f67a14700 5.2->5.3 merge 2013-01-10 15:40:21 +01:00
Sergei Golubchik
bd87fed1dc 5.1 merge 2013-01-10 13:54:04 +01:00
unknown
0a5312dc2f Make cassandra not built by default 2013-01-10 01:01:15 +02:00
unknown
f54a4819b6 Cassandra SE merge 2013-01-10 00:58:36 +02:00
Sergei Golubchik
2e11ca36f2 mysql-5.1.67 merge 2013-01-09 23:51:51 +01:00
unknown
363436ede1 Make cassandra module and do not load it by default. 2013-01-10 00:07:44 +02:00
unknown
655e304531 MDEV-4005 fix.
Field matching fixed.
DBUG_ASSERT fixed.
2013-01-09 08:10:48 +02:00
Igor Babaev
f853333e09 Merge 5.5-mwl248 -> 10.0-base 2013-01-08 19:34:33 -08:00
Igor Babaev
7d9df8075e Merge 5.5 -> mwl248 2013-01-08 15:04:14 -08:00
Sergei Golubchik
a128c50ac1 MDEV-3883 Show global status not in order 2013-01-08 21:23:40 +01:00
Satya Bodapati
1dbc62ce2e Post Fix to Bug#14628410 - ASSERTION `! IS_SET()' FAILED IN
DIAGNOSTICS_AREA::SET_OK_STATUS

Use DBUG_RETURN() instead of return() if DBUG_ENTER() is
used in the function. This patch is to  fix the Windows 
pb2 failure on mysql-5.1

Approved by Marko. rb#1792
2013-01-07 16:56:16 +05:30
Vladislav Vaintroub
ac45f3b38a Remove timed mutexes in XtraDB - obsolete feature that does not link on Windows, if plugin is build dynamically
It was already  removed from innobase in the past.
2013-01-05 23:52:25 +01:00
Satya Bodapati
d95914b648 Merge Post Fix for BUG#14628410 from mysql-5.1 to mysql-5.5 2013-01-04 17:34:02 +05:30
Satya Bodapati
eab9f8f4f4 Post Fix to Bug#14628410 - ASSERTION `! IS_SET()' FAILED IN
DIAGNOSTICS_AREA::SET_OK_STATUS

Test fails on 5.1 valgrind build. This is because of close(-1)
system call.

Fixed by adding extra checks for valid file descriptor.

Approved by Vasil(Calvin). rb#1792
2013-01-04 17:30:39 +05:30
Marc Alff
cc2df0069d Bug#16060864 SEGMENTATION FAULT IN PERFORMANCE_SCHEMA WITH HISTORY SIZE 0
Before this fix, configuring the server with:
- performance_schema_events_waits_history_size=0
- performance_schema_events_waits_history_long_size=0
could cause a crash in the performance schema.

These settings to 0 are intended to be valid and supported,
and are in fact working properly in mysql 5.6 and up already.

This fix backports the code fix and test cases from mysql 5.6
to the mysql 5.5 release.
2013-01-02 11:00:55 +01:00
Sergey Petrunya
ffd5f8c8d4 Post-merge fixes:
- update ha_cassandra::start_bulk_insert() definition to match those in class handler.
2012-12-24 08:36:22 +04:00
unknown
61412c0c31 pre-merge 2012-12-23 23:37:11 +02:00
unknown
40ae63dd65 backport to 5.5 dyncol changes and names support 2012-12-23 20:57:54 +02:00
Igor Babaev
88b59efef6 Merge mdev539->10.0-base. 2012-12-20 15:38:29 -08:00
Igor Babaev
ca2cdaad86 The patch for the task mdev-539.
The patch lifts the limitation of the current implementation
of ALTER TABLE that does not allow to build unique/primary
indexes by sort for MyISAM and Aria engines.
2012-12-20 10:58:40 -08:00
Annamalai Gurusami
c162202ac0 Bug #13819630 ARCHIVE TABLE WITH 1000+ PARTITIONS CRASHES SERVER
ON "DROP TABLE"

In the function ha_archive::write_row(), there is an error code path
that exits the function without releasing the mutex that was acquired
earlier.  

rb#1743 approved by ramil.
2012-12-20 19:26:20 +05:30
Sergey Petrunya
28c9e1a550 Cassandra Storage Engine: Address review feedback part #3
- Cleanup ha_cassandra::store_lock()
- Remove dummy ha_cassandra::delete_table()
- Add HA_TABLE_SCAN_ON_INDEX to table_flags()
2012-12-20 14:30:09 +04:00
Sergey Petrunya
6b47b2fe98 Cassandra Storage Engine: Address review feedback part # 2
- Register counters directly in the array passed to maria_declare_plugin. As 
  a consequence, FLUSH TABLES will reset the counters.
- Update test results accordingly.
2012-12-20 14:15:56 +04:00
Sergey Petrunya
7e5ef40779 Cassandra Storage Engine:
- Partially address review feedback.
- Update cassandra.test result result
- make cassandra.test timezone-agnostic
2012-12-20 13:10:09 +04:00
Annamalai Gurusami
c7fd61814f Bug #14556349 RENAME OF COMPRESSED TABLE AND INSERT BUFFER MERGE CAUSE
HANG

Problem Statement:

When the operation RENAME TABLE is about rename the tablespace of the
table, it will stop all i/o operations on the tablespace temporarily.
For this the fil_space_t::stop_ios member is used.

Once the fil_space_t::stop_ios member is set to TRUE in the RENAME
TABLE operation, it is expected that no new i/o operation will be done
on the tablespace and all pending i/o operation can be completed on
the tablespace.

If the pending i/o operations initiate any new i/o operations then
there will be deadlock.  The RENAME TABLE operation will be waiting
for pending i/o on the tablespace to be completed, and the pending i/o
operations will be waiting on the RENAME TABLE operation to set the
file_space_t::stop_ios flag to be set to FALSE.

But in the given scenario the pending i/o operations did not initiate
new i/o.  But they where still unnecessarily checking the
fil_space_t::stop_ios flag.  This resulted in deadlock.

Solution:

I noticed that this deadlock happens in fil_space_get_size() and
fil_space_get_zip_size() in the i/o threads.  These functions check
the stop_ios flag even when no i/o will be initiated.  I modified
these functions to ensure that they check the stop_ios flag only when
they will be initiating an i/o operation.  This solves the problem.

rb://1635 (mysql-5.5)
rb://1660 (mysql-trunk) approved by Inaam, Jimmy, and ima.
2012-12-20 11:59:36 +05:30
Igor Babaev
f6636852c4 Merge mwl248->10.0-base. 2012-12-19 19:15:51 -08:00
Vasil Dimov
d485482a5f Fix Bug#16021177 DICT_LOAD_FOREIGNS() PASSES UNALIGNED MEMORY TO
DTUPLE_CREATE_FROM_MEM()

Align to word-size the memory occupied by tuple_buf[] memory chunk.
I confirm that this change fixes the SIGBUS on Solaris.

Approved by:	Marko (via IM)
2012-12-19 13:46:00 +02:00
unknown
5fe8e9f244 After-merge fixes for merge 10.0-base -> 10.0. 2012-12-18 22:03:53 +01:00
Vasil Dimov
e8ec0212bb Merge mysql-5.1 -> mysql-5.5 2012-12-18 21:02:56 +02:00