There were two problems: RESET QUERY CACHE took a long time to complete
and other threads were blocked during this time.
The patch does three things:
1 fixes a bug with improper use of test-lock-test_again technique.
AKA Double-Checked Locking is applicable here only in few places.
2 Somewhat improves performance of RESET QUERY CACHE.
Do my_hash_reset() instead of deleting elements one by one. Note
however that the slowdown also happens when inserting into sorted
list of free blocks, should be rewritten using balanced tree.
3 Makes RESET QUERY CACHE non-blocking.
The patch adjusts the locking protocol of the query cache in the
following way: it introduces a flag flush_in_progress, which is
set when Query_cache::flush_cache() is in progress. This call
sets the flag on enter, and then releases the lock. Every other
call is able to acquire the lock, but does nothing if
flush_in_progress is set (as if the query cache is disabled).
The only exception is the concurrent calls to
Query_cache::flush_cache(), that are blocked until the flush is
over. When leaving Query_cache::flush_cache(), the lock is
acquired and the flag is reset, and one thread waiting on
Query_cache::flush_cache() (if any) is notified that it may
proceed.
include/mysql_com.h:
Add comment for NET::query_cache_query.
sql/net_serv.cc:
Use query_cache_init_query() for initialization of
NET::query_cache_query if query cache is used.
Do not access net->query_cache_query without a lock.
sql/sql_cache.cc:
Fix bug with accessing query_cache_size, Query_cache_query::wri and
thd->net.query_cache_query before acquiring the lock---leave
double-check locking only in safe places.
Wherever we check that cache is usable (query_cache_size > 0) we now
also check that flush_in_progress is false, i.e. we are not in the
middle of cache flush.
Add Query_cache::not_in_flush_or_wait() method and use it in
Query_cache::flush_cache(), so that threads doing cache flush will
wait it to finish, while other threads will bypass the cache as if
it is disabled.
Extract Query_cache::free_query_internal() from Query_cache::free_query(),
which does not removes elements from the hash, and use it together with
my_hash_reset() in Query_cache::flush_cache().
sql/sql_cache.h:
Add declarations for new members and methods.
Make is_cacheable() a static method.
Add query_cache_init_query() function.
sql/sql_class.cc:
Use query_cache_init_query() for initialization of
NET::query_cache_query.
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-main
VC++Files/sql/mysqld.vcproj:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/warnings.result:
Auto merged
mysql-test/t/warnings-master.opt:
Auto merged
mysql-test/t/warnings.test:
Auto merged
sql/handler.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
"real" table fails in JOINs".
This is a regression caused by the fix for Bug 18444.
This fix removed the assignment of empty_c_string to table->db performed
in add_table_to_list, as neither me nor anyone else knew what it was
there for. Now we know it and it's covered with tests: the only case
when a table database name can be empty is when the table is a derived
table. The fix puts the assignment back but makes it a bit more explicit.
Additionally, finally drop sp.result.orig which was checked in by mistake.
BitKeeper/deleted/.del-sp.result.orig:
Delete: mysql-test/r/sp.result.orig
mysql-test/r/derived.result:
Updated result file.
mysql-test/r/sp.result:
Test results fixed (Bug#21002)
mysql-test/t/derived.test:
New error return for the case when MULTI-DELETE tries to delete from
a derived table: now derived tables belong to their own db (""), and
MUTLI-DELETE can't find the correspondent table for it in the
DELETE list, as it can't resolve tables in different dbs by alias
(See Bug#21148 for details)
mysql-test/t/sp.test:
Add a test case for Bug#21002 "Derived table not selecting from a "real"
table fails in JOINs"
sql/sp.cc:
Make empty_c_string globally accessible.
sql/sql_class.cc:
Add empty_c_string definition.
sql/sql_class.h:
Add a comment for the constructor of Table_ident which is
used for derived tables. Make sure this constructor also initializes
the database name, not only the table name.
sql/sql_parse.cc:
Don't call check_db_name for empty database.
Currently the only case when a table database name can be empty
is when the table is a derived table.
Report the right error if the database name is wrong (ER_WRONG_DB_NAME,
not ER_WRONG_TABLE_NAME).
into moonbone.local:/work/tmp_merge-5.0-opt-mysql
mysql-test/r/rpl_insert_id.result:
Auto merged
mysql-test/t/rpl_insert_id.test:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_select.cc:
Auto merged
into macbook.gmz:/Users/kgeorge/mysql/work/B14553-5.0-opt
mysql-test/r/odbc.result:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/rpl_insert_id.result:
merge the test at the end of 4.1 test
mysql-test/t/rpl_insert_id.test:
merge the test at the end of 4.1 test
sql/sql_class.cc:
merged
sql/sql_class.h:
merged
To make MySQL compatible with some ODBC applications, you can find
the AUTO_INCREMENT value for the last inserted row with the following query:
SELECT * FROM tbl_name WHERE auto_col IS NULL.
This is done with a special code that replaces 'auto_col IS NULL' with
'auto_col = LAST_INSERT_ID'.
However this also resets the LAST_INSERT_ID to 0 as it uses it for a flag
so as to ensure that only the first SELECT ... WHERE auto_col IS NULL
after an INSERT has this special behaviour.
In order to avoid resetting the LAST_INSERT_ID a special flag is introduced
in the THD class. This flag is used to restrict the second and subsequent
SELECTs instead of LAST_INSERT_ID.
mysql-test/r/odbc.result:
test suite for the bug
mysql-test/r/rpl_insert_id.result:
test for the fix in replication
mysql-test/t/odbc.test:
test suite for the bug
mysql-test/t/rpl_insert_id.test:
test for the fix in replication
sql/sql_class.cc:
initialize the flag
sql/sql_class.h:
flag's declaration and set code when setting the last_insert_id
sql/sql_select.cc:
the special flag is used instead of last_insert_id
into bodhi.local:/opt/local/work/mysql-5.0-runtime-merge-41
myisam/mi_create.c:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/t/myisam.test:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_trigger.cc:
Auto merged
support-files/mysql.spec.sh:
Auto merged
mysql-test/r/federated.result:
Manual merge.
mysql-test/t/federated.test:
Manual merge.
into bodhi.local:/opt/local/work/mysql-5.0-runtime-merge-41
BitKeeper/etc/ignore:
auto-union
libmysqld/Makefile.am:
Auto merged
myisam/mi_create.c:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
sql/Makefile.am:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sql_class.h:
Auto merged
support-files/mysql.spec.sh:
Auto merged
mysql-test/r/myisam.result:
Manual merge.
mysql-test/t/myisam.test:
Manual merge.
sql/set_var.cc:
Manual merge.
sql/set_var.h:
Manual merge.
sql/sql_cache.cc:
Manual merge.
sql/sql_class.cc:
Manual merge.
into chilla.local:/home/mydev/mysql-5.0-ateam
libmysqld/lib_sql.cc:
Auto merged
libmysqld/libmysqld.c:
Auto merged
myisam/mi_check.c:
Auto merged
myisam/mi_create.c:
Auto merged
myisam/mi_dynrec.c:
Auto merged
myisam/mi_key.c:
Auto merged
mysql-test/r/func_sapdb.result:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/gis-rtree.result:
Auto merged
mysql-test/r/gis.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/r/symlink.result:
Auto merged
mysql-test/t/func_sapdb.test:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/gis-rtree.test:
Auto merged
mysql-test/t/gis.test:
Auto merged
mysql-test/t/key.test:
Auto merged
mysql-test/t/myisam.test:
Auto merged
scripts/make_binary_distribution.sh:
Auto merged
sql/field.cc:
Auto merged
sql/item_geofunc.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/opt_sum.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql-common/client.c:
Auto merged
sql/table.cc:
Auto merged
support-files/mysql.spec.sh:
Auto merged
mysql-test/r/ctype_utf8.result:
Manual merge
mysql-test/r/key.result:
Manual merge
mysql-test/t/ctype_utf8.test:
Manual merge
into mysql.com:/home/mydev/mysql-5.0-ateam
libmysqld/libmysqld.c:
Auto merged
myisam/mi_rkey.c:
Auto merged
mysql-test/r/func_sapdb.result:
Auto merged
mysql-test/r/symlink.result:
Auto merged
mysql-test/t/func_sapdb.test:
Auto merged
scripts/make_binary_distribution.sh:
Auto merged
sql/item_geofunc.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
libmysqld/lib_sql.cc:
Manual merge
mysql-test/r/func_time.result:
Manual merge
mysql-test/r/gis.result:
Manual merge
mysql-test/t/func_time.test:
Manual merge
mysql-test/t/gis.test:
Manual merge
sql-common/client.c:
Manual merge
run at startup"
The server returned an error when trying to execute init-file with a
stored procedure that could return multiple result sets to the client.
A stored procedure can return multiple result sets if it contains
PREPARE, SELECT, SHOW and similar statements.
The fix is to set client_capabilites|=CLIENT_MULTI_RESULTS in
sql_parse.cc:handle_bootstrap(). There is no "client" really, so
nothing is ever sent. This makes init-file feature behave consistently:
the prepared statements that can be called directly in the init-file
can be used in a stored procedure too.
Re-committed the patch originally submitted by Per-Erik after review.
mysql-test/Makefile.am:
Fix re-make without make clean.
mysql-test/r/init_connect.result:
Updated results (a test case for Bug#17843)
mysql-test/r/init_file.result:
Updated results (a test case for Bug#17843)
mysql-test/std_data/init_file.dat:
Add test coverage for new features added in 5.0. Note, that what can
be done in init_file is very limited as it does not support any other
delimiter except ';' -- only "one liners" and no multiple statement
procedures. Also, this is executed with a dummy user "boot@", which
calls for the use of DEFINER clause.
mysql-test/t/init_connect.test:
Add test coverage for new features added in 5.0.
mysql-test/t/init_file.test:
Add test coverage for new features added in 5.0 --
stored routines, views, triggers. The actual tests are in
std_data/init_file.dat, here we just check the results and clean up.
sql/sql_class.cc:
Initialize Security_context::priv_host to an empty string:
when executing an init-file, sql_parse.cc:get_default_definer()
will use this for the value of the definer if it's not set in the query.
sql/sql_parse.cc:
Set CLIENT_MULTI_RESULTS in handle_bootstrap(), to make prepared
statements work in stored procedures called from init-file.
into mysql.com:/home/mydev/mysql-4.1-bug14400
myisam/mi_rkey.c:
Bug#14400 - Query joins wrong rows from table which is subject of "concurrent insert"
Manual merge
sql/sql_class.cc:
Bug#14400 - Query joins wrong rows from table which is subject of "concurrent insert"
Manual merge
(implemented by by Josh Chamas)
libmysqld/Makefile.am:
Adding new source file
mysql-test/r/date_formats.result:
Adding test case
mysql-test/t/date_formats.test:
Adding test case
sql/Makefile.am:
Adding new source file
BitKeeper/etc/ignore:
Added libmysqld/sql_locale.cc to the ignore list
sql/item_timefunc.cc:
Using current locale data, instead of hard coded English names.
sql/mysql_priv.h:
Adding new type MY_LOCALE, and declaring new global variables.
sql/set_var.cc:
Adding "lc_time_names" system variable.
sql/set_var.h:
Adding "lc_time_names" system variable.
sql/sql_cache.cc:
Adding lc_time_names as a query cache flag.
sql/sql_class.cc:
Setting default locale to en_US
sql/sql_class.h:
Adding locale variable into system_variables.
sql/sql_locale.cc:
Adding new file with locale data for various languages
It was possible that fetching a record by an exact key value
(including the record pointer) could return a record with a
different key value. This happened only if a concurrent insert
added a record with the searched key value after the fetching
statement locked the table for read.
The search succeded on the key value, but the record was
rejected as it was past the file length that was remembered
at start of the fetching statement. With other words it was
rejected as being a concurrently inserted record.
The action to recover from this problem was to fetch the
record that is pointed at by the next key of the index.
This was repeated until a record below the file length was
found.
I do now avoid this loop if an exact match was searched.
If this match is beyond the file length, it is now treated
as "key not found". There cannot be another key with the
same record pointer.
myisam/mi_rkey.c:
Bug#14400 - Query joins wrong rows from table which is subject of "concurrent insert"
Added a check for exact key match before searching for
the next key that was not concurrently inserted. If an
exact key match finds a concurrently inserted row, this
must be treated as "key not found".
sql/sql_class.cc:
Bug#14400 - Query joins wrong rows from table which is subject of "concurrent insert"
Fixed some DBUG_ENTER strings.
Stored procedure execution sometimes placed the address of auto variables
in the list of Item changes to undo in THD::rollback_item_tree_changes().
This could cause stack corruption.
sql/sp_head.cc:
Avoid storing address of auto variables in global rollback list, to
prevent stack memory corruption.
sql/sp_head.h:
Avoid storing address of auto variables in global rollback list, to
prevent stack memory corruption.
sql/sp_rcontext.cc:
Avoid storing address of auto variables in global rollback list, to
prevent stack memory corruption.
sql/sp_rcontext.h:
Avoid storing address of auto variables in global rollback list, to
prevent stack memory corruption.
sql/sql_class.cc:
Avoid storing address of auto variables in global rollback list, to
prevent stack memory corruption.
Do not reset value of LAST_INSERT_ID() in sub-statement.
mysql-test/r/rpl_insert_id.result:
Add result for bug#15728.
mysql-test/r/sp.result:
Add result for bug#15728.
mysql-test/t/rpl_insert_id.test:
Add test case for bug#15728.
mysql-test/t/sp.test:
Add test case for bug#15728.
sql/sql_class.cc:
Do not reset value of LAST_INSERT_ID() in sub-statement.
limit.
mysql-test/r/ps.result:
Post-merge fixes.
mysql-test/t/ps.test:
Post-merge fixes.
sql/share/errmsg.txt:
Add a new error message for max_prepared_stmt_count limit,
we can do it in 5.0
sql/sql_class.cc:
Post-merge fixes.
sql/sql_class.h:
Post-merge fixes.
sql/sql_prepare.cc:
Post-merge fixes.
innobase_query_caching_of_table_permitted()".
Applied the patch due to Heikki Tuuri.
Also removed superfluous #ifdefs.
sql/sql_cache.cc:
Applied the patch due to Heikki Tuuri.
Query_cache::store_query(): Make InnoDB to release the adaptive
hash index latch before MySQL acquires the query cache mutex.
sql/sql_class.cc:
Removing superfluous #ifdefs (suggested by Sanja, also discussed with Serg).
sql/sql_cursor.cc:
Removing superfluous #ifdefs (suggested by Sanja, also discussed with Serg).
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume
100MB of RAM. Once this limit has been reached, the server will
refuse to prepare a new statement and return ER_UNKNOWN_ERROR
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared
statements is now available through a global read-only variable
@@prepared_stmt_count.
mysql-test/r/ps.result:
Test results fixed (a test case for Bug#16365)
mysql-test/t/ps.test:
A test case for Bug#16365 "Prepared Statements: DoS with too many
open statements". Also fix statement leaks in other tests.
sql/mysql_priv.h:
Add declarations for new global variables.
sql/mysqld.cc:
Add definitions of max_prepared_stmt_count, prepared_stmt_count.
sql/set_var.cc:
Implement support for @@prepared_stmt_count and
@@max_prepared_stmt_count. Currently these variables are queried
without acquiring LOCK_prepared_stmt_count due to limitations of
the set_var/sys_var class design. Updates are, however, protected
with a lock.
sql/set_var.h:
New declarations to add support for @@max_prepared_stmt_count.
Implement a new class, where the lock to be used when updating
a variable is a parameter.
sql/sql_class.cc:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_class.h:
Add accounting of the total number of prepared statements in the
server to the methods of Statement_map.
sql/sql_prepare.cc:
Statement_map::insert will now send a message in case of an
error.
(Needed for "list of pushes" web page and autopush)
include/mysql.h:
Fix to embedded server to be able to run tests on it
libmysql/libmysql.c:
Fix to embedded server to be able to run tests on it
libmysqld/emb_qcache.cc:
Fix to embedded server to be able to run tests on it
libmysqld/embedded_priv.h:
Fix to embedded server to be able to run tests on it
libmysqld/lib_sql.cc:
Fix to embedded server to be able to run tests on it
libmysqld/libmysqld.c:
Fix to embedded server to be able to run tests on it
mysql-test/mysql-test-run.sh:
Fix to embedded server to be able to run tests on it
mysql-test/r/binlog.result:
Updated test for embedded server
mysql-test/r/ctype_cp932.result:
Updated test for embedded server
mysql-test/r/innodb.result:
Updated test for embedded server
mysql-test/r/mysqltest.result:
Updated test for embedded server
mysql-test/r/query_cache.result:
Updated test for embedded server
mysql-test/r/query_cache_notembedded.result:
Updated test for embedded server
mysql-test/r/sp-error.result:
Updated test for embedded server
mysql-test/r/sp.result:
Updated test for embedded server
mysql-test/r/subselect.result:
Updated test for embedded server
mysql-test/r/view.result:
Updated test for embedded server
mysql-test/r/view_grant.result:
Updated test for embedded server
mysql-test/t/backup.test:
Updated test for embedded server
mysql-test/t/binlog.test:
Updated test for embedded server
mysql-test/t/blackhole.test:
Updated test for embedded server
mysql-test/t/compress.test:
Updated test for embedded server
mysql-test/t/ctype_cp932.test:
Updated test for embedded server
mysql-test/t/delayed.test:
Updated test for embedded server
mysql-test/t/handler.test:
Updated test for embedded server
mysql-test/t/innodb.test:
Updated test for embedded server
mysql-test/t/mysql.test:
Updated test for embedded server
mysql-test/t/mysql_client_test.test:
Updated test for embedded server
mysql-test/t/mysqltest.test:
Updated test for embedded server
mysql-test/t/query_cache.test:
Updated test for embedded server
mysql-test/t/query_cache_notembedded.test:
Updated test for embedded server
mysql-test/t/read_only.test:
Updated test for embedded server
mysql-test/t/skip_grants.test:
Updated test for embedded server
mysql-test/t/sp-destruct.test:
Updated test for embedded server
mysql-test/t/sp-error.test:
Updated test for embedded server
mysql-test/t/sp-threads.test:
Updated test for embedded server
mysql-test/t/sp.test:
Updated test for embedded server
mysql-test/t/subselect.test:
Updated test for embedded server
mysql-test/t/temp_table.test:
Updated test for embedded server
mysql-test/t/view.test:
Updated test for embedded server
mysql-test/t/view_grant.test:
Updated test for embedded server
mysql-test/t/wait_timeout.test:
Updated test for embedded server
mysys/mf_dirname.c:
Review fix: Don't access data outside of array
mysys/my_bitmap.c:
Remove compiler warnings
scripts/mysql_fix_privilege_tables.sql:
Add flush privileges to .sql script so that one doesn't have to reboot mysqld when one runs the mysql_fix_privilege_script
sql-common/client.c:
Updated test for embedded server
sql/item.cc:
Remove DBUG_PRINT statement that can cause crashes when running with --debug
sql/mysqld.cc:
Fix to embedded server to be able to run tests on it
sql/protocol.cc:
Fix to embedded server to be able to run tests on it
(Trivial reconstruction of code)
sql/protocol.h:
Fix to embedded server to be able to run tests on it
sql/sql_base.cc:
Better comment
sql/sql_class.cc:
Fix to embedded server to be able to run tests on it
sql/sql_class.h:
Fix to embedded server to be able to run tests on it
sql/sql_cursor.cc:
Fix to embedded server to be able to run tests on it
sql/sql_parse.cc:
Fix to embedded server to be able to run tests on it
Don't crash for disabled commands when using embedded server
sql/sql_prepare.cc:
Fix to embedded server to be able to run tests on it
mysql-test/r/ctype_cp932_notembedded.result:
New BitKeeper file ``mysql-test/r/ctype_cp932_notembedded.result''
mysql-test/r/innodb_notembedded.result:
New BitKeeper file ``mysql-test/r/innodb_notembedded.result''
mysql-test/r/sp.result.orig:
New BitKeeper file ``mysql-test/r/sp.result.orig''
mysql-test/r/sp_notembedded.result:
New BitKeeper file ``mysql-test/r/sp_notembedded.result''
mysql-test/r/subselect_notembedded.result:
New BitKeeper file ``mysql-test/r/subselect_notembedded.result''
mysql-test/t/ctype_cp932_notembedded.test:
New BitKeeper file ``mysql-test/t/ctype_cp932_notembedded.test''
mysql-test/t/innodb_notembedded.test:
New BitKeeper file ``mysql-test/t/innodb_notembedded.test''
mysql-test/t/sp.test.orig:
New BitKeeper file ``mysql-test/t/sp.test.orig''
mysql-test/t/sp_notembedded.test:
New BitKeeper file ``mysql-test/t/sp_notembedded.test''
mysql-test/t/subselect_notembedded.test:
New BitKeeper file ``mysql-test/t/subselect_notembedded.test''
Backporting character_set_filesystem from 5.0 to 5.1.
sql/mysqld.cc:
Backporting character_set_filesystem from 5.0 to 5.1.
sql/set_var.cc:
Backporting character_set_filesystem from 5.0 to 5.1.
sql/set_var.h:
Backporting character_set_filesystem from 5.0 to 5.1.
sql/sql_class.cc:
Backporting character_set_filesystem from 5.0 to 5.1.
sql/sql_class.h:
Backporting character_set_filesystem from 5.0 to 5.1.
sql/sql_yacc.yy:
Backporting character_set_filesystem from 5.0 to 5.1.
mysql-test/t/variables.test:
Backporting character_set_filesystem from 5.0 to 5.1.
mysql-test/r/variables.result:
Backporting character_set_filesystem from 5.0 to 5.1.
mysql-test/r/kill.result:
BUG#14851 test
mysql-test/t/kill.test:
BUG#14851 test
sql/sql_class.cc:
Debug prints are added.
sql/sql_select.cc:
Allocation of tmp_join fixed to involve constructor (it is not related to the bug directly but might cause other problems).
Excluded posibility of tmp_table_param.copy_field double deletion (BUG#14851).
sql/sql_select.h:
JOINs constructor added, initialization of them fixed (it is not related to the bug directly but might cause other problems).
sql/sql_class.cc:
Improved documentation on add_to_status().
sql/sql_parse.cc:
Changed refresh status to take thd as argument to avoid current_thd.
Removed add_to_status away from loop, as it is not necessary for each
variable, only required for each thread. In this case only the current
thread.
mysql-test/r/ndb_basic.result:
Auto merged
mysql-test/r/ndb_multi.result:
Auto merged
mysql-test/t/ndb_basic.test:
Auto merged
mysql-test/t/ndb_multi.test:
Auto merged
sql/sql_class.cc:
Auto merged
and bug #15668: Test 'sp-error' crashes server on Mac OS X.
mysql-test/r/rpl000001.result:
Fix for bug #15623: Test case rpl000001 and rpl_error_ignored_table failure on MacOSX
and bug #15668: Test 'sp-error' crashes server on Mac OS X.
- accept 2013 error as well.
mysql-test/t/flush_read_lock_kill.test:
Fix for bug #15623: Test case rpl000001 and rpl_error_ignored_table failure on MacOSX
and bug #15668: Test 'sp-error' crashes server on Mac OS X.
- accept 2013 error as well.
mysql-test/t/rpl000001.test:
Fix for bug #15623: Test case rpl000001 and rpl_error_ignored_table failure on MacOSX
and bug #15668: Test 'sp-error' crashes server on Mac OS X.
- accept 2013 error as well.
mysql-test/t/rpl_error_ignored_table.test:
Fix for bug #15623: Test case rpl000001 and rpl_error_ignored_table failure on MacOSX
and bug #15668: Test 'sp-error' crashes server on Mac OS X.
- accept 2013 error as well.
sql/sql_class.cc:
Fix for bug #15623: Test case rpl000001 and rpl_error_ignored_table failure on MacOSX
and bug #15668: Test 'sp-error' crashes server on Mac OS X.
- don't call the close_active_vio() in case of KILL_QUERY.
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
according to the standard.
The idea is to use Field-classes to implement stored routines
variables. Also, we should provide facade to Item-hierarchy
by Item_field class (it is necessary, since SRVs take part
in expressions).
The patch fixes the following bugs:
- BUG#8702: Stored Procedures: No Error/Warning shown for inappropriate data
type matching;
- BUG#8768: Functions: For any unsigned data type, -ve values can be passed
and returned;
- BUG#8769: Functions: For Int datatypes, out of range values can be passed
and returned;
- BUG#9078: STORED PROCDURE: Decimal digits are not displayed when we use
DECIMAL datatype;
- BUG#9572: Stored procedures: variable type declarations ignored;
- BUG#12903: upper function does not work inside a function;
- BUG#13705: parameters to stored procedures are not verified;
- BUG#13808: ENUM type stored procedure parameter accepts non-enumerated
data;
- BUG#13909: Varchar Stored Procedure Parameter always BINARY string (ignores
CHARACTER SET);
- BUG#14161: Stored procedure cannot retrieve bigint unsigned;
- BUG#14188: BINARY variables have no 0x00 padding;
- BUG#15148: Stored procedure variables accept non-scalar values;
mysql-test/r/ctype_ujis.result:
Explicitly specify correct charset.
mysql-test/r/schema.result:
Drop our test database to not affect this test if some test
left it cause of failure.
mysql-test/r/show_check.result:
Drop our test database to not affect this test if some test
left it cause of failure.
mysql-test/r/skip_name_resolve.result:
Ignore columns with unpredictable values.
mysql-test/r/sp-big.result:
Add cleanup statement.
mysql-test/r/sp-dynamic.result:
Add cleanup statements.
mysql-test/r/sp.result:
Update result file.
mysql-test/r/sum_distinct-big.result:
Update result file.
mysql-test/r/type_newdecimal-big.result:
Update result file.
mysql-test/t/ctype_ujis.test:
Explicitly specify correct charset.
mysql-test/t/schema.test:
Drop our test database to not affect this test if some test
left it cause of failure.
mysql-test/t/show_check.test:
Drop our test database to not affect this test if some test
left it cause of failure.
mysql-test/t/skip_name_resolve.test:
Ignore columns with unpredictable values.
mysql-test/t/sp-big.test:
Add cleanup statement.
mysql-test/t/sp-dynamic.test:
Add cleanup statements.
mysql-test/t/sp.test:
Non-scalar values prohibited for assignment to SP-vars;
polishing.
mysql-test/t/type_newdecimal-big.test:
Update type specification so that the variables
can contain the large values used in the test.
sql/field.cc:
Extract create_field::init() to initialize an existing
instance of create_field from new_create_field().
sql/field.h:
Extract create_field::init() to initialize an existing
instance of create_field from new_create_field().
sql/item.cc:
- Introduce a new class: Item_sp_variable -- a base class
of stored-routine-variables classes;
- Introduce Item_case_expr -- an Item, which is used to access
to the expression of CASE statement;
sql/item.h:
- Introduce a new class: Item_sp_variable -- a base class
of stored-routine-variables classes;
- Introduce Item_case_expr -- an Item, which is used to access
to the expression of CASE statement;
sql/item_func.cc:
Pass the Field (instead of Item) for the return value of
a function to the function execution routine.
sql/item_func.h:
Pass the Field (instead of Item) for the return value of
a function to the function execution routine.
sql/mysql_priv.h:
Move create_virtual_tmp_table() out of sql_select.h.
sql/sp.cc:
Use create_result_field() instead of make_field().
sql/sp_head.cc:
- Add a function to map enum_field_types to Item::Type;
- Add sp_instr_push_case_expr instruction -- an instruction
to push CASE expression into the active running context;
- Add sp_instr_pop_case_expr instruction -- an instruction
to pop CASE expression from the active running context;
- Adapt the SP-execution code to using Fields instead of Items
for SP-vars;
- Use create_field structure for field description instead of
a set of members.
sql/sp_head.h:
- Add a function to map enum_field_types to Item::Type;
- Add sp_instr_push_case_expr instruction -- an instruction
to push CASE expression into the active running context;
- Add sp_instr_pop_case_expr instruction -- an instruction
to pop CASE expression from the active running context;
- Adapt the SP-execution code to using Fields instead of Items
for SP-vars;
- Use create_field structure for field description instead of
a set of members.
sql/sp_pcontext.cc:
- Change rules to assign an index of SP-variable: use
transparent index;
- Add an operation to retrieve a list of defined SP-vars
from the processing context recursively.
sql/sp_pcontext.h:
- Change rules to assign an index of SP-variable: use
transparent index;
- Add an operation to retrieve a list of defined SP-vars
from the processing context recursively.
sql/sp_rcontext.cc:
- Change rules to assign an index of SP-variable: use
transparent index;
- Use a tmp virtual table to store SP-vars instead of Items;
- Provide operations to work with CASE expresion.
sql/sp_rcontext.h:
- Change rules to assign an index of SP-variable: use
transparent index;
- Use a tmp virtual table to store SP-vars instead of Items;
- Provide operations to work with CASE expresion.
sql/sql_class.cc:
- Reflect Item_splocal ctor changes;
- Item_splocal::get_offset() has been renamed to get_var_idx().
sql/sql_class.h:
Polishing.
sql/sql_parse.cc:
Extract create_field::init() to initialize an existing
instance of create_field from new_create_field().
sql/sql_select.cc:
Take care of BLOB columns in create_virtual_tmp_table().
sql/sql_select.h:
Move create_virtual_tmp_table() out of sql_select.h.
sql/sql_trigger.cc:
Use boolean constants for boolean type instead of numerical ones.
sql/sql_yacc.yy:
Provide an instance of create_field for each SP-var.
mysql-test/include/sp-vars.inc:
The definitions of common-procedures, which are created
under different circumstances.
mysql-test/r/sp-vars.result:
Result file for the SP-vars test.
mysql-test/sp-vars.test:
A new test for checking SP-vars functionality.
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_sum.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/sp_head.cc:
Fix for bug #14304: auto_increment field incorrect set from within stored procedure (insert select).
- call thd->cleanup_after_query() to clean next_insert_id.
sql/sql_class.cc:
Fix for bug #14304: auto_increment field incorrect set from within stored procedure (insert select).
- save/restore clear_next_insert_id
sql/sql_class.h:
Fix for bug #14304: auto_increment field incorrect set from within stored procedure (insert select).
- clear_next_insert_id added
into mysql.com:/home/timka/mysql/src/5.0-bug-14920
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/group_min_max.result:
Manually merged test cases.
mysql-test/t/group_min_max.test:
Manually merged test cases.
The cause of the bug was the use of end_write_group instead of end_write
in the case when ORDER BY required a temporary table, which didn't take
into account the fact that loose index scan already computes the result
of MIN/MAX aggregate functions (and performs grouping).
The solution is to call end_write instead of end_write_group and to add
the MIN/MAX functions to the list of regular functions so that their
values are inserted into the temporary table.
mysql-test/r/group_min_max.result:
Test for BUG#14920
mysql-test/t/group_min_max.test:
Test for BUG#14920
sql/sql_class.cc:
Added new member to TMP_TABLE_PARAM.
sql/sql_class.h:
Added new member to TMP_TABLE_PARAM.
sql/sql_select.cc:
Enable result rows generated by loose index scan being written into
a temporary table. The change is necessary because loose index
scan already computes the result of GROUP BY and the MIN/MAX aggregate
functions. This is realized by three changes:
- create_tmp_table allocates space for aggregate functions in the
list of regular functions,
- use end_write instead of end_write group,
- copy the pointers to the MIN/MAX aggregate functions to the list
of regular functions TMP_TABLE_PARAM::items_to_copy.
sql/sql_select.h:
New parameter to create_tmp_table.
mysql-test/t/sp.test:
Tidying up after merge.
sql/mysqld.cc:
Make sure we have thd->thread_stack set before calling store_globals().
(And fixed compiler warning.)
sql/sql_class.cc:
Init THD::tread_stack in constructor.
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
sql/mysql_priv.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
check_stack_overrun().
sql/slave.cc:
Move initialization of THD::thread_stack before THD::store_globals()
sql/sql_acl.cc:
Initialize THD::thread_stack in artificial THDs used
to load gratns subsystem.
sql/sql_class.cc:
Add an assert that THD::thread_stack is assigned.
sql/sql_insert.cc:
Add initialization of THD::thread_stack (delayed insert
thread).
sql/sql_parse.cc:
Move initialization of THD::thread_stack before
THD::store_globals().
sql/sql_udf.cc:
Add initialization for THD::thread_stack (an artificial
THD used to initialize UDF subsystem).
sql/tztime.cc:
Add initialization for THD::thread_stack (an artificial
THD used to initialize timezones).
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
into sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0
sql/item.h:
Auto merged
sql/protocol.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_trigger.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/sp.result:
merge
mysql-test/r/trigger.result:
merge
mysql-test/t/sp.test:
merge
mysql-test/t/trigger.test:
merge
sql/item.cc:
merge
sql/sp_rcontext.h:
merge
if inner routine has more local variables than outer one, and
one of its last variables was used as argument to NOT operator".
THD::spcont was non-0 when we were parsing stored routine/trigger
definition during execution of another stored routine. This confused
methods of Item_splocal and forced them use wrong runtime context.
Fix ensures that we always have THD::spcont equal to zero during
routine/trigger body parsing. This also allows to avoid problems
with errors which occur during parsing and SQL exception handlers.
mysql-test/r/sp.result:
Test suite for bug#13549.
mysql-test/r/trigger.result:
Test suite for bug#13549.
mysql-test/t/sp.test:
Test suite for bug#13549.
mysql-test/t/trigger.test:
Test suite for bug#13549.
sql/item.cc:
Protection against using wrong context by SP local variable.
sql/item.h:
Protection against using wrong context by SP local variable.
sql/protocol.cc:
An incorrect macro name fixed.
sql/protocol.h:
An incorrect macro name fixed.
sql/sp.cc:
Do not allow SP which we are parsing to use other SP
context (BUG#13549).
sql/sp_head.cc:
Protection against using wrong context by SP local variable.
sql/sp_rcontext.h:
Protection against using wrong context by SP local variable.
sql/sql_cache.h:
An incorrect macro name fixed.
sql/sql_class.cc:
Protection against using wrong context by SP local variable.
sql/sql_class.h:
Protection against using wrong context by SP local variable.
sql/sql_trigger.cc:
Do not allow Trigger which we are parsing to use
other SP context (BUG#13549).
sql/sql_yacc.yy:
Protection against using wrong context by SP local variable.
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