An error occurred fetching the project authors.
- 29 Jul, 2005 1 commit
-
-
unknown authored
Before the fix in ~Prepared_statments we got a memory leak when executing mysql_client_test.test Note that test 'variables.test' fails. This will be fixed when Jimw pushes the fix for Bug 10351 mysys/default.c: Fixed typo sql/item.cc: More debugging information sql/sql_prepare.cc: More debugging information Ensure we free all items for prepared statements Before the fix in ~Prepared_statments we got a memory leak when executing mysql_client_test.test
-
- 27 Jul, 2005 1 commit
-
-
unknown authored
Query has to be written to the log before calling thd->set_statement(&stmt_backup), otherwise query will be empty. Setting thd->enabe_slow_log to FALSE prevents that dispatch_command logs the (empty) query again.
-
- 19 Jul, 2005 2 commits
-
-
unknown authored
The idea of the patch is that every cursor gets its own lock id for table level locking. Thus cursors are protected from updates performed within the same connection. Additionally a list of transient (must be closed at commit) cursors is maintained and all transient cursors are closed when necessary. Lastly, this patch adds support for deadlock timeouts to TLL locking when using cursors. + post-review fixes. include/thr_lock.h: - add a notion of lock owner to table level locking. When using cursors, lock owner can not be identified by a thread id any more, as we must protect cursors from updates issued within the same connection (thread). So, each cursor has its own lock identifier to use with table level locking. - extend return values of thr_lock and thr_multi_lock with THR_LOCK_TIMEOUT and THR_LOCK_DEADLOCK, since these conditions are now possible (see comments to thr_lock.c) mysys/thr_lock.c: Better support for cursors: - use THR_LOCK_OWNER * as lock identifier, not pthread_t. - check and return an error for a trivial deadlock case, when an update statement is issued to a table locked by a cursor which has been previously opened in the same connection. - add support for locking timeouts: with use of cursors, trivial deadlocks can occur. For now the only remedy is the lock wait timeout, which is initialized from a new global variable 'table_lock_wait_timeout' Example of a deadlock (assuming the storage engine does not downgrade locks): con1: open cursor for select * from t1; con2: open cursor for select * from t2; con1: update t2 set id=id*2; -- blocked con2: update t1 set id=id*2; -- deadlock Lock timeouts are active only if a connection is using cursors. - the check in the wait_for_lock loop has been changed from data->cond != cond to data->cond != 0. data->cond is zeroed in every place it's changed. - added comments sql/examples/ha_archive.cc: - extend the handlerton with the info about cursor behaviour at commit. sql/examples/ha_archive.h: - ctor moved to .cc to make use of archive handlerton sql/examples/ha_example.cc: - add handlerton instance, init handler::ht with it sql/examples/ha_example.h: - ctor moved to .cc to make use of ha_example handlerton sql/examples/ha_tina.cc: - add handlerton instance, init handler::ht with it sql/examples/ha_tina.h: - ctor moved to .cc to make use of CSV handlerton sql/ha_berkeley.cc: - init handlerton::flags and handler::ht sql/ha_berkeley.h: - ctor moved to .cc to make use of BerkeleyDB handlerton sql/ha_blackhole.cc: - add handlerton instance, init handler::ht with it sql/ha_blackhole.h: - ctor moved to .cc to make use of blackhole handlerton sql/ha_federated.cc: - add handlerton instance, init handler::ht with it sql/ha_federated.h: - ctor moved to .cc to make use of federated handlerton sql/ha_heap.cc: - add handlerton instance, init handler::ht with it sql/ha_heap.h: - ctor moved to .cc to make use of ha_heap handlerton sql/ha_innodb.cc: - init handlerton::flags and handler::ht of innobase storage engine sql/ha_innodb.h: - ctor moved to .cc to make use of archive handlerton sql/ha_myisam.cc: - add handlerton instance, init handler::ht with it sql/ha_myisam.h: - ctor moved to .cc to make use of MyISAM handlerton sql/ha_myisammrg.cc: - init handler::ht in the ctor sql/ha_myisammrg.h: - ctor moved to .cc to make use of MyISAM MERGE handlerton sql/ha_ndbcluster.cc: - init handlerton::flags and handler::ht sql/handler.cc: - drop support for ISAM storage engine, which was removed from 5.0 - close all "transient" cursors at COMMIT/ROLLBACK. A "transient" SQL level cursor is a cursor that uses tables that have a transaction- specific state. sql/handler.h: - extend struct handlerton with flags, add handlerton *ht to every handler instance. sql/lock.cc: - extend mysql_lock_tables to send error to the client if thr_multi_lock returns a timeout or a deadlock error. sql/mysqld.cc: - add server option --table_lock_wait_timeout (in seconds) sql/set_var.cc: - add new global variable 'table_lock_wait_timeout' to specify a wait timeout for table-level locks of MySQL (in seconds). The default timeout is 50 seconds. The timeout is active only if the connection has open cursors. sql/sql_class.cc: - implement Statement_map::close_transient_cursors - safety suggests that we need an assert ensuring llock_info->n_cursors is functioning properly, adjust destruction of the Statement_map to allow such assert in THD::~THD sql/sql_class.h: - add support for Cursors registry to Statement map. sql/sql_prepare.cc: - maintain a list of cursors that must be closed at commit/rollback. sql/sql_select.cc: - extend class Cursor to support specific at-COMMIT/ROLLBACK behavior. If a cursor uses tables of a storage engine that invalidates all open tables at COMMIT/ROLLBACK, it must be closed before COMMIT/ROLLBACK is executed. sql/sql_select.h: - add an own lock_id and commit/rollback status flag to class Cursor tests/mysql_client_test.c: A test case for Bug#10760 and complementary issues: test a simple deadlock case too. mysql-test/var: New BitKeeper file ``mysql-test/var''
-
unknown authored
include/my_global.h: Added floatget() to read unaligned flaot mysql-test/r/select.result: Added test for found_rows() mysql-test/t/select.test: Added test for found_rows() sql/des_key_file.cc: Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition sql/field_conv.cc: Added optimizzed varsion of do_cut_string (for simple character sets) sql/item_func.cc: Simplify code (and ensure DBUG_ENTER is excuted before main code) sql/item_strfunc.cc: Safe calculation of max_length This was needed as max_length can now be 1<<32-1 (after konstantins recent patch to fix BLOB_LENGTH) Remove init_des_key_file() as this is not initialized in mysqld.cc sql/item_timefunc.cc: Safe calculation of max_length This was needed as max_length can now be 1<<32-1 (after konstantins recent patch to fix BLOB_LENGTH) sql/log_event.cc: Simplify code sql/mysql_priv.h: Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition sql/mysqld.cc: Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition Revert wrong patch of calling close_connection() in first close_connections() loop. (Bug #7403) Instead we now print a warning for closed connections only if mysqld is sarted with --warnings Added comments to make the close_connections() logic clearer sql/sql_prepare.cc: Use floatget() and doubleget() to protect against unaligned data sql/sql_select.cc: Fixed some cases unlikely cases where found_rows() would return wrong for queries that would return 0 or 1 rows
-
- 18 Jul, 2005 1 commit
-
-
unknown authored
Changed defaults option --instance to --defaults-group-suffix Changed option handling to allow --defaults-file, --defaults-extra-file and --defaults-group-suffix to be given in any order Changed MYSQL_INSTANCE to MYSQL_GROUP_SUFFIX mysql_print_defaults now understands --defaults-group-suffix Remove usage of my_tempnam() (not safe function) if( -> if ( and while( to while ( BitKeeper/deleted/.del-my_tempnam.c~a8562f15dad3012f: Delete: mysys/my_tempnam.c VC++Files/client/mysqlclient.dsp: Remove not used file my_tempnam.c VC++Files/client/mysqlclient_ia64.dsp: Remove not used file my_tempnam.c VC++Files/libmysql/libmysql.dsp: Remove not used file my_tempnam.c VC++Files/libmysql/libmysql_ia64.dsp: Remove not used file my_tempnam.c VC++Files/mysys/mysys.dsp: Remove not used file my_tempnam.c VC++Files/mysys/mysys_ia64.dsp: Remove not used file my_tempnam.c client/mysql.cc: Change to use get_defaults_options() Remove compiler warnings client/mysqldump.c: Indentation fixes Use quoted table name for 'primary_key_fields' extra/my_print_defaults.c: Add support for --defaults-group-suffix change to use get_default_options() extra/replace.c: Replace my_tempnam() with create_tmp_file() to allow us to remove my_tempnam.c include/config-win.h: Added DEFAULT_GROUP_SUFFIX_ENV include/my_sys.h: Change defaults_instance -> defaults_group_suffix Change get_defaults_files -> get_defaults_options libmysql/Makefile.shared: Added DEFAULT_GROUP_SUFFIX_ENV mysys/Makefile.am: Added DEFAULT_GROUP_SUFFIX_ENV Remove my_tempnam.c mysys/default.c: Changed --instance to --defaults-group-suffix Changed MYSQL_INSTANCE to MYSQL_GROUP_SUFFIX and moved the name to Makefile.am (mysys shouldn't by MySQL independent) Changed option handling to allow --defaults-file, --defaults-extra-file and --defaults-group-suffix to be given in any order mysys/default_modify.c: Optimized code to use allocated space more efficently Reduce code size Ensure that realloc() works independent of argument size mysys/my_bitmap.c: Added missing return sql/ha_innodb.cc: Change if( -> if ( sql/ha_ndbcluster.cc: Change while( -> while ( sql/item_cmpfunc.cc: Break loop early (simple optimization) sql/item_strfunc.cc: Change if( -> if ( sql/log.cc: Fixed comment sql/mysqld.cc: Change if( -> if ( sql/opt_range.cc: while( -> while ( if( -> if ( sql/parse_file.cc: Change if( -> if ( sql/sql_cache.cc: while( -> while ( sql/sql_parse.cc: Change if( -> if ( sql/sql_prepare.cc: Added comment sql/sql_select.cc: while( -> while ( Removed index variable by incrementing pointer sql/sql_show.cc: Change if( -> if ( sql/sql_yacc.yy: Change if( -> if ( tests/mysql_client_test.c: Added cast to first argument to bzero()
-
- 15 Jul, 2005 1 commit
-
-
unknown authored
Fix handling of floats and doubles when using prepared statements API in the embedded server. sql/sql_prepare.cc: Jim's fix for the #10443. Within the embedded server, there's no need to use float4get() and float8get() for setting parameters, since they are never stored.
-
- 14 Jul, 2005 1 commit
-
-
unknown authored
in cursors. libmysql/libmysql.c: - reset_stmt_handle(): don't reset the server side just because we have an open cursor: the server will close the cursor automatically if needed sql/sql_prepare.cc: - implement Prepared_statement::close_cursor, - implicitly close an open cursor in mysql_stmt_execute instead of issuing an error (to reduce the need to explicitly close cursors and save network bandwidth). - cleanup sql/sql_select.cc: Remove a destructor: cursor destruction can not be done by simply calling a destructor, because of cross-references between cursor and statement memory. sql/sql_select.h: - add an empty Cursor destructor tests/mysql_client_test.c: - remove a test for dropped functionality
-
- 13 Jul, 2005 1 commit
-
-
unknown authored
data": remove the fix for another bug (8807) that added OUTER_REF_TABLE_BIT to all subqueries that used a placeholder to prevent their evaluation at prepare. As this bit hanged in Item_subselect::used_tables_cache for ever, a constant subquery with a placeholder was never evaluated as such, which caused wrong choice of the execution plan for the statement. - to fix Bug#8807 backport a better fix from 5.0 - post-review fixes. mysql-test/r/ps.result: Bug#11458: test results fixed mysql-test/t/ps.test: - add a test case for Bug#11458 "Prepared statement with subselects return random data" sql/item.cc: - remove unnecessary Item_param::fix_fields - fix Item_param::set_null to set item_type accordingly (safety: Item_param should behave like a basic constant). sql/item.h: Remove Item_param::fix_fields sql/item_subselect.h: Remove no more existing friend. sql/mysql_priv.h: Add UNCACHEABLE_PREPARE to mark all subqueries as uncacheable if in statement prepare (backport from 5.0). sql/sql_lex.h: Comment fixed. sql/sql_parse.cc: If in statement prepare, mark all subqueries as uncacheable (backport from 5.0) sql/sql_prepare.cc: Switch off the uncacheable flag from all subqueries after statement prepare is done (backport from 5.0)
-
- 04 Jul, 2005 1 commit
-
-
unknown authored
Better fix for ON DUPLICATE KEY UPDATE mysql-test/r/group_by.result: After merge fixes mysql-test/r/select.result: Reorder test to match 4.1 tests (will make future merges easier) mysql-test/t/group_by.test: Added --disable_ps_protocol to avoid extra warning mysql-test/t/select.test: Reorder test to match 4.1 tests (will make future merges easier) sql/mysql_priv.h: Better fix for ON DUPLICATE KEY UPDATE sql/sql_base.cc: After merge fixes sql/sql_insert.cc: Better fix for ON DUPLICATE KEY UPDATE (old solution gave problem with item->cached_table) sql/sql_prepare.cc: Better fix for ON DUPLICATE KEY UPDATE
-
- 01 Jul, 2005 4 commits
-
-
unknown authored
-
unknown authored
sql/sql_prepare.cc: A small fix for the previous patch: we should first free the prepared statement items, and then free the runtime memory root, as some memory used for cleanup is allocated in that mem root. sql/sql_select.cc: - ever free the cursor mem root in close() (it's too early).
-
unknown authored
CURSOR_TYPE_READ_ONLY date/datetime filter server crash". The fix adds support for Item_change_list in cursors (proper rollback of the modified item tree). sql/sql_class.cc: No need to call fatal_error() twice. sql/sql_prepare.cc: - implement proper cleanup of the prepared statement in mysql_stmt_reset if there is a cursor. - take into account thd->change_list when fetching data through a cursor. sql/sql_select.cc: - take into account thd->change_list when fetching data from a cursor: grab it when we open a cursor, and rollback the changes to the parsed tree when we close it. sql/sql_select.h: - Cursor::change_list added tests/mysql_client_test.c: - a test case for Bug#11172 "mysql_stmt_attr_set CURSOR_TYPE_READ_ONLY date/datetime filter server crash"
-
unknown authored
include/my_bitmap.h: new bitmap operation mysql-test/r/view.result: added warnings Correct inserting data check (absence of default value) for view underlying tables (BUG#6443) mysql-test/t/view.test: Correct inserting data check (absence of default value) for view underlying tables (BUG#6443) mysys/my_bitmap.c: new bitmap operation sql/field.h: index of field in table added sql/item.cc: Name resolution context added table list removed from fix_fields() arguments sql/item.h: Name resolution context added table list removed from fix_fields() arguments sql/item_cmpfunc.cc: table list removed from fix_fields() arguments sql/item_cmpfunc.h: table list removed from fix_fields() arguments sql/item_func.cc: table list removed from fix_fields() arguments sql/item_func.h: table list removed from fix_fields() arguments sql/item_row.cc: table list removed from fix_fields() arguments sql/item_row.h: table list removed from fix_fields() arguments sql/item_strfunc.cc: fixed server crash on NULL argument sql/item_strfunc.h: table list removed from fix_fields() arguments sql/item_subselect.cc: table list removed from fix_fields() arguments sql/item_subselect.h: table list removed from fix_fields() arguments sql/item_sum.cc: table list removed from fix_fields() arguments sql/item_sum.h: table list removed from fix_fields() arguments sql/item_timefunc.cc: table list removed from fix_fields() arguments sql/item_timefunc.h: table list removed from fix_fields() arguments sql/item_uniq.h: table list removed from fix_fields() arguments sql/log_event.cc: Name resolution context added sql/log_event.h: Name resolution context added sql/mysql_priv.h: Name resolution context added sql/set_var.cc: table list removed from fix_fields() arguments sql/share/errmsg.txt: new error message sql/sp.cc: Name resolution context added sql/sp_head.cc: table list removed from fix_fields() arguments sql/sp_head.h: Name resolution context added sql/sql_base.cc: table list removed from fix_fields() arguments Name resolution context added sql/sql_class.cc: renamed variable sql/sql_delete.cc: Name resolution context added sql/sql_derived.cc: Name resolution context added sql/sql_do.cc: table list removed from fix_fields() arguments sql/sql_handler.cc: Name resolution context added sql/sql_help.cc: Name resolution context added sql/sql_insert.cc: Name resolution context added table list removed from fix_fields() arguments sql/sql_lex.cc: Name resolution context added sql/sql_lex.h: removed resolve mode (information stored into name resolution context) sql/sql_load.cc: table list removed from fix_fields() arguments sql/sql_olap.cc: Name resolution context added sql/sql_parse.cc: Name resolution context added sql/sql_prepare.cc: table list removed from fix_fields() arguments sql/sql_select.cc: table list removed from fix_fields() arguments sql/sql_show.cc: Name resolution context added sql/sql_trigger.cc: table list removed from fix_fields() arguments sql/sql_udf.h: table list removed from fix_fields() arguments sql/sql_union.cc: Name resolution context added sql/sql_update.cc: Name resolution context added sql/sql_view.cc: Name resolution context added sql/sql_view.h: table list removed from fix_fields() arguments sql/sql_yacc.yy: Name resolution context added sql/table.cc: Name resolution context added merged view processing moved sql/table.h: merged view processing moved
-
- 27 Jun, 2005 1 commit
-
-
unknown authored
#9728 'Decreased functionality in "on duplicate key update #8147 'a column proclaimed ambigous in INSERT ... SELECT .. ON DUPLICATE' This ensures fields are uniquely qualified and also that one can't update other tables in the ON DUPLICATE KEY UPDATE part mysql-test/r/insert_select.result: More tests for bug #9728 and #8147 mysql-test/r/insert_update.result: Updated tests after changing how INSERT ... SELECT .. ON DUPLICATE KEY works mysql-test/t/insert_select.test: More tests for bug #9728 and #8147 mysql-test/t/insert_update.test: Updated tests after changing how INSERT ... SELECT .. ON DUPLICATE KEY works mysys/my_access.c: Cleanup (shorter loop variable names) sql/ha_ndbcluster.cc: Indentation fixes sql/item.cc: Remove item_flags sql/item.h: Remove item_flags sql/mysql_priv.h: New arguments to mysql_prepare_insert sql/sql_base.cc: Remove old fix for bug #8147 sql/sql_insert.cc: Extend mysql_prepare_insert() with new field list for tables that can be used in the values port of ON DUPLICATE KEY UPDATE sql/sql_parse.cc: Revert fix for #9728 Allow one to use other tables in ON DUPLICATE_KEY for INSERT ... SELECT if there is no GROUP BY clause sql/sql_prepare.cc: New arguments to mysql_prepare_insert sql/sql_yacc.yy: Revert bug fix for #9728
-
- 23 Jun, 2005 1 commit
-
-
unknown authored
We need every instruction to have its own arena, because we want to track instruction's state (INITIALIZED_FOR_SP -> EXECUTED). Because of `if' statements and other conditional instructions used in stored procedures, not every instruction of a stored procedure gets executed during the first (or even subsequent) execution of the procedure. So it's better if we track the execution state of every instruction independently. All instructions of a given procedure now also share sp_head's mem_root, but keep their own free_list. This simplifies juggling with free Item lists in sp_head::execute. - free_items() moved to be a member of Query_arena. - logic of 'backup_arena' debug member of Query_arena has been changed to support multi-backups. Until now, TRUE 'backup_arena' meant that there is exactly one active backup of the THD arena. Now it means simply that the arena is used for backup, so that we can't accidentally overwrite an existing backup. This allows doing multiple backups, e.g. in sp_head::execute and Cursor::fetch, when THD arena is already backed up but we want to set yet another arena (usually the 'permanent' arena, to save permanent transformations/optimizations of a parsed tree). sql/sp_head.cc: - use Query_arena support in sp_head::execute() as now sp_instr inherites from it. sql/sp_head.h: - inherite sp_instr from Query_arena sql/sql_class.cc: - changed the principle of Query_arena::backup_arena; free_items is now a member of Query_arena. sql/sql_class.h: - changed the principle of Query_arena::backup_arena; free_items is now a member of Query_arena. sql/sql_prepare.cc: free_items() is now a member of Query_arena. sql/sql_select.cc: free_items() now automatically sets free_list to zero.
-
- 22 Jun, 2005 2 commits
-
-
unknown authored
sql/sql_class.cc: Statement constructor for the case when it's used for backup only was removed. sql/sql_class.h: Remove THD::stmt_backup and simplify Statement constructors. sql/sql_prepare.cc: Use an object on stack instead of THD::stmt_backup sql/sql_select.cc: Use an object on stack instead of THD::stmt_backup
-
unknown authored
main_mem_root is moved out of class Query_arena. sql/sp_head.cc: Adjust to the changed Query_arena constructor. main_mem_root is moved out of class Query_arena. sql/sp_head.h: main_mem_root is moved out of class Query_arena: add it to class sp_head. sql/sql_class.cc: main_mem_root is moved out of class Query_arena: remove constructors no longer relevant, remove dead code. sql/sql_class.h: main_mem_root is moved out of class Query_arena. sql/sql_prepare.cc: It's better to not use main_mem_root anywhere: logically, it's not a public member (can't fix sp_head::make_field and Item_subselect::exec to make it protected) sql/sql_select.cc: New Cursor constructor, which avoids unneeded memory allocation when initializign main_mem_root. sql/sql_select.h: main_mem_root is moved out of class Query_arena.
-
- 20 Jun, 2005 1 commit
-
-
unknown authored
sql/share/errmsg.txt: Fix a formatting bug. sql/sql_prepare.cc: Fix a formatting bug. tests/mysql_client_test.c: Test the server side error message.
-
- 17 Jun, 2005 1 commit
-
-
unknown authored
libmysql/libmysql.c: Rename. libmysqld/lib_sql.cc: Rename. sql/item_cmpfunc.cc: Use proper method to check for stmt prepare, only_prepare is removed. sql/mysql_priv.h: Remove an obsolete define. Rename mysql_stmt_free to mysql_stmt_close. sql/sql_class.h: Remove THD::only_prepare. Rename. sql/sql_lex.cc: Rename COM_PREPARE -> COM_STMT_PREPARE sql/sql_parse.cc: Rename. sql/sql_prepare.cc: Rename. sql/sql_yacc.yy: Rename. tests/mysql_client_test.c: Rename.
-
- 16 Jun, 2005 2 commits
-
-
unknown authored
-
unknown authored
Bug#8367 "low log doesn't gives complete information about prepared statements" Implement status variables for prepared statements commands (a port of the patch by Andrey Hristov). See details in comments to the changed files. No test case as there is no way to test slow log/general log in mysqltest. mysql-test/r/ps_grant.result: Now execute is logged with tag 'Execute' (changed result file). sql/mysql_priv.h: - remove obsolete macro. - add declarations for new status variables. - export function log_slow_statement, which now is used in sql_prepare.cc sql/mysqld.cc: Add status variables for prepared statements API: now we record mysql_stmt_close, mysql_stmt_reset, mysql_stmt_prepare, mysql_stmt_execute mysql_stmt_send_long_data, PREPARE, EXECUTE, DEALLOCATE. sql/sql_parse.cc: - account DEALLOCATE prepare as a Com_stmt_close command (close of a prepared statement). sql/sql_prepare.cc: - fix a bug in SQL syntax for prepared statements + logging: if we use --log and EXECUTE stmt USING @no_such_variable;, the server crashed because the old code assumed that the variable returned by get_var_with_binlog is never NULL. - account statistics for mysql_stmt_{prepare,execute,close,reset,send_long_data} in Com_stmt_{prepare,execute,close,reset,send_long_data} correspondingly. - log slow statements into the slow log early, when thd->query points to a valid (with expanded placeholder values) query. The previous version was logging it in sql_parse, when thd->query is empty. Prevent the server from logging the statement twice by setting thd->enable_slow_log= FALSE. - now in case of EXECUTE stmt in SQL syntax for prepared statements the general log gets two queries, e.g. Query EXECUTE stmt USING @A, @b, @c Execute INSERT INTO t1 VALUES (1, 2, 3) This makes the behavior consistent with PREPARE command, which also logs the statement twice.
-
- 15 Jun, 2005 1 commit
-
-
unknown authored
Item_buff -> Cached_item Item_arena -> Query_arena TEST_ASSERT -> YYERROR_UNLESS sql/item.h: renamed: Item_buff -> Cached_item sql/item_buff.cc: renamed: Item_buff -> Cached_item sql/item_func.cc: renamed: Item_arena -> Query_arena sql/item_subselect.cc: renamed: Item_arena -> Query_arena sql/sp_head.cc: renamed: Item_arena -> Query_arena sql/sp_head.h: renamed: Item_arena -> Query_arena sql/sql_base.cc: renamed: Item_arena -> Query_arena sql/sql_class.cc: renamed: Item_arena -> Query_arena sql/sql_class.h: renamed: Item_arena -> Query_arena sql/sql_lex.cc: renamed: Item_arena -> Query_arena sql/sql_prepare.cc: renamed: Item_arena -> Query_arena sql/sql_select.cc: renamed: Item_arena -> Query_arena sql/sql_select.h: renamed: Item_buff -> Cached_item Item_arena -> Query_arena sql/sql_union.cc: renamed: Item_arena -> Query_arena sql/sql_view.cc: renamed: Item_arena -> Query_arena sql/sql_yacc.yy: renamed: TEST_ASSERT -> YYERROR_UNLESS sql/table.cc: renamed: Item_arena -> Query_arena
-
- 09 Jun, 2005 1 commit
-
-
unknown authored
CURSOR_TYPE_READ_ONLY". The bug was that we (me) don't perform proper cleanups of the prepared statement when done fetching from a cursor. Another patch. sql/mysql_priv.h: Rename reset_stmt_for_execute to init_stmt_before_use (to correspond to cleanup_stmt_and_thd_after_use). sql/sp_head.cc: Rename. sql/sql_prepare.cc: Move common cleanup code to a cleanup function, call it when we close a cursor. sql/sql_select.cc: Cleanup. sql/sql_select.h: No need for init_thd, this code has been inlined in Cursor::open. tests/mysql_client_test.c: Add a test case for Bug#10729 "mysql_stmt_attr_set CURSOR_TYPE_READ_ONLY" (problem reusing a prepared statemnt if there was a cursor)
-
- 08 Jun, 2005 3 commits
-
-
unknown authored
In order to make multi-delete SP friendly we need to have all table locks for the elements of main statement table list properly set at the end of parsing. Also performed small cleanup: We don't need relink_tables_for_multidelete() any longer since the only case now when TABLE_LIST::correspondent_table is non-zero are tables in auxilary table list of multi-delete and these tables are handled specially in mysql_multi_delete_prepare(). mysql-test/r/sp-threads.result: Added test case for bug #11158 "Can't perform multi-delete in stored procedure". mysql-test/t/sp-threads.test: Added test case for bug #11158 "Can't perform multi-delete in stored procedure". sql/mysql_priv.h: - Removed third argument from the declaration of multi_delete_precheck() as nowdays we calculate number of tables in multi-delete from which we are going to delete rows right at the end of statement parsing. - Introduced definition of multi_delete_set_locks_and_link_aux_tables() which is responsible for propagation of proper table locks from multi-delete's auxilary table list to the main list and binding corresponding tables in these two lists. sql/sql_base.cc: Removed relink_tables_for_multidelete() routine and its invocations. We don't need them in 5.0 since the only case now when TABLE_LIST::correspondent_table is non-zero are tables in auxilary table list of multi-delete and these tables are handled specially in mysql_multi_delete_prepare(). sql/sql_lex.h: LEX::table_count Added description of new role of this LEX member for multi-delete. Now for this statement we store number of tables from which we should delete records there. sql/sql_parse.cc: multi_delete_precheck(): Moved code which is responsible for iterating through auxilary table list and binding its elements with corresponding elements of main table list, and properly updating locks in it to separate function - multi_delete_set_locks_and_link_aux_tables(). This is because in order to make multi-delete SP friendly we need to have all locks set properly at the end of statement parsing. So we are introducing new function which will be called from parser. We also calculate number of tables from which we are going to perform deletions there and store this number for later usage in LEX::table_count. Also removed some no longer needed code. sql/sql_prepare.cc: mysql_test_multidelete(): Now multi_delete_precheck() takes only two arguments, so we don't need to pass fake third parameter. sql/sql_yacc.yy: delete: In order to make multi-delete SP friendly we need to have all table locks for the elements of main statement table list properly set at the end of parsing.
-
unknown authored
-
unknown authored
sql/sql_prepare.cc: Cleanup mysql_test_* family of calls: now we don't send error message from mysql_stmt_prepare, so no need to support -1 return code (meaning error is not sent to client) in these functions. Move unit->cleanup() to mysql_stmt_prepare() as it's done in most of the mysql_test_ functions, and is a no-op for those which don't call unit->prepare(). This should make fixing of Bug#10729 (cursors) easier.
-
- 07 Jun, 2005 1 commit
-
-
unknown authored
don't evaluate subqueries during statement prepare, even if they are not correlated. With post-review fixes. sql/mysql_priv.h: Add UNCACHEABLE_PREPARE to mark subqueries as non-constant in mysql_stmt_prepare sql/sql_lex.cc: Add a missing assert: noone can call unit::set_limit from mysql_stmt_prepare. sql/sql_lex.h: Comment fixed. sql/sql_parse.cc: Mark new SELECT_LEXes as uncacheable if they created during statement prepare. sql/sql_prepare.cc: Switch off the uncacheable flag when prepare is done.
-
- 16 May, 2005 1 commit
-
-
unknown authored
Fixed bug in mysql_stmt_fetch() when retrieving rows to return mysql-test/r/ps.result: Fix to not get warnings if mysql_client_test.test fails mysql-test/t/index_merge_ror.test: Proper fix for 64 bit intel (which gives uses another, equal good index) mysql-test/t/ps.test: Fix to not get warnings if mysql_client_test.test fails sql-common/client.c: More debugging sql/sql_prepare.cc: Fixed bug in mysql_stmt_fetch() when retrieving rows to return sql/sql_select.cc: More debugging tests/mysql_client_test.c: More debugging
-
- 12 May, 2005 1 commit
-
-
unknown authored
(crash on attempt to re-execute a statement with an open cursor) + post-review fixes. include/errmsg.h: Add a special error message when we attempt to mysql_stmt_fetch from a statement which has no result set. libmysql/errmsg.c: Error message text for CR_NO_RESULT_SET libmysql/libmysql.c: Move the code which frees result sets on client and closes the cursor on server, resets long data state on client and server. This makes one function out of two (mysql_stmt_reset and mysql_stmt_free_result), thus aggregating all related reset work in one place. sql-common/client.c: Fix one place where we flushed the pending result set of a statement, but didn't set unbuffered_fetch_cancelled flag. sql/share/errmsg.txt: Fix format of ER_UNKNOWN_STMT_HANDLER error message (needs to be fixed separately in 4.1). Add two new error messages for the case when we fetch from when there is no cursor and for the case when we attempt to execute a statement while there is a cursor. sql/sql_prepare.cc: Return error when we fetch while there is no open cursor and when we call execute while there is a pending cursor. Fix mysql_stmt_reset to close the open cursor if there is any. sql/sql_select.cc: free_items and free_root moved to Cursor::close(). sql/sql_select.h: A comment added. tests/mysql_client_test.c: A test case for Bug#9478, test the case of mysql_stmt_reset called for client-side cached result set and for the case with open cursor. All strcpy replaced with strmov (review request).
-
- 10 May, 2005 1 commit
-
-
unknown authored
Fixed bug #8528. Representation for single-table views was made similar to representation for multi-table views. view.test: Added test case for bug #8528. view.result: Added test case for bug #8528. Fixed other test cases. mysql-test/r/view.result: Added test case for bug #8528. Fixed other test cases. mysql-test/t/view.test: Added test case for bug #8528. sql/sql_base.cc: Fixed bug #8528. Representation for single-table views was made similar to representation for multi-table views. sql/sql_delete.cc: Fixed bug #8528. Representation for single-table views was made similar to representation for multi-table views. sql/sql_insert.cc: Fixed bug #8528. Representation for single-table views was made similar to representation for multi-table views. sql/sql_parse.cc: Fixed bug #8528. Representation for single-table views was made similar to representation for multi-table views. sql/sql_prepare.cc: Fixed bug #8528. Representation for single-table views was made similar to representation for multi-table views. sql/sql_select.cc: Fixed bug #8528. Representation for single-table views was made similar to representation for multi-table views. sql/sql_update.cc: Fixed bug #8528. Representation for single-table views was made similar to representation for multi-table views. sql/sql_view.cc: Fixed bug #8528. Representation for single-table views was made similar to representation for multi-table views. sql/table.cc: Fixed bug #8528. Representation for single-table views was made similar to representation for multi-table views. sql/table.h: Fixed bug #8528. Representation for single-table views was made similar to representation for multi-table views.
-
- 30 Apr, 2005 1 commit
-
-
unknown authored
with cursor". The patch refactors do_select/sub_select functions, which implement the nested loop algorithm, and reuses them to fetch rows for cursors as well. Pushing with view.test failing (--ps-protocol). sql/sql_prepare.cc: Cursor::fetch() now returns void sql/sql_select.cc: A fix for Bug#9520 "SELECT DISTINCT crashes server with cursor": * rename sub_select returns codes to be able to track down what's going on in which case. * move record processing and outer join record processing to a separate function, out of sub_select read-record loop. * use generalized sub_select() nested loop function for cursors instead of own loop implementation used in Cursor::fetch() before sql/sql_select.h: Replace all return values of sub_select family with enum. Add JOIN::resume_nested_loop flag to indicate we are restarting the nested loop for execution of next chunk of cursor's rows. tests/mysql_client_test.c: A test case for Bug#9520 "SELECT DISTINCT crashes server with cursor"
-
- 15 Apr, 2005 1 commit
-
-
unknown authored
New more SP-locking friendly approach to handling locks in multi-update. Now we mark all tables of multi-update as needing write lock at parsing stage and if possible downgrade lock at execution stage (For its work SP-locking mechanism needs to know all lock types right after parsing stage). mysql-test/r/sp-threads.result: Added test for bug #9486 "Can't perform multi-update in stored procedure". mysql-test/t/sp-threads.test: Added test for bug #9486 "Can't perform multi-update in stored procedure". sql/sp_head.cc: SP_TABLE, sp_head::merge_table_list()/add_used_tables_to_table_list(): Since some queries during their execution (e.g. multi-update) may change type of lock for some of their tables and thus change lock_type member for some of elements of table list, we should store type of lock in SP_TABLE struct explicitly instead of using lock_type member of TABLE_LIST object pointed by SP_TABLE::table. sql/sql_lex.h: Removed no longer used LEX::multi_lock_option member. sql/sql_prepare.cc: mysql_test_update(): We don't need to bother about LEX::multi_lock_option if we convert multi-update to update anymore. Since nowdays multi-update uses TABLE_LIST::lock_type for specifying lock level of updated tables instead of LEX::multi_lock_option. sql/sql_update.cc: mysql_update()/mysql_multi_update_prepare(): Now we mark all tables of multi-update as needing write lock at parsing stage and if possible downgrade lock at execution stage. Old approach (don't set lock type until execution stage) was not working well with SP-locking (For its work SP-locking mechanism needs to know all lock types right after parsing stage). mysql_multi_update(): We should return FALSE if no error occurs. sql/sql_yacc.yy: update: Now we mark all tables of multi-update as needing write lock at parsing stage and if possible downgrade lock at execution stage. Old approach (don't set lock type until execution stage) was not working well with SP-locking (For its work SP-locking mechanism needs to know all lock types right after parsing stage).
-
- 13 Apr, 2005 1 commit
-
-
unknown authored
mysql-test/r/ps.result: Test results: adding tests for CALL statement in prepared mode. mysql-test/t/ps.test: Adding tests for CALL statement in prepared mode.
-
- 28 Mar, 2005 1 commit
-
-
unknown authored
(BUG##9398, BUG#8703) fixed wrong join view detection in multi-delete which lead to server crash mysql-test/r/lowercase_view.result: added new tests of updation and selection from the same table mysql-test/r/view.result: added new tests of updation and selection from the same table added test of multidelete command over join view which lead to server crash test suite from bugs #9398 and #8703 mysql-test/t/lowercase_view.test: added new tests of updation and selection from the same table mysql-test/t/view.test: added new tests of updation and selection from the same table added test of multidelete command over join view which lead to server crash test suite from bugs #9398 and #8703 sql/sql_base.cc: changed procedure of finding tables sql/sql_class.cc: added derived table procession detection sql/sql_class.h: added derived table procession detection sql/sql_delete.cc: fixed detection of selection from table which update for multidelete sql/sql_derived.cc: added derived table procession detection sql/sql_lex.cc: added detection os SELECTs processed inside derived tables removed old mechanism of multidelete/multiupdate table duplication detection (which can't work with views) sql/sql_lex.h: added detection os SELECTs processed inside derived tables removed old mechanism of multidelete/multiupdate table duplication detection (which can't work with views) sql/sql_parse.cc: removed wrong test of join view (for multidelete in can be not only first table) sql/sql_prepare.cc: added detection os SELECTs processed inside derived tables (reset it for reusing in PS/SP) sql/sql_select.cc: added detection os SELECTs processed inside derived tables sql/sql_update.cc: fixed detection of selection from table which update for multiupdate
-
- 24 Mar, 2005 1 commit
-
-
unknown authored
and Bug#9159 "Server crash during mysql_stmt_close". The patch adds support for single-row result sets in cursors. libmysql/libmysql.c: If we wanted a cursor, and the server wasn't able to create one, buffer all rows on client. Currently this is possible only for single row result sets and some SHOW commands. sql/sql_prepare.cc: Properly free resources if there was a request to open a cursor which wasn't fullfilled. Give error on attempt to open a cursor for a statement not returning a result set. sql/sql_select.h: Initialize Item_arena of Cursor object. A case when a cursor object is created but not used is possible with single-row result sets. tests/mysql_client_test.c: Test cases for Bug#8880 and Bug#9159
-
- 23 Mar, 2005 1 commit
-
-
unknown authored
mysql-test/r/func_group.result: new result mysql-test/r/metadata.result: new result test of metadata of variables, unions and derived tables mysql-test/r/union.result: new results test of union of enum mysql-test/t/metadata.test: test of metadata of variables, unions and derived tables mysql-test/t/union.test: test of union of enum sql/field.cc: Field type merging rules added Fixed table name/alias returting for field made from temporary tables sql/field.h: removed unned field type reporting sql/item.cc: fixed bug in NEW_DATE type field creartion replaced mechanism of merging types of UNION sql/item.h: replaced mechanism of merging types of UNION sql/item_func.h: new item type to make correct field type detection possible sql/item_subselect.cc: added table name parameter to prepare() to show right table alias for derived tables sql/sql_derived.cc: added table name parameter to prepare() to show right table alias for derived tables sql/sql_lex.h: added table name parameter to prepare() to show right table alias for derived tables sql/sql_parse.cc: made function for enum/set pack length calculation sql/sql_prepare.cc: added table name parameter to prepare() to show right table alias for derived tables sql/sql_select.cc: new temporary table field creation by Item_type_holder fixed table alias for temporary table sql/sql_union.cc: added table name parameter to prepare() to show right table alias for derived tables
-
- 17 Mar, 2005 1 commit
-
-
unknown authored
don't call escape_string_for_mysql() unnecesary don't overwrite local buffer escape_string_for_mysql(): take a length of the destination buffer as an argument include/my_sys.h: prototype changed libmysql/libmysql.c: prototype changed mysys/charset.c: escape_string_for_mysql(): take a length of the destination buffer as an argument sql/field.cc: Field::quote_data(): don't call escape_string_for_mysql() unnecesary don't overwrite local buffer sql/item.cc: prototype changed sql/sql_prepare.cc: prototype changed
-
- 16 Mar, 2005 1 commit
-
-
unknown authored
Removed some optional arguments Fixed portability problem in federated tests client/sql_string.cc: update from sql/sql_string.cc client/sql_string.h: update from sql/sql_string.h mysql-test/r/federated.result: Fixed error message sql/field.cc: Cleanup during review Remove const in 'const unsigned int' sql/field.h: Remove const in 'const unsigned int' sql/ha_federated.cc: Better error string. Add missing argument to error (before 'errno' was picked up from stack) sql/handler.cc: Removed compiler warning sql/item_func.cc: Cleanup during review sql/item_sum.cc: Cleanup during review sql/lock.cc: Remove optional arguments sql/log_event.cc: Remove optional arguments sql/mysql_priv.h: Remove optional arguments cahnge preapre_create_fields to use pointers instead of references sql/opt_range.cc: Fix arguments so that return value is last sql/sql_base.cc: Remove optional arguments sql/sql_delete.cc: Remove optional arguments sql/sql_error.cc: Remove optional arguments sql/sql_help.cc: Remove optional arguments sql/sql_parse.cc: Remove optional arguments sql/sql_prepare.cc: Remove optional arguments sql/sql_rename.cc: Remove optional arguments sql/sql_select.cc: Remove optional arguments sql/sql_show.cc: Cleanup during review sql/sql_string.cc: Simple optimization sql/sql_table.cc: Remove optional arguments Fixed indentation sql/sql_update.cc: Remove optional arguments sql/sql_yacc.yy: Change references to pointers
-
- 10 Mar, 2005 1 commit
-
-
unknown authored
Now we should call open_and_lock_tables() even if table list is empty - to cache stored routines used by query and open and lock tables required for their execution. sql/sql_insert.cc: Now we should call open_and_lock_tables() even if table list is empty - to cache stored routines used by query and open and lock tables required for their execution. sql/sql_prepare.cc: Now we should call open_and_lock_tables() even if table list is empty - to cache stored routines used by query and open and lock tables required for their execution. Thus we have to move most of functionality from select_like_statement_test() to separate function to be able to reuse it for multi-update processing (for which tables are open and locked in mysql_multi_update_prepare() call).
-
- 05 Mar, 2005 1 commit
-
-
unknown authored
Improved handling of situations when we encounter error during CREATE PROCEDURE (FUNCTION/TRIGGER/...) and bail out of yyparse() without restoring proper THD::lex. sql/sp.cc: We do not need to call sp_head::restore_lex() explicitly to restore right value of THD::lex in case when we have encountered error during parsing. Now we do this in sp_head::~sp_head() instead. sql/sp_head.cc: sp_head::destroy(): Fixed cleaning up of stack of auxilary LEXes. We also restore right value of THD::lex during this process now. sql/sql_parse.cc: We do not need to call sp_head::restore_lex() explicitly to restore right value of THD::lex in case when we have encountered error during parsing. Now we do this in sp_head::~sp_head() instead. sql/sql_prepare.cc: We do not need to call sp_head::restore_lex() explicitly to restore right value of THD::lex in case when we have encountered error during parsing. Now we do this in sp_head::~sp_head() instead. sql/sql_trigger.cc: We do not need to call sp_head::restore_lex() explicitly to restore right value of THD::lex in case when we have encountered error during parsing. Now we do this in sp_head::~sp_head() instead.
-