summaryrefslogtreecommitdiff
path: root/sql/handler.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge april.(none):/home/svoj/devel/bk/mysql-5.0-enginesunknown2006-09-121-0/+9
|\ | | | | | | | | | | | | | | | | | | | | | | into april.(none):/home/svoj/devel/mysql/BUG20256/mysql-5.0-push sql/ha_myisam.cc: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged
| * BUG#20256 - LOCK WRITE - MyISAMunknown2006-09-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only MyISAM tables locked with LOCK TABLES ... WRITE were affected. A query that is optimized with index_merge doesn't reflect rows inserted within LOCK TABLES. MyISAM doesn't flush a state within LOCK TABLES. index_merge optimization creates a copy of the handler, which thus gets outdated MyISAM state. New handler->clone() method is introduced to fix this problem. For non-MyISAM storage engines it allocates a handler and opens it with ha_open(). For MyISAM it additionally copies MyISAM state pointer to cloned handler. mysql-test/r/index_merge.result: A test case for bug#20256. mysql-test/t/index_merge.test: A test case for bug#20256. sql/ha_myisam.cc: clone method added to handler class. sql/ha_myisam.h: clone method added to handler class. sql/handler.cc: clone method added to handler class. sql/handler.h: clone method added to handler class. sql/opt_range.cc: Use handler clone method.
* | Bug#20573unknown2006-08-301-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "strict mode: inserts autogenerated auto_increment value bigger than max" Strict mode should fail if autoincrement value is out of range include/my_base.h: Add new handler error codes sql/ha_berkeley.cc: handle error in update_auto_increment() sql/ha_heap.cc: handle error in update_auto_increment() sql/ha_innodb.cc: handle error in update_auto_increment() sql/ha_myisam.cc: handle error in update_auto_increment() sql/ha_myisammrg.cc: handle error in update_auto_increment() sql/ha_ndbcluster.cc: handle error in update_auto_increment() sql/handler.cc: return error from handler::update_auto_increment() sql/handler.h: change return type of handler::update_auto_increment() to int sql/share/errmsg.txt: new error message for auto-increment mysql-test/include/strict_autoinc.inc: New BitKeeper file ``mysql-test/include/strict_autoinc.inc'' mysql-test/r/strict_autoinc_1myisam.result: New BitKeeper file ``mysql-test/r/strict_autoinc_1myisam.result'' mysql-test/r/strict_autoinc_2innodb.result: New BitKeeper file ``mysql-test/r/strict_autoinc_2innodb.result'' mysql-test/r/strict_autoinc_3heap.result: New BitKeeper file ``mysql-test/r/strict_autoinc_3heap.result'' mysql-test/r/strict_autoinc_4bdb.result: New BitKeeper file ``mysql-test/r/strict_autoinc_4bdb.result'' mysql-test/r/strict_autoinc_5ndb.result: New BitKeeper file ``mysql-test/r/strict_autoinc_5ndb.result'' mysql-test/t/strict_autoinc_1myisam.test: New BitKeeper file ``mysql-test/t/strict_autoinc_1myisam.test'' mysql-test/t/strict_autoinc_2innodb.test: New BitKeeper file ``mysql-test/t/strict_autoinc_2innodb.test'' mysql-test/t/strict_autoinc_3heap.test: New BitKeeper file ``mysql-test/t/strict_autoinc_3heap.test'' mysql-test/t/strict_autoinc_4bdb.test: New BitKeeper file ``mysql-test/t/strict_autoinc_4bdb.test'' mysql-test/t/strict_autoinc_5ndb.test: New BitKeeper file ``mysql-test/t/strict_autoinc_5ndb.test''
* | Merge bk://anubis/mysql-5.0-enginesunknown2006-07-211-0/+4
|\ \ | |/ | | | | | | | | | | | | into xiphis.org:/home/antony/work2/merge/mysql-5.0 sql/handler.cc: Auto merged
| * Merge bk-internal:/home/bk/mysql-5.0-enginesunknown2006-07-181-0/+4
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into rama.(none):/home/jimw/my/mysql-5.0-17608 include/my_base.h: Auto merged mysql-test/r/merge.result: Auto merged mysql-test/t/merge.test: Auto merged sql/ha_myisammrg.cc: Auto merged sql/handler.cc: Auto merged
| | * Bug #17766: The server accepts to create MERGE tables which cannot workunknown2006-07-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed the error reporting (and a crash) when inserting data into a MERGE table that has no underlying tables or no INSERT_METHOD specified by reporting that it is read-only. include/my_base.h: Add new handler error mysql-test/r/merge.result: Update results mysql-test/t/merge.test: Add new regression test sql/ha_myisammrg.cc: When trying to insert into a MERGE table with no underlying tables or no INSERT_METHOD, report that it is read-only. sql/handler.cc: Handle new error message
* | | Finish the merge of the patch for bug #15195 from 4.1 -> 5.0unknown2006-07-201-1/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | - Adapt it to work with the handlerton class sql/handler.cc: Only create new MERGE handler if merge engine is enabled sql/mysql_priv.h: Use the myisammrg_hton.state field for the have_merge_db option sql/mysqld.cc: Handle the OPT_MERGE (--skip-merge) option case
* | Merge gbichot3.local:/home/mysql_src/mysql-5.0-20524unknown2006-07-061-11/+21
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into gbichot3.local:/home/mysql_src/mysql-5.0 sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/sql_insert.cc: Auto merged
| * | Fix for BUG#20188 "REPLACE or ON DUPLICATE KEY UPDATE inunknown2006-07-051-11/+21
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | auto_increment breaks binlog": if slave's table had a higher auto_increment counter than master's (even though all rows of the two tables were identical), then in some cases, REPLACE and INSERT ON DUPLICATE KEY UPDATE failed to replicate statement-based (it inserted different values on slave from on master). write_record() contained a "thd->next_insert_id=0" to force an adjustment of thd->next_insert_id after the update or replacement. But it is this assigment introduced indeterminism of the statement on the slave, thus the bug. For ON DUPLICATE, we replace that assignment by a call to handler::adjust_next_insert_id_after_explicit_value() which is deterministic (does not depend on slave table's autoinc counter). For REPLACE, this assignment can simply be removed (as REPLACE can't insert a number larger than thd->next_insert_id). We also move a too early restore_auto_increment() down to when we really know that we can restore the value. mysql-test/r/rpl_insert_id.result: result update, without the bugfix, slave's "3 350" were "4 350". mysql-test/t/rpl_insert_id.test: test for BUG#20188 "REPLACE or ON DUPLICATE KEY UPDATE in auto_increment breaks binlog". There is, in this order: - a test of the bug for the case of REPLACE - a test of basic ON DUPLICATE KEY UPDATE functionality which was not tested before - a test of the bug for the case of ON DUPLICATE KEY UPDATE sql/handler.cc: the adjustment of next_insert_id if inserting a big explicit value, is moved to a separate method to be used elsewhere. sql/handler.h: see handler.cc sql/sql_insert.cc: restore_auto_increment() means "I know I won't use this autogenerated autoincrement value, you are free to reuse it for next row". But we were calling restore_auto_increment() in the case of REPLACE: if write_row() fails inserting the row, we don't know that we won't use the value, as we are going to try again by doing internally an UPDATE of the existing row, or a DELETE of the existing row and then an INSERT. So I move restore_auto_increment() further down, when we know for sure we failed all possibilities for the row. Additionally, in case of REPLACE, we don't need to reset THD::next_insert_id: the value of thd->next_insert_id will be suitable for the next row. In case of ON DUPLICATE KEY UPDATE, resetting thd->next_insert_id is also wrong (breaks statement-based binlog), but cannot simply be removed, as thd->next_insert_id must be adjusted if the explicit value exceeds it. We now do the adjustment by calling handler::adjust_next_insert_id_after_explicit_value() (which, contrary to thd->next_insert_id=0, does not depend on the slave table's autoinc counter, and so is deterministic).
* | Fix for BUG#20524 "auto_increment_* not observed when insertingunknown2006-07-061-2/+51
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | a too large value": the bug was that if MySQL generated a value for an auto_increment column, based on auto_increment_* variables, and this value was bigger than the column's max possible value, then that max possible value was inserted (after issuing a warning). But this didn't honour auto_increment_* variables (and so could cause conflicts in a master-master replication where one master is supposed to generated only even numbers, and the other only odd numbers), so now we "round down" this max possible value to honour auto_increment_* variables, before inserting it. mysql-test/r/rpl_auto_increment.result: result update. Before the fix, the result was that master inserted 127 in t1 (which didn't honour auto_increment_* variables!), instead of failing with "duplicate key 125" like now. mysql-test/t/rpl_auto_increment.test: Test for BUG#20524 "auto_increment_* not observed when inserting a too large value". We also check the pathological case (table t2) where it's impossible to "round down". The fixer of BUG#20573 will be able to use table t2 for testing his fix. sql/handler.cc: If handler::update_auto_increment() generates a value larger than the field's max possible value, we used to simply insert this max possible value (after pushing a warning). Now we "round down" this max possible value to honour auto_increment_* variables (if at all possible), before trying the insertion.
* foo2unknown2006-04-131-53/+0
| | | | | | | | | | | | | | | | | | | sql/ha_innodb.cc: Import patch foo2 sql/ha_innodb.h: Import patch foo2 sql/handler.cc: Import patch foo2 sql/handler.h: Import patch foo2 sql/mysqld.cc: Import patch foo2 sql/set_var.cc: Import patch foo2 sql/sql_class.h: Import patch foo2 sql/sql_repl.cc: Import patch foo2
* foo1unknown2006-04-131-38/+38
| | | | | | | | | | | | | | | | | | | sql/ha_innodb.cc: Import patch foo1 sql/ha_innodb.h: Import patch foo1 sql/handler.cc: Import patch foo1 sql/handler.h: Import patch foo1 sql/mysqld.cc: Import patch foo1 sql/set_var.cc: Import patch foo1 sql/sql_class.h: Import patch foo1 sql/sql_repl.cc: Import patch foo1
* WL#2645 (CHECK TABLE FOR UPGRADE)unknown2006-02-171-0/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | necessary implementation in the server mysql_upgrade script added client/mysqlcheck.c: --check-upgrade option added include/my_base.h: errcode added include/myisam.h: option added scripts/Makefile.am: mysql_upgrade script added sql/handler.cc: checks for old types/bugs added sql/handler.h: declarations regarding checks for upgrade sql/lex.h: sym added sql/share/errmsg.txt: error message added sql/slave.cc: now ha_repair is for public use sql/sql_table.cc: upgrade in ha_repair implemented sql/sql_yacc.yy: CHECK ... FOR UPGRADE added to syntax
* Merge mysql.com:/home/jimw/my/mysql-5.0-14212unknown2006-01-061-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/jimw/my/mysql-5.0-clean sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged mysql-test/r/bdb.result: Resolve conflict mysql-test/t/bdb.test: Resolve conflict
| * Fix crash in BDB from improper cleanup of transactions, and avoid problemunknown2005-12-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in NDB that the fix would cause due to improper registration of a transaction that isn't meant to be seen by the handler layer. (Bug #14212) Thanks to Sergei Golubchik for helping with this. mysql-test/r/bdb.result: Add new result mysql-test/t/bdb.test: Add new regression test sql/ha_ndbcluster.cc: Don't register transaction if transactions are "disabled". sql/handler.cc: Commit statement before trying to end transaction.
* | Merge mysql.com:/home/jimw/my/mysql-5.0-15185unknown2006-01-051-10/+25
|\ \ | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/jimw/my/mysql-5.0-clean sql/handler.cc: Auto merged
| * | Fix crash when trying to open table using a disabled storage engine. (Bug ↵unknown2005-12-141-10/+25
| | | | | | | | | | | | | | | | | | | | | #15185) sql/handler.cc: Don't create handler object for engines that are disabled.
* | | remove "defined(HAVE_ARCHIVE_DB) && !defined(__NETWARE__)" unmaintainably ↵unknown2005-12-241-3/+3
|/ / | | | | | | | | | | | | scattered all over the source include/config-netware.h: put undef HAVE_ARCHIVE_DB where it belongs
* | Disabled archive db for Netware.unknown2005-12-141-3/+3
| |
* | Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0unknown2005-11-211-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0 sql/ha_federated.cc: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_func.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/log.cc: Auto merged sql/mysqld.cc: Auto merged sql/sp_head.cc: Auto merged sql/spatial.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_view.cc: Auto merged
| * | Inefficient usage of String::append() fixed.unknown2005-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bad examples of usage of a string with its length fixed. The incorrect length in the trigger file configuration descriptor fixed (BUG#14090). A hook for unknown keys added to the parser to support old .TRG files. sql/field.cc: Inefficient usage of String::append() fixed. Bad examples of usage of a string with its length fixed. sql/ha_berkeley.cc: A bad example of usage of a string with its length fixed. sql/ha_federated.cc: Inefficient usage of String::append() fixed. sql/ha_myisammrg.cc: Bad examples of usage of a string with its length fixed. sql/handler.cc: Inefficient usage of String::append() fixed. sql/item.cc: Bad examples of usage of a string with its length fixed. sql/item.h: A bad example of usage of a string with its length fixed. sql/item_cmpfunc.cc: Bad examples of usage of a string with its length fixed. sql/item_func.cc: Bad examples of usage of a string with its length fixed. sql/item_strfunc.cc: Bad examples of usage of a string with its length fixed. sql/item_subselect.cc: Bad examples of usage of a string with its length fixed. sql/item_sum.cc: Bad examples of usage of a string with its length fixed. Inefficient usage of String::append() fixed. sql/item_timefunc.cc: Inefficient using of String::append() fixed. Bad examples of usage of a string with its length fixed. sql/item_uniq.h: Bad examples of usage of a string with its length fixed. sql/key.cc: Bad examples of usage of a string with its length fixed. sql/log.cc: Bad examples of usage of a string with its length fixed. sql/log_event.cc: Bad examples of usage of a string with its length fixed. sql/mysqld.cc: The dummy parser hook allocated. sql/opt_range.cc: Inefficient usage of String::append() fixed. sql/parse_file.cc: Bad examples of usage of a string with its length fixed. A hook for unknown keys added to the parser. sql/parse_file.h: A hook for unknown keys added to the parser. sql/protocol.cc: A bad example of usage of a string with its length fixed. sql/repl_failsafe.cc: Bad examples of usage of a string with its length fixed. sql/share/errmsg.txt: A warning for old format config file. sql/slave.cc: Bad examples of usage of a string with its length fixed. sql/sp.cc: Bad examples of usage of a string with its length fixed. sql/sp_head.cc: Bad examples of usage of a string with its length fixed. sql/spatial.cc: A bad example of usage of a string with its length fixed. sql/sql_acl.cc: Bad examples of usage of a string with its length fixed. sql/sql_analyse.cc: Bad examples of usage of a string with its length fixed. Inefficient usage of String::append() fixed. sql/sql_lex.cc: Bad examples of usage of a string with its length fixed. sql/sql_load.cc: A bad example of usage of a string with its length fixed. sql/sql_parse.cc: Bad examples of usage of a string with its length fixed. sql/sql_prepare.cc: A bad example of usage of a string with its length fixed. sql/sql_select.cc: Bad examples of usage of a string with its length fixed. sql/sql_show.cc: Bad examples of usage of a string with its length fixed. sql/sql_string.cc: Bad examples of usage of a string with its length fixed. sql/sql_string.h: The macro definition moved to sql_string.h to be accessible in all parts of server. sql/sql_table.cc: Bad examples of usage of a string with its length fixed. sql/sql_trigger.cc: Bad examples of usage of a string with its length fixed. The incorrect length in the trigger file configuration descriptor fixed (BUG#14090). The hook for processing incorrect sql_mode record added. sql/sql_view.cc: A dummy hook used for parsing views. sql/structs.h: The macro definition moved to sql_string.h to be accessible in all parts of server. sql/table.cc: A bad example of usage of a string with its length fixed. sql/tztime.cc: A bad example of usage of a string with its length fixed.
* | | Merge bk-internal.mysql.com:/home/bk/mysql-5.0unknown2005-11-191-7/+8
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/dlenev/src/mysql-5.0-bg13825 sql/ha_innodb.cc: Auto merged sql/handler.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged
| * | Fix for bug #13825 "Triggers: crash if release savepoint" and for generalunknown2005-11-191-7/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handling of savepoints in stored routines. Fixed ha_rollback_to_savepoint()/ha_savepoint()/ha_release_savepoint() functions to properly handle savepoints inside of stored functions and triggers. Also now when we invoke stored function or trigger we create new savepoint level. We destroy it at the end of function/trigger execution and return back to old savepoint level. mysql-test/r/sp_trans.result: Added test for bug #13825 "Triggers: crash if release savepoint" and for general handling of savepoints in stored routines. mysql-test/t/sp_trans.test: Added test for bug #13825 "Triggers: crash if release savepoint" and for general handling of savepoints in stored routines. sql/ha_innodb.cc: innobase_savepoint(): Replaced check which always failed due to similar check in caller with assertion. sql/handler.cc: ha_rollback_to_savepoint()/ha_savepoint()/ha_release_savepoint(): Changed functions to properly support handling of savepoints inside of stored functions and triggers. sql/sql_class.cc: THD::reset_sub_statement_state()/restore_sub_statement_state(): When we invoke stored function or trigger we should create new savepoint level. We should destroy it at the end of function/trigger execution and return back to old savepoint level. To support this behavior we should save and reset list of current savepoints on entering function and restore old list when we leave it. sql/sql_class.h: Sub_statement_state: When we invoke stored function or trigger we should create new savepoint level. We should destroy it at the end of function/trigger execution and return back to old savepoint level. To support this behavior added "savepoint" member which is used to save/restore list of current savepoints on entering/leaving function. sql/sql_parse.cc: mysql_execute_command(): Changed processing of SQLCOM_SAVEPOINT so now it is not ignored when we are in autocommit mode and savepoint is set inside of stored function or trigger.
* | Merge bk-internal.mysql.com:/home/bk/mysql-5.0unknown2005-11-031-17/+19
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/opt/local/work/mysql-5.0-14210 sql/handler.cc: Auto merged sql/opt_range.cc: Auto merged
| * | A fix and a test case for Bug#14210 "Simple query with > operator on unknown2005-11-031-17/+19
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | large table gives server crash": make sure that when a MyISAM temporary table is created for a cursor, it's created in its memory root, not the memory root of the current query. mysql-test/r/sp.result: Test results fixed: a test case for Bug#14210 mysql-test/t/sp.test: A test case for Bug#14210 "Simple query with > operator on large table gives server crash" sql/handler.cc: - rewrite get_new_handler to accept a memory root and use it for sql/handler.h: - get_new_handler declaration changed sql/opt_range.cc: - get_new_handler declaration changed sql/sql_base.cc: - get_new_handler declaration changed sql/sql_select.cc: - the actual fix for Bug#14210. In create_myisam_from_heap we should create the new table handler in TABLE::mem_root, not in THD::mem_root: the latter is freed shortly after cursor is open. - adjust create_tmp_table to explicitly supply &table->mem_root to get_new_handler when creating a handler for a new temporary table sql/sql_table.cc: - get_new_handler declaration changed sql/table.cc: - get_new_handler declaration changed sql/unireg.cc: - get_new_handler declaration changed tests/mysql_client_test.c: A test case for Bug#14210 "Simple query with > operator on large table gives server crash": a C API test case is worth adding because of different memory allocation/freeing patterns in handling of C API and SP cursors
* | BUG#14514 Creating table with packed key fails silentlyunknown2005-11-021-1/+1
|/ | | | | | | | | include/my_base.h: Move HA_CREATE_FROM_ENGINE to HA_OPTION_CREATE_FROM_ENGINE sql/ha_ndbcluster.cc: Use HA_OPTION_CREATE_FROM_ENGINE sql/handler.cc: Use HA_OPTION_CREATE_FROM_ENGINE
* Fixes during review of new pushed codeunknown2005-10-131-6/+7
| | | | | | | | | | | | sql/handler.cc: Indentation fixes sql/item.cc: Remove not needed test of *ref (If ref is set it always points to a valid address) sql/table.cc: Indentation changes Moved buff_end directly after 'buff' assignment to make code more clear sql/unireg.cc: Indentation changes
* Merge bk-internal.mysql.com:/home/bk/mysql-5.0unknown2005-10-121-12/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/home/my/mysql-5.0 mysql-test/r/view.result: Auto merged mysql-test/t/view.test: Auto merged server-tools/instance-manager/instance.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/slave.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_manager.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/table.cc: Auto merged sql/unireg.cc: Auto merged
| * Reviewing new pushed codeunknown2005-10-121-12/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - CHAR() now returns binary string as default - CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR() - Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait() (Some old systems returns ETIME and it's safer to test for both values than to try to write a wrapper for each old system) - Fixed new introduced bug in NOT BETWEEN X and X - Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed - Use octet2hex() for all conversion of string to hex - Simplify and optimize code client/mysqldump.c: Simple optimizations of new code Indentation fixes client/mysqltest.c: Removed not needed variable include/mysql_com.h: Made octec2hex() more usable mysql-test/r/ctype_utf8.result: CHAR() now returns binary string as default mysql-test/r/func_str.result: CHAR() now returns binary string as default mysql-test/r/range.result: Added test to verify new introduced bug in NOT BETWEEN X and X mysql-test/r/user_var-binlog.result: CHAR() now returns binary string as default mysql-test/r/view.result: More tests of view rename mysql-test/t/ctype_utf8.test: CHAR() now returns binary string as default mysql-test/t/func_str.test: CHAR() now returns binary string as default mysql-test/t/range.test: Added test to verify new introduced bug in NOT BETWEEN X and X mysql-test/t/view.test: More tests of view rename mysys/mf_keycache.c: Indentation changes Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait() mysys/my_os2cond.c: Fix to MySQL coding style Optimized functions mysys/thr_lock.c: Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait() mysys/thr_mutex.c: Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait() server-tools/instance-manager/instance.cc: Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait() server-tools/instance-manager/thread_registry.cc: Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait() sql/ha_federated.cc: Use octet2hex() sql/ha_ndbcluster.cc: Removed not used variable sql/handler.cc: Simplify code Use *NONE* instead of 'none' for not existing storage engine Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed sql/item.h: Remove not needed test for *ref. (If ref is set, it should never point at 0) sql/item_func.cc: Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait() Simplify code More comments Require that last argument to find_and_check_access() is given (Made code shorter and faster) sql/item_strfunc.cc: Changed CHAR() to return result in binary collation CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR() Bar will shortly add the following syntax: CHAR(.... USING character_set) and ensure that CONVERT(CHAR(....) USING utf8) cuts not legal utf8 strings Use ocet2hex() sql/item_strfunc.h: CHAR() now returns a binary string sql/log_event.cc: Use octet2hex() Simplify code sql/parse_file.cc: Indentation fixes Use for() instead of while() sql/password.c: Make octet2hex() more generally usable by returning pointer to end 0 sql/slave.cc: Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait() sql/sql_base.cc: Indentation fixes sql/sql_insert.cc: Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait() sql/sql_manager.cc: Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait() sql/sql_parse.cc: Don't check thd->db when checking for function privileges sql/sql_prepare.cc: Fixed wrong merge sql/sql_select.cc: Fixed new bug for NOT BETWEEN X and X sql/sql_show.cc: Removed not used variable sql/sql_table.cc: Indentation fixed Removed DBUG_PRINT that is obvious from context sql/sql_view.cc: Simplify code sql/unireg.cc: Use octet2hex()
* | Store and read engine type string in extra block of .frm.unknown2005-10-101-5/+11
|/ | | | | | | | sql/handler.cc: Use my_strnncoll instead of my_strcasecmp (it is possible to compare non-asciiz strings now). sql/handler.h: extra block size added to HA_CREATE_INFO.
* Final patch for 5.0 for simplifying storage engine code. We now have just ↵unknown2005-10-031-66/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | one set of ifdefs. I may also remove the code for creating new handlers. May changes were to simplify storage engine setup and support for legacy call to show storage engines. mysql-test/r/ps_1general.result: Fixed test results for new listing order sql/examples/ha_tina.cc: Removed dead code sql/examples/ha_tina.h: Removed dead code sql/ha_archive.cc: Capitalized sotrage engine name and moved disabled code. sql/ha_berkeley.cc: Moved deisabled code sql/ha_federated.cc: Removed disabled code sql/ha_innodb.cc: Removed disabled message sql/ha_ndbcluster.cc: Removed disabled message sql/handler.cc: Added in legacy support for sotrage engine listing (ala Serg's request). Removed handlertons variables and we now have simplified ha_init code. sql/handler.h: No longer need handlertons array.
* Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.0unknown2005-10-021-166/+67
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into zim.(none):/home/brian/mysql/fix-5.0 sql/ha_blackhole.cc: Auto merged sql/ha_heap.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/examples/ha_example.cc: Auto merged sql/examples/ha_tina.cc: Auto merged sql/ha_archive.cc: Auto merged sql/ha_archive.h: Auto merged sql/ha_myisam.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/mysql_priv.h: Auto merged sql/sql_show.cc: Auto merged sql/ha_federated.cc: Merge fix.
| * Next big patch for loadable storage engines!unknown2005-10-021-166/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handlerton array is now created instead of using sys_table_types_st. All storage engines can now have inits and giant ifdef's are now gone for startup. No compeltely clean yet, handlertons will next be merged with sys_table_types. Federated and archive now have real cleanup if their inits fail. sql/examples/ha_archive.cc: Modifications for new ha_init code. The init method now checks for errors and will not start up if the errors occur. sql/examples/ha_archive.h: Change for new init method. sql/examples/ha_example.cc: New handlerton pieces. sql/examples/ha_tina.cc: New handlerton pieces. sql/ha_berkeley.cc: New handlerton pieces, plus changes for ha_init changes. I'm not happy with our current "skip" setup. sql/ha_berkeley.h: Change in init return. sql/ha_blackhole.cc: Changes for new handlerton pieces. sql/ha_federated.cc: Changes for new handlerton and true cleanup code. sql/ha_heap.cc: Changes for new handlerton returns. sql/ha_innodb.cc: Changes for handlerton code. sql/ha_innodb.h: Change in init. sql/ha_myisam.cc: Changes for additional handlerton bits. sql/ha_myisammrg.cc: Changes for new handlerton bits. sql/ha_ndbcluster.cc: Changes for new handlerton bits. sql/ha_ndbcluster.h: Changes for handlerton bits. sql/handler.cc: Changes for ditching show_table_type_st types, and collapsing it into a handlerton array. The ha_init now just loops through all handlers to init (much cleaner...). handlertons and sys_table_types should be merged next. sql/handler.h: Additions for sys_table_types sql/log.cc: Clean up of binlog for changes in handlerton sql/mysql_priv.h: Removed unneeded define for binlog_init sql/sql_show.cc: Changes for change in handlerton to sys_table_types
* | Move handler specific options into handlerton flag checkunknown2005-09-301-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG#13108 mysql-test/r/federated.result: added test results for federated alter table mysql-test/t/federated.test: added test for federated alter table sql/examples/ha_example.cc: supports table re-creation sql/examples/ha_tina.cc: supports table re-creation sql/ha_blackhole.cc: supports table re-creation sql/ha_federated.cc: added flag for not supporting alter sql/ha_heap.cc: supports table recreation sql/ha_myisam.cc: supports table recreation sql/ha_myisammrg.cc: supports table re-creation sql/handler.cc: implemented flag check function sql/handler.h: added additional handlerton flags created a function to test flags replace ha_supports_generate macro with call to flag check sql/sql_delete.cc: replaced ha_supports_generate with handlerton flag check sql/sql_table.cc: added check for handlerton check for alter support
* | Moving archive from example to sql.unknown2005-09-281-1/+1
|/ | | | | | | | | | | | | sql/ha_archive.h: Rename: sql/examples/ha_archive.h -> sql/ha_archive.h libmysqld/Makefile.am: Moved archive files references sql/Makefile.am: Moved archive from example to sql sql/ha_archive.cc: Moved location of prov file. sql/handler.cc: Moved location from examples to sql
* Merge bk-internal.mysql.com:/home/bk/mysql-5.0unknown2005-09-241-6/+14
|\ | | | | | | | | | | | | | | into serg.mylan:/usr/home/serg/Abk/mysql-5.0 sql/handler.cc: Auto merged
| * Fix bug #3443, better foreign key error messsages.unknown2005-09-231-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | innobase/dict/dict0dict.c: Add 'add_newline' parameter to dict_print_info_on_foreign_key_in_create_format. innobase/include/dict0dict.h: Add 'add_newline' parameter to dict_print_info_on_foreign_key_in_create_format. innobase/include/os0file.h: Add os_file_read_string. innobase/include/trx0trx.h: Add trx_set_detailed_error and trx_set_detailed_error_from_file functions and a detailed_error field to trx_struct. innobase/include/ut0mem.h: Add ut_strlcpy. innobase/os/os0file.c: Add os_file_read_string. innobase/row/row0ins.c: Add row_ins_set_detailed function and call it when needed. Adapt to changes in dict_print_info_on_foreign_key_in_create_format. innobase/trx/trx0trx.c: Add trx_set_detailed_error and trx_set_detailed_error_from_file. Clear trx->detailed_error in trx_create. innobase/ut/ut0mem.c: Add ut_strlcpy. mysql-test/r/innodb.result: Add new tests, adapt existing ones whose output was changed. mysql-test/t/innodb.test: Add new tests, adapt existing ones whose output was changed. sql/ha_innodb.cc: Add get_error_message. Clear trx->detailed_error in start_stmt and external_lock. sql/ha_innodb.h: Add get_error_message. sql/handler.cc: Add special case code in print_error for HA_ERR_ROW_IS_REFERENCED and HA_ERR_NO_REFERENCED_ROW. Change SETMSG to point to new error messages. sql/share/errmsg.txt: Add ER_ROW_IS_REFERENCED_2 and ER_NO_REFERENCED_ROW_2.
* | Merge bk-internal.mysql.com:/home/bk/mysql-5.0unknown2005-09-231-45/+23
|\ \ | |/ | | | | | | | | | | | | into serg.mylan:/usr/home/serg/Abk/mysql-5.0 sql/handler.cc: Auto merged
| * Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.0unknown2005-09-221-40/+20
| |\ | | | | | | | | | | | | | | | | | | | | | into zim.(none):/home/brian/mysql/fix-5.0 sql/handler.cc: Auto merged
| | * This fixed bug 13369. Note, I dislike goto's as well.unknown2005-09-221-40/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The alias structure now is a bit more simple and just uses a pointer to replace with the currect name. The giant case statement should go away in the next patch. sql/handler.cc: Simplified the code, annd fixed build issue with engines not being compiled. I disliek the goto but Serg preferred it over the testing of aliases first :) sql/handler.h: Removed ht from alias structure.
| * | Merge mysqldev@production.mysql.com:my/mysql-5.0-releaseunknown2005-09-231-5/+3
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | into mysql.com:/opt/local/work/mysql-5.0-root BitKeeper/etc/ignore: auto-union include/my_sys.h: Auto merged mysql-test/r/information_schema.result: Auto merged mysql-test/t/ctype_ujis.test: Auto merged sql/ha_federated.cc: Auto merged sql/handler.cc: Auto merged sql/item_func.h: Auto merged sql/log.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_lex.h: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_view.cc: Auto merged sql/table.cc: Auto merged
| | * A fix and a test case for Bug#6513 "Test Suite: Values inserted by using unknown2005-09-221-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cursor is interpreted latin1 character and Bug#9819 "Cursors: Mysql Server Crash while fetching from table with 5 million records." A fix for a possible memory leak when fetching into an SP cursor in a long loop. The patch uses a common implementation of cursors in the binary protocol and in stored procedures and implements materialized cursors. For implementation details, see comments in sql_cursor.cc include/my_sys.h: - declaration for multi_alloc_root libmysqld/Makefile.am: - drop protocol_cursor.cc, add sql_cursor.cc (replaces the old implementation of cursors with a new one) mysql-test/r/ctype_ujis.result: - test results fixed (a test case for Bug#6513) mysql-test/r/sp-big.result: - test results fixed (a test case for Bug#9819) mysql-test/t/ctype_ujis.test: Add a test case for Bug#6513 "Test Suite: Values inserted by using cursor is interpreted latin1 character" mysql-test/t/sp-big.test: Add a restricted test case for Bug#9819 "Cursors: Mysql Server Crash while fetching from table with 5 million records." mysys/my_alloc.c: - an implementation of multi_alloc_root; this is largely a copy-paste from mulalloc.c, but the function is small and there is no easy way to reuse the existing C function. sql/Makefile.am: - add sql_cursor.h, sql_cursor.cc (a new implementation of stored procedure cursors) and drop protocol_cursor.cc (the old one) sql/handler.cc: - now TABLE object has its mem_root always initialized. Adjust the implementation handler::ha_open sql/item_subselect.cc: - adjust to the changed declaration of st_select_lex_unit::prepare sql/protocol.h: - drop Protocol_cursor sql/sp_head.cc: - move juggling with Query_arena::free_list and Item::next to sp_eval_func_item, as this is needed in 3 places already. sql/sp_head.h: - declare a no-op implementation for cleanup_stmt in sp_instr_cpush. This method is needed for non-materializing cursors, which are yet not used in stored procedures. - declaration for sp_eval_func_item sql/sp_rcontext.cc: - reimplement sp_cursor using the new implementation of server side cursors. - use sp_eval_func_item to assign values of SP variables from the row fetched from a cursor. This should fix a possible memory leak in the old implementation of sp_cursor::fetch sql/sp_rcontext.h: - reimplement sp_cursor using the new implementation of server side cursors. sql/sql_class.cc: - disable the functionality that closes transient cursors at commit/rollback; transient cursors are not used in 5.0, instead we use materialized ones. To be enabled in a later version. sql/sql_class.h: - adjust to the rename Cursor -> Server_side_cursor - additional declarations of select_union used in materialized cursors sql/sql_derived.cc: - reuse bits of tmp table code in UNION, derived tables, and materialized cursors - cleanup comments sql/sql_lex.h: - declarations of auxiliary methods used by materialized cursors - a cleanup in st_select_lex_unit interface sql/sql_list.h: - add an array operator new[] to class Sql_alloc sql/sql_prepare.cc: - split the tight coupling of cursors and prepared statements to reuse the same implementation in stored procedures - cleanups of error processing in Prepared_statement::{prepare,execute} sql/sql_select.cc: - move the implementation of sensitive (non-materializing) cursors to sql_cursor.cc - make temporary tables self-contained: the table, its record and fields are allocated in TABLE::mem_root. This implementation is not clean and resets thd->mem_root several times because of the way create_tmp_table works (many additional things are done inside it). - adjust to the changed declaration of st_select_lex_unit::prepare sql/sql_select.h: - move the declaration of sensitive (non-materializing) cursors to sql_cursor.cc sql/sql_union.cc: - move pieces of st_select_unit::prepare to select_union and st_table methods to be able to reuse code in the implementation of materialized cursors sql/sql_view.cc: - adjust to the changed signature of st_select_lex_unit::prepare sql/table.cc: - implement auxiliary st_table methods for use with temporary tables sql/table.h: - add declarations for auxiliary methods of st_table used to work with temporary tables tests/mysql_client_test.c: - if cursors are materialized, a parallel update of the table used in the cursor may go through: update the test. sql/sql_cursor.cc: New BitKeeper file ``sql/sql_cursor.cc'' -- implementation of server side cursors sql/sql_cursor.h: New BitKeeper file ``sql/sql_cursor.h'' - declarations for server side cursors.
* | | fixed a memory leak in ha_tina.ccunknown2005-09-221-0/+4
|/ /
* | Fixed a typo in handler.cc if CSV was built. I also added CSV to the ↵unknown2005-09-201-1/+1
| | | | | | | | | | | | | | | | | | default MAX builds so that more people test it. BUILD/SETUP.sh: Adding CVS engine to default max builds. sql/handler.cc: Fixed typo
* | Cleanups for storage engine patch. Changed two test results to now reflect ↵unknown2005-09-191-4/+5
| | | | | | | | | | | | | | | | | | | | | | the changes in storage engines and a couple of comment changes in the code. mysql-test/r/ps_1general.result: Redoing test output with straightened up output for storage engine names. mysql-test/r/variables.result: Fixed test case. sql/handler.cc: Couple of format cleanups and a change in a comment.
* | Cleanup for handlerton structure to allow for loadable engine work. This is ↵unknown2005-09-191-80/+196
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the first in a series of patches. sql/examples/ha_archive.cc: Now declared externally. sql/examples/ha_example.cc: Now declared externally sql/examples/ha_tina.cc: Now declared externally sql/ha_berkeley.cc: Now declared externally sql/ha_blackhole.cc: Now declared externally sql/ha_federated.cc: Now declared externally. sql/ha_heap.cc: Now declared externally. sql/ha_innodb.cc: Now declared externally. sql/ha_myisam.cc: Now declared externally sql/ha_myisammrg.cc: Now declared externally. sql/ha_ndbcluster.cc: Now declared externally. sql/handler.cc: Changes for eventual loadable engines. This will allow us to gain faster access to the handlerton (eventually this will just be a handlteron array). sql/handler.h: New alias structure and change to show_table_st to place handlerton in the structure.
* Added option --valgrind-mysqltest to mysql-test-rununknown2005-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added flag to Field::store(longlong) to specify if value is unsigned. This fixes bug #12750: Incorrect storage of 9999999999999999999 in DECIMAL(19, 0) Fixed warning from valgrind in CREATE ... SELECT Fixed double free of mysql.options if reconnect failed mysql-test/mysql-test-run.sh: Added option --valgrind-mysqltest to allow one to run mysqltest with valgrind mysql-test/r/bigint.result: Update results after fix for Field::store(longlong) mysql-test/r/range.result: Update results after fix for Field::store(longlong) mysql-test/r/strict.result: Update results after fix for Field::store(longlong) (This fixes some wrong results when storing things into bigint columns) mysql-test/r/type_ranges.result: Update results after fix for Field::store(longlong) mysql-test/t/bigint.test: Added testing for #12750: Incorrect storage of 9999999999999999999 in DECIMAL(19, 0) mysql-test/t/innodb.test: Removed comments affected by this bug fix mysql-test/t/mysqldump.test: Fixed result to not depend on existing config files mysql-test/t/range.test: 0xff numbers are now unsigned mysql-test/t/strict.test: Added errors for things that previously (wrongly) succeeded sql-common/client.c: Fixed double free of mysql.options if reconnect failed sql/field.cc: Added flag to Field::store(longlong) to specify if value is unsigned sql/field.h: Added flag to Field::store(longlong) to specify if value is unsigned sql/field_conv.cc: Fixed calls to Field::store(longlong,flag) sql/ha_ndbcluster.cc: Fixed calls to Field::store(longlong,flag) sql/handler.cc: Fixed calls to Field::store(longlong,flag) sql/item.cc: Fixed calls to Field::store(longlong,flag) sql/item_sum.cc: Fixed calls to Field::store(longlong,flag) sql/sp.cc: Fixed calls to Field::store(longlong,flag) sql/sql_acl.cc: Fixed calls to Field::store(longlong,flag) sql/sql_help.cc: Fixed calls to Field::store(longlong,flag) sql/sql_show.cc: Fixed calls to Field::store(longlong,flag) sql/sql_table.cc: Fixed varning from valgrind sql/sql_udf.cc: Fixed calls to Field::store(longlong,flag) sql/tztime.cc: Fixed calls to Field::store(longlong,flag) sql/unireg.cc: Fixed calls to Field::store(longlong,flag)
* don't crash when in XA PREPARE not all storage engines are 2pc-capableunknown2005-09-071-5/+13
|
* After merge fixesunknown2005-08-251-1/+1
| | | | | | | | | | | mysql-test/r/subselect2.result: After merge fix sql/handler.cc: Remove compiler warning sql/sql_acl.cc: After merge fix sql/sql_db.cc: After merge fix
* BUG#12162 - one can start two transactions with the same XID.unknown2005-08-121-41/+22
| | | | | | | Now we keep all active XID's in a hash