into dl145s.mysql.com:/data0/bk/team_tree_merge/MERGE/mysql-5.0-opt
mysql-test/r/ps.result:
Auto merged
mysql-test/t/ps.test:
Auto merged
sql/item_sum.cc:
Auto merged
prepared statement and subquery.
When a field of a view from an outer select is resolved the find_field_in_view
function creates an Item_direct_view_ref object that references the
corresponding view underlying field. After that the view_ref is marked
as a dependent one. While resolving view underlying field it also get
marked as a dependent one due to current_select still points to the subselect.
Marking the view underlying field is wrong and lead to attaching conditions
to a wrong table and thus to the wrong result of the whole statement.
Now mark_select_range_as_dependent() function isn't called for fields from a
view underlying table.
sql/sql_base.cc:
Bug#20327: Marking of a wrong field leads to a wrong result on select with view, prepared statement and subquery.
Now mark_select_range_as_dependent() function isn't called for fields from a
view underlying table.
mysql-test/r/ps.result:
Added a test case for bug#20327: Marking of a wrong field leads to a wrong result on select with view, prepared statement and subquery.
mysql-test/t/ps.test:
Added a test case for bug#20327: Marking of a wrong field leads to a wrong result on select with view,prepared statement and subquery.
mysql-test/r/ps.result:
Fix after manual merge: update for different error message.
mysql-test/t/ps.test:
Fix after manual merge: use right error codes.
Make Prepared_stmt_count a global status variable, accessible via
SHOW STATUS LIKE 'Prepared_stmt_count';. Documentation should be
updated.
mysql-test/r/ps.result:
Update result for bug#16365: Prepared Statements: DoS with too many
open statements, according to bug#23159: prepared_stmt_count should be
status variable.
mysql-test/t/ps.test:
Update test case for bug#16365: Prepared Statements: DoS with too many
open statements, according to bug#23159: prepared_stmt_count should be
status variable.
sql/mysqld.cc:
Add Prepared_stmt_count as global status variable.
sql/set_var.cc:
Remove prepared_stmt_count as system variable.
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
mysql-test/t/im_daemon_life_cycle.imtest:
Auto merged
mysql-test/t/innodb_mysql.test:
Auto merged
mysql-test/t/sp-error.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
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_table.cc:
Auto merged
sql/sql_trigger.cc:
Auto merged
sql/sql_union.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/mysql-test-run.pl:
Manual merge.
mysql-test/r/ps.result:
Manual merge.
mysql-test/t/ps.test:
Manual merge.
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
configure.in:
Auto merged
mysql-test/t/ps.test:
Auto merged
sql/handler.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/table.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
myisam/sort.c:
Manual merge.
mysql-test/r/innodb_mysql.result:
Manual merge.
mysql-test/t/innodb_mysql.test:
Manual merge.
mysys/mf_iocache.c:
Manual merge.
When statement to be prepared contained CREATE PROCEDURE, CREATE FUNCTION
or CREATE TRIGGER statements with a syntax error in it, the preparation
would fail with syntax error message, but the memory could be corrupted.
The problem occurred because we switch memroot when parse stored
routine or trigger definitions, and on parse error we restored the
original memroot only after performing some memory operations. In more
detail:
- prepared statement would activate its own memory root to parse
the definition of the stored procedure.
- SP would reset this memory root with its own memory root to
parse SP statements
- a syntax error would happen
- prepared statement would restore the original memory root
- stored procedure would restore what it thinks was the original
memory root, but actually was the statement memory root.
That led to double free - in destruction of the statement and in
a next call to mysql_parse().
The solution is to restore memroot right after the failed parsing.
mysql-test/r/ps.result:
Add result for bug#21856: Prepared Statements: crash if bad create.
mysql-test/t/ps.test:
Add test case for bug#21856: Prepared Statements: crash if bad create.
sql/sql_parse.cc:
On parse error if thd->lex->sphead is set we have to free sp_head object
to restore statement memroot, if it was switched during parsing.
The change here is for safety, currently query_cache_abort() and
lex->unit.cleanup() calls do not use current memroot.
sql/sql_prepare.cc:
On parse error if thd->lex->sphead is set we have to free sp_head object
to restore statement memroot, if it was switched during parsing.
into siva.hindu.god:/usr/home/tim/m/bk/tmp/mrgOct16/50
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
mysql-test/r/ps.result:
Manual merge
mysql-test/t/ps.test:
Manual merge
Do not consider SHOW commands slow queries, just because they don't use proper indexes.
This bug fix is not needed in 5.1, and the code changes will be null merged. However, the test cases will be propogated up to 5.1.
mysql-test/t/show_check-master.opt:
Rename: BitKeeper/deleted/.del-show_check-master.opt -> mysql-test/t/show_check-master.opt
mysql-test/r/ps.result:
Add test case for bug 19764
mysql-test/r/show_check.result:
Add test case for bug 19764
mysql-test/r/union.result:
Adjust test case results based on bug #19764 changes
mysql-test/t/ps.test:
Add test case for bug 19764
mysql-test/t/show_check.test:
Add test case for bug 19764
sql/sql_parse.cc:
Do not log SHOW commands as slow queries just because they don't use indexes.
sql/sql_prepare.cc:
Save stmt_backup.lex->orig_sql_command for use in log_slow_statement()
mysql-test/t/ps-master.opt:
Add log-slow-queries and --log-queries-not-using indexes, to test bug #19764
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug21354
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_sum.cc:
Auto merged
mysql-test/r/ps.result:
Manual merge.
mysql-test/t/ps.test:
Manual merge.
statement.
The problem was that during statement re-execution if the result was
empty the old result could be returned for group functions.
The solution is to implement proper cleanup() method in group
functions.
mysql-test/r/ps.result:
Add result for bug#21354: (COUNT(*) = 1) not working in SELECT inside
prepared statement.
mysql-test/t/func_gconcat.test:
Add a comment that the test case is from bug#836.
mysql-test/t/ps.test:
Add test case for bug#21354: (COUNT(*) = 1) not working in SELECT inside
prepared statement.
sql/item_sum.cc:
Call clear() in Item_sum_count::cleanup().
sql/item_sum.h:
Add comments.
Add proper cleanup() methods.
Change Item_sum::no_rows_in_result() to call clear() instead of reset(),
as the latter also issues add(), and there is nothing to add when there
are no rows in result.
into neptunus.(none):/home/msvensson/mysql/mysql-4.1-maint
mysql-test/r/subselect.result:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
mysql-test/r/mysqltest.result:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
BitKeeper/deleted/.del-mtr_stress.pl:
Auto merged
mysql-test/r/ps_6bdb.result:
Auto merged
mysql-test/r/ps_7ndb.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
BitKeeper/deleted/.del-mtr_im.pl:
Delete: mysql-test/lib/mtr_im.pl
client/mysqltest.c:
Use remote
mysql-test/mysql-test-run.pl:
Use remote
mysql-test/lib/mtr_process.pl:
Use remote
into shellback.(none):/home/msvensson/mysql/same_tools/my50-same_tools
mysql-test/include/ps_query.inc:
Auto merged
mysql-test/r/check.result:
Auto merged
mysql-test/r/connect.result:
Auto merged
mysql-test/r/flush.result:
Auto merged
mysql-test/r/flush_block_commit.result:
Auto merged
mysql-test/r/func_misc.result:
Auto merged
mysql-test/r/lock_multi.result:
Auto merged
mysql-test/r/mix_innodb_myisam_binlog.result:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/r/ps_6bdb.result:
Auto merged
mysql-test/r/ps_7ndb.result:
Auto merged
mysql-test/r/rename.result:
Auto merged
mysql-test/r/rpl000001.result:
Auto merged
mysql-test/r/rpl_error_ignored_table.result:
Auto merged
mysql-test/r/rpl_master_pos_wait.result:
Auto merged
BitKeeper/deleted/.del-rpl000018.test:
Auto merged
BitKeeper/deleted/.del-rpl_heap.test:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/synchronization.result:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/ps_1general.test:
Auto merged
mysql-test/t/ps_grant.test:
Auto merged
mysql-test/t/rpl_flush_tables.test:
Auto merged
mysql-test/t/rpl_trunc_temp.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
BitKeeper/deleted/.del-show_msg80.inc:
Delete: mysql-test/include/show_msg80.inc
BitKeeper/deleted/.del-init_file.result:
Delete: mysql-test/r/init_file.result
BitKeeper/deleted/.del-mysql_client_test.result:
Delete: mysql-test/r/mysql_client_test.result
BitKeeper/deleted/.del-show_msg.inc:
Delete: mysql-test/include/show_msg.inc
client/Makefile.am:
Use local file
client/mysqltest.c:
Use backported version of mysqltest
mysql-test/r/mysqltest.result:
Use backported file
mysql-test/t/mysqltest.test:
Use backported version
mysql-test/r/type_blob.result:
Manual merge
mysql-test/t/connect.test:
Used local version
mysql-test/t/init_file.test:
Manual merge
mysql-test/t/mysql_client_test.test:
Manual merge
mysql-test/t/type_blob.test:
Manual merge
- ie. backport from 5.1
- also update testcase error dected by new version
mysql-test/include/show_msg.inc:
BitKeeper file /home/msvensson/mysql/same_tools/my41-same_tools/mysql-test/include/show_msg.inc
mysql-test/include/show_msg80.inc:
BitKeeper file /home/msvensson/mysql/same_tools/my41-same_tools/mysql-test/include/show_msg80.inc
BitKeeper/deleted/.del-rpl_chain_temp_table.test:
Delete: mysql-test/t/rpl_chain_temp_table.test
BitKeeper/deleted/.del-rpl_chain_temp_table.result:
Delete: mysql-test/r/rpl_chain_temp_table.result
BitKeeper/deleted/.del-rpl_failsafe.result:
Delete: mysql-test/r/rpl_failsafe.result
BitKeeper/deleted/.del-rpl_failsafe.test:
Delete: mysql-test/t/rpl_failsafe.test
BitKeeper/deleted/.del-rpl_heap.test:
Delete: mysql-test/t/rpl_heap.test
BitKeeper/deleted/.del-rpl_heap.result:
Delete: mysql-test/r/rpl_heap.result
BitKeeper/deleted/.del-rpl000018.result:
Delete: mysql-test/r/rpl000018.result
BitKeeper/deleted/.del-rpl000018.test:
Delete: mysql-test/t/rpl000018.test
client/Makefile.am:
Link mysqltest with mysys/my_copy.c
client/mysqltest.c:
Update mysqltest to latest version
mysql-test/include/have_multi_ndb.inc:
Remove old syntax "@filename" in favor of "--require filename"
mysql-test/include/master-slave.inc:
Remove old syntax "@filename" in favor of "--require filename"
mysql-test/include/ps_query.inc:
Remove the comment about no output now when it does.
mysql-test/r/check.result:
Update output from --send
mysql-test/r/connect.result:
Update result file for connect test after backport form 5.1
mysql-test/r/flush.result:
Update output from --send
mysql-test/r/flush_block_commit.result:
Update output from --send
mysql-test/r/func_misc.result:
Update output from --send
mysql-test/r/grant2.result:
Update output from --send
mysql-test/r/handler.result:
Update output from --send
mysql-test/r/kill.result:
Update output from --send
mysql-test/r/lock_multi.result:
Update output from --send
mysql-test/r/mix_innodb_myisam_binlog.result:
Update output from --send
mysql-test/r/mysqltest.result:
Update mysqltest.result after backport
mysql-test/r/ps_2myisam.result:
Update result as the output from query is now printed
mysql-test/r/ps_3innodb.result:
Update result as the output from query is now printed
mysql-test/r/ps_4heap.result:
Update result as the output from query is now printed
mysql-test/r/ps_5merge.result:
Update result as the output from query is now printed
mysql-test/r/ps_6bdb.result:
Update result as the output from query is now printed
mysql-test/r/ps_7ndb.result:
Update result as the output from query is now printed
mysql-test/r/rename.result:
Update output from --send
mysql-test/r/rpl000001.result:
Update output from --send
mysql-test/r/rpl_error_ignored_table.result:
Update output from --send
mysql-test/r/rpl_master_pos_wait.result:
Update output from --send
mysql-test/r/subselect.result:
Update result file after adding missing ;
mysql-test/r/synchronization.result:
Update output from --send
mysql-test/r/type_blob.result:
Update result file after adding missing ;
mysql-test/t/connect.test:
Backport test from 5.1
mysql-test/t/init_file.test:
Update test so something is printed
mysql-test/t/mysql_client_test.test:
Update test so result is sent to file and something is printed
mysql-test/t/mysqltest.test:
Backport latest mysqltest.test file
mysql-test/t/ps.test:
Move the --replace_column statement to just before the statetement it should replace
mysql-test/t/ps_1general.test:
Move the --replace_column statement to just before the statetement it should replace
mysql-test/t/ps_grant.test:
Remove the $DB, no other test uses it
mysql-test/t/rpl_flush_tables.test:
Fetch $SERVER_VERSION from the db server
mysql-test/t/rpl_trunc_temp.test:
Remove the selection of connection master after it's been disconnected already
mysql-test/t/subselect.test:
Add missing ;
mysql-test/t/type_blob.test:
Add missing ;
into mockturtle.local:/home/dlenev/src/mysql-5.0-rt-merge
mysql-test/r/ps.result:
Auto merged
mysql-test/t/ps.test:
Auto merged
sql/item.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_update.cc:
Auto merged
Re-execution of a parametrized prepared statement or a stored routine
with a SELECT that use LEFT JOIN with second table having only one row
could yield incorrect result.
The problem appeared only for left joins with second table having only
one row (aka const table) and equation conditions in ON or WHERE clauses
that depend on the argument passed. Once the condition was false for
second const table, a NULL row was created for it, and any field involved
got NULL-value flag, which then was never reset.
The cause of the problem was that Item_field::null_value could be set
without being reset for re-execution. The solution is to reset
Item_field::null_value in Item_field::cleanup().
mysql-test/r/ps.result:
Add result for bug#21081: SELECT inside stored procedure returns wrong
results.
mysql-test/t/ps.test:
Add test case for bug#21081: SELECT inside stored procedure returns wrong
results.
sql/item.cc:
Reset Item_field::null_value flag for re-execution.
statement that uses an aggregating IN subquery with
HAVING clause.
A wrong order of the call of split_sum_func2 for the HAVING
clause of the subquery and the transformation for the
subquery resulted in the creation of a andor structure
that could not be restored at an execution of the prepared
statement.
mysql-test/r/ps.result:
Added a test cases for bug #22085.
mysql-test/t/ps.test:
Added a test cases for bug #22085.
Changes in an item tree done by optimizer weren't properly
registered and went unnoticed, which resulted in preliminary freeing
of used memory.
mysql-test/r/ps.result:
Add result for bug#21166: Prepared statement causes signal 11
on second execution.
mysql-test/t/ps.test:
Add test case for bug#21166: Prepared statement causes signal 11
on second execution.
sql/item.cc:
Move Item::transform() and Item_default_value::transform() from
item.h here and use THD::change_item_tree() instead of plain
assignment.
Change Item_field::set_no_const_sub() to be used with Item::walk()
instead of Item::transform().
sql/item.h:
Move definition of Item::transform() and Item_default_value::transform()
to item.cc.
Change Item::set_no_const_sub() to be used with Item::walk()
instead of Item::transform().
sql/item_cmpfunc.cc:
Use Item::walk() to execute Item::set_no_const_sub().
Use THD::change_item_tree() instead of plain assignment.
sql/item_func.cc:
Add assert and comment to Item_func::traverse_cond().
sql/item_row.cc:
Use THD::change_item_tree() instead of plain assignment.
sql/item_strfunc.cc:
Move Item_func_make_set::transform() from item_strfunc.h here and use
THD::change_item_tree() instead of plain assignment.
sql/item_strfunc.h:
Move definition of Item_func_make_set::transform() to item_strfunc.cc.
into bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
include/mysql.h:
Auto merged
include/sql_common.h:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/mysqldump.result:
Auto merged
mysql-test/t/udf.test:
Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/slave.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql-common/client.c:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.h:
Auto merged
mysql-test/r/ps.result:
Manual merge.
mysql-test/r/sp.result:
Manual merge.
mysql-test/t/ps.test:
Manual merge.
mysql-test/t/sp.test:
Manual merge.
sql/sql_prepare.cc:
Manual merge.
sql/table.cc:
Manual merge.
tests/mysql_client_test.c:
Manual merge.
client/mysql.cc:
Auto merged
client/sql_string.h:
Auto merged
configure.in:
Auto merged
myisam/mi_create.c:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_string.h:
Auto merged
sql/table.cc:
Auto merged
when dropping/creating tables"
mysql-test/r/ps.result:
A post-merge fix.
mysql-test/t/ps.test:
A post-merge fix: all 5.0 tests should go after 4.1 tests.
sql/sql_lex.cc:
auxilliary -> auxiliary
sql/sql_prepare.cc:
auxilliary -> auxiliary
sql/table.cc:
Update st_table_list::reinit_before_use in 5.0 to include 5.0-specific
cleanups.
sql/table.h:
st_table_list::reinit_before_use is public.
dropping/creating tables".
The bug could lead to a crash when multi-delete statements were
prepared and used with temporary tables.
The bug was caused by lack of clean-up of multi-delete tables before
re-execution of a prepared statement. In a statement like
DELETE t1 FROM t1, t2 WHERE ... the first table list (t1) is
moved to lex->auxilliary_table_list and excluded from lex->query_tables
or select_lex->tables. Thus it was unaccessible to reinit_stmt_before_use
and not cleaned up before re-execution of a prepared statement.
mysql-test/r/ps.result:
Updated test results (Bug#19399)
mysql-test/t/ps.test:
A test case for Bug#19399 "Stored Procedures 'Lost Connection' when
dropping/creating tables": test that multi-delete
tables are cleaned up properly before re-execution.
sql/sql_lex.cc:
Always initialize auxilliary_table_list when we initialize the lex:
this way we don't have to check that lex->sql_command equals to
SQLCOM_DELETE_MULTI whenever we need to access auxilliary_table_list.
In particular, in reinit_stmt_before_use we can simply check that
auxilliary_table_list is not NULL and clean it up if the check returns
a true value.
sql/sql_prepare.cc:
Move the one table clean-up functionality to a method of st_table_list.
Clean up auxiliary_table_list if it's not empty.
sql/table.cc:
Implement st_table_list::reinit_before_use().
sql/table.h:
Declare st_table_list::reinit_before_use().
Bug#19022 "Memory bug when switching db during trigger execution"
Bug#17199 "Problem when view calls function from another database."
Bug#18444 "Fully qualified stored function names don't work correctly in
SELECT statements"
Documentation note: this patch introduces a change in behaviour of prepared
statements.
This patch adds a few new invariants with regard to how THD::db should
be used. These invariants should be preserved in future:
- one should never refer to THD::db by pointer and always make a deep copy
(strmake, strdup)
- one should never compare two databases by pointer, but use strncmp or
my_strncasecmp
- TABLE_LIST object table->db should be always initialized in the parser or
by creator of the object.
For prepared statements it means that if the current database is changed
after a statement is prepared, the database that was current at prepare
remains active. This also means that you can not prepare a statement that
implicitly refers to the current database if the latter is not set.
This is not documented, and therefore needs documentation. This is NOT a
change in behavior for almost all SQL statements except:
- ALTER TABLE t1 RENAME t2
- OPTIMIZE TABLE t1
- ANALYZE TABLE t1
- TRUNCATE TABLE t1 --
until this patch t1 or t2 could be evaluated at the first execution of
prepared statement.
CURRENT_DATABASE() still works OK and is evaluated at every execution
of prepared statement.
Note, that in stored routines this is not an issue as the default
database is the database of the stored procedure and "use" statement
is prohibited in stored routines.
This patch makes obsolete the use of check_db_used (it was never used in the
old code too) and all other places that check for table->db and assign it
from THD::db if it's NULL, except the parser.
How this patch was created: THD::{db,db_length} were replaced with a
LEX_STRING, THD::db. All the places that refer to THD::{db,db_length} were
manually checked and:
- if the place uses thd->db by pointer, it was fixed to make a deep copy
- if a place compared two db pointers, it was fixed to compare them by value
(via strcmp/my_strcasecmp, whatever was approproate)
Then this intermediate patch was used to write a smaller patch that does the
same thing but without a rename.
TODO in 5.1:
- remove check_db_used
- deploy THD::set_db in mysql_change_db
See also comments to individual files.
mysql-test/r/create.result:
Modify the result file: a database can never be NULL.
mysql-test/r/ps.result:
Update test results (Bug#17199 et al)
mysql-test/r/sp.result:
Update test results (Bug#17199 et al)
mysql-test/t/create.test:
Update the id of the returned error.
mysql-test/t/ps.test:
Add test coverage for prepared statements and current database. In scope of
work on Bug#17199 "Problem when view calls function from another database."
mysql-test/t/sp.test:
Add a test case for Bug#17199 "Problem when view calls function from another
database." and Bug#18444 "Fully qualified stored function names don't work
correctly in SELECT statements". Test a complementary problem.
sql/item_strfunc.cc:
Touch the code that reads thd->db (cleanup).
sql/log_event.cc:
While we are at it, replace direct access to thd->db with a method.
Should simplify future conversion of THD::db to LEX_STRING.
sql/slave.cc:
While we are at it, replace direct access to thd->db with a method.
Should simplify future conversion of THD::db to LEX_STRING.
sql/slave.h:
Remove a declaration for a method that is used only in one module.
sql/sp.cc:
Rewrite sp_use_new_db: this is a cleanup that I needed in order to understand
this function and ensure that it has no bugs.
sql/sp.h:
Add a new declaration for sp_use_new_db (uses LEX_STRINGs) and a comment.
sql/sp_head.cc:
- drop sp_name_current_db_new - a creator of sp_name class that was used
when sp_name was created for an identifier without an explicitly initialized
database. Now we pass thd->db to constructor of sp_name right in the
parser.
- rewrite sp_head::init_strings: name->m_db is always set now
- use the new variant of sp_use_new_db
- we don't need to update thd->db with SP MEM_ROOT pointer anymore when
parsing a stored procedure, as noone will refer to it (yes!)
sql/sp_head.h:
- remove unneded methods and members
sql/sql_class.h:
- introduce 3 THD methods to work with THD::db:
.set_db to assign the current database
.reset_db to reset the current database (temporarily) or set it to NULL
.opt_copy_db_to - to deep-copy thd->db to a pointer if it's not NULL
sql/sql_db.cc:
While we are at it, replace direct access to thd->db with a method.
Should simplify future conversion of THD::db to LEX_STRING.
sql/sql_insert.cc:
- replace checks with asserts: table_list->db must be always set in the parser.
sql/sql_lex.h:
- add a comment
sql/sql_parse.cc:
- implement the invariant described in the changeset comment.
- remove juggling with lex->sphead in SQLCOM_CREATE_PROCEDURE:
now db_load_routine uses its own LEX object and doesn't damage the main
LEX.
- add DBUG_ASSERT(0) to unused "check_db_used"
sql/sql_table.cc:
- replace a check with an assert (table_ident->db)
sql/sql_trigger.cc:
While we are at it, replace direct access to thd->db with a method.
Should simplify future conversion of THD::db to LEX_STRING.
sql/sql_udf.cc:
- use thd->set_db instead of direct modification of to thd->db
sql/sql_view.cc:
- replace a check with an assert (view->db)
sql/sql_yacc.yy:
- make sure that we always copy table->db or name->db or ident->db or
select_lex->db from thd->db if the former is not set. If thd->db
is not set but is accessed, return an error.
sql/tztime.cc:
- be nice, never copy thd->db by pointer.
supported in SP but not in PS": just enable them in prepared
statements, the supporting functionality was implemented when
they were enabled in stored procedures.
mysql-test/r/ps.result:
Bug#19308: test results fixed.
mysql-test/r/ps_1general.result:
Adjust existing test cases (ANALYZE/OPTIMIZE/REPAIR are now
allowed in prepared statements.
mysql-test/r/sp-dynamic.result:
Adjust existing test cases (ANALYZE/OPTIMIZE/REPAIR are now
allowed in prepared statements.
mysql-test/t/ps.test:
Add a test case for Bug#19308 "REPAIR/OPTIMIZE/ANALYZE supported
in SP but not in PS"
mysql-test/t/ps_1general.test:
Adjust existing test cases (ANALYZE/OPTIMIZE/REPAIR are now
allowed in prepared statements.
sql/sql_prepare.cc:
Enable ANALYZE, OPTIMIZE, REPAIR in prepared statements.
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.
into mysql.com:/opt/local/work/mysql-4.1-16365
sql/mysql_priv.h:
Auto merged
sql/sql_class.h:
Auto merged
mysql-test/r/ps.result:
Manual merge
mysql-test/t/ps.test:
Manual merge
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.
gives wrong results". Implement previously missing
Item_row::cleanup. The bug is not repeatable in 5.0, probably
due to a coincidence: the problem is present in 5.0 as well.
mysql-test/r/ps.result:
Update the result file (Bug#16248)
mysql-test/t/ps.test:
Add a test case for Bug#16248 "WHERE (col1,col2) IN ((?,?)) gives
wrong results"
sql/item_row.cc:
Implement Item_row::cleanup(): we should reset used_tables_cache
before reexecution of a prepared statement. In case ROW
arguments contain a placeholder, used_tables_cache has PARAM_TABLE
bit set in statement prepare. As a result, when executing a statement,
the condition push down algorithm (make_cond_for_table) would think
that the WHERE clause belongs to the non-existent PARAM_TABLE and
wouldn't attach the WHERE clause to any of the real tables,
effectively optimizing the clause away.
sql/item_row.h:
Remove a never used member 'array_holder'. Add declaration for
Item_row::cleanup.
mysql-test/r/ps.result:
Added test coverage for "order by" in prepared statements (related to BUG#16474).
mysql-test/r/sp.result:
Added reference to test case for BUG#16474.
mysql-test/t/ps.test:
Added test coverage for "order by" in prepared statements (related to BUG#16474).
mysql-test/t/sp.test:
Added reference to test case for BUG#16474.
sql/sql_select.cc:
Fixed comment and test for basic_const_item() instead of is_splocal().
fixed in 5.0).
A post-review fix (Bug#13134)
mysql-test/r/heap.result:
Remove 'delayed' to make the test deterministic.
mysql-test/r/ps.result:
Remove an unneeded drop table (test case for Bug#13134)
mysql-test/t/heap.test:
Remove 'delayed' to make the test deterministic.
mysql-test/t/ps.test:
A post-review fix (Bug#13134)
column is increasing when table is recreated with PS/SP":
make use of create_field::char_length more consistent in the code.
Reinit create_field::length from create_field::char_length
for every execution of a prepared statement (actually fixes the
bug).
mysql-test/r/ps.result:
Test results fixed (Bug#13134)
mysql-test/t/ps.test:
A test case for Bug#13134 "Length of VARCHAR() utf8 column is
increasing when table is recreated with PS/SP"
sql/field.cc:
Move initialization of create_field::char_length to the constructor
of create_field.
sql/field.h:
Rename chars_length to char_length (to be consistent with
how this term is used throughout the rest of the code).
sql/sql_parse.cc:
Initialize char_length in add_field_to_list. This function
effectively works as another create_field constructor.
sql/sql_table.cc:
Reinit length from char_length for every field in
mysql_prepare_table. This is not needed if we're executing
a statement for the first time, however, at subsequent executions
length contains the number of bytes, not characters (as it's expected
to).
mysql-test/r/ctype_ucs.result:
Test results changed (Bug#13337)
mysql-test/r/ps.result:
Test results changed (Bug#13337)
mysql-test/t/ctype_ucs.test:
Fix Bug#13337 (move the test that uses UCS character set to
ctype_ucs)
mysql-test/t/ps.test:
Fix Bug#13337 (move the test that uses UCS character set to
ctype_ucs)
return incorrect result set for a select SQL request"
mysql-test/r/ps.result:
Test results fixed (Bug#12734)
mysql-test/t/ps.test:
A test case for Bug#12734
sql/item_cmpfunc.cc:
Reset canDoTurboBM in Item_func_like::cleanup()
sql/item_cmpfunc.h:
Add Item_func_like::cleanup()
CREATE TABLE and PS/SP": make sure that 'typelib' object for
ENUM values and 'Item_string' object for DEFAULT clause are
created in the statement memory root.
mysql-test/r/ps.result:
Test results has been fixed (Bug#14410)
mysql-test/t/ps.test:
A test case for Bug#14410 "Crash in Enum or Set type in CREATE
TABLE and PS/SP"
sql/mysql_priv.h:
typelib() function declaration has been changed.
sql/sql_table.cc:
Supply the statement memory root to use in typelib() and
safe_charset_converter() functions to ensure that objects
created during the first execution of CREATE TABLE statement
are allocated in persistent memory of the statement.
sql/table.cc:
Change typelib() function to require MEM_ROOT.