produce a sensible error when that limit is exceeded. (Bug #11602)
client/mysqltest.c:
Increase query buffer size, and explain why
mysql-test/r/system_mysql_db.result:
Update results
scripts/mysql_create_system_tables.sh:
Increase size of proc.body
scripts/mysql_fix_privilege_tables.sql:
Increase size of proc.body
sql/share/errmsg.txt:
Add error for SP routines that are too long
sql/sp.cc:
Raise an error when the SP body is too long.
sql/sp.h:
Add error for SP body being too long.
sql/sql_parse.cc:
Handle SP_BODY_TOO_LONG error.
mysql-test/r/sp-big.result:
New BitKeeper file ``mysql-test/r/sp-big.result''
mysql-test/t/sp-big.test:
New BitKeeper file ``mysql-test/t/sp-big.test''
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)
into mysql.com:/home/dlenev/src/mysql-5.0-bg8406
mysql-test/r/sp.result:
Auto merged
mysql-test/r/trigger.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/trigger.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_trigger.cc:
Auto merged
mysql-test/r/sp-error.result:
Manual merge.
mysql-test/t/sp-error.test:
Manual merge.
sql/sp_head.cc:
Manual merge.
sql/sql_yacc.yy:
Manual merge.
crash if referencing a table" and several other related bugs.
Fix for bug #11834 "Re-execution of prepared statement with dropped function
crashes server." which was spotted during work on previous bugs.
Also couple of nice cleanups:
- Replaced two separate hashes for stored routines used by statement with one.
- Now instead of doing one pass through all routines used in statement for
caching them and then doing another pass for adding their tables to table
list, we do only one pass during which do both things.
mysql-test/r/sp-error.result:
Added test for bug #11834 "Re-execution of prepared statement with dropped
function crashes server" also covering handling of prepared statements
which use stored functions but does not require prelocking.
mysql-test/r/sp.result:
Updated test for LOCK TABLES with views in table list.
(Old version of statement used in this test will work ok now, since prelocking
algorithm was tuned and will lock only one multi-set of tables for each routine
even if this routine is used in several different views).
mysql-test/r/trigger.result:
Added several tests for triggers using tables.
mysql-test/t/sp-error.test:
Added test for bug #11834 "Re-execution of prepared statement with dropped
function crashes server" also covering handling of prepared statements
which use stored functions but does not require prelocking.
mysql-test/t/sp.test:
Updated comment about recursive views to reflect current situation.
Updated test for LOCK TABLES with views in table list.
(Old version of statement used in this test will work ok now, since prelocking
algorithm was tuned and will lock only one multi-set of tables for each routine
even if this routine is used in several different views).
mysql-test/t/trigger.test:
Added several tests for triggers using tables.
sql/item_func.cc:
Item_func_sp::cleanup():
By next statement execution stored function can be dropped or altered so
we can't assume that sp_head object for it will be still valid.
sql/sp.cc:
- Added Sroutine_hash_entry structure that represents element in the set of
stored routines used by statement or routine. We can't as before use
LEX_STRING for this purprose because we want link all elements of this set
in list.
- Replaced sp_add_to_hash() with sp_add_used_routine() which takes into account
that now we use one hash for stored routines used by statement instead of two
and which mantains list linking all elelemnts in this hash.
- Renamed sp_merge_hash() to sp_update_sp_used_routines().
- Introduced sp_update_stmt_used_routines() for adding elements to the set of
routines used by statement from another similar set for statement or routine.
This function will also mantain list linking elements of destination set.
- Now instead of one sp_cache_routines() function we have family of
sp_cache_routines_and_add_tables() functions which are also responsible for
adding tables used by routines being cached to statement table list. Nice
optimization - thanks to list linking all elements in the hash of routines
used by statement we don't need to perform several iterations over this hash
(as it was before in cases when we have added new elements to it).
sql/sp.h:
Added declarations of functions used for manipulations with set (hash) of stored
routines used by statement.
sql/sp_head.cc:
sp_name::init_qname():
Now sp_name also holds key identifying routine in the set (hash) of
stored routines used by statement.
sp_head:
Instead of two separate hashes sp_funs/m_spprocs representing sets of stored
routines used by this routine we use one hash - m_sroutines.
sp_instr_set_trigger_field:
Added support for subqueries in assignments to row accessors in triggers.
Removed definition of sp_add_sp_tables_to_table_list() and auxilary functions
since now we don't have separate stage on which we add tables used by routines
used by statement to table list for prelocking. We do it on the same stage as
we load those routines in SP cache. So all this functionality moved to
sp_cache_routines_and_add_tables() family of functions.
sql/sp_head.h:
sp_name:
Now this class also holds key identifying routine in the set (hash) of stored
routines used by statement.
sp_head:
Instead of two separate hashes sp_funs/m_spprocs representing sets of stored
routines used by this routine we use one hash - m_sroutines.
sp_instr_set_trigger_field:
Added support for subqueries in assignments to row accessors in triggers.
Removed declaration of sp_add_sp_tables_to_table_list() since now we don't have
separate stage on which we add tables used by routines used by statement to
table list for prelocking. We do it on the same stage as we load those routines
in SP cache.
sql/sql_base.cc:
open_tables():
- LEX::spfuns/spprocs hashes were replaced with one LEX::sroutines hash.
- Now instead of doing one pass through all routines used in statement for
caching them and then doing another pass for adding their tables to table
list, we do only one pass during which do both things. It is easy to do
since all routines in the set of routines used by statement are linked in
the list. This also allows us to calculate table list for prelocking more
precisely.
- Now triggers properly inform prelocking algorithm about tables they use.
sql/sql_lex.cc:
lex_start():
Replaced LEX::spfuns/spprocs with with one LEX::sroutines hash.
Added LEX::sroutines_list list linking all elements in this hash.
st_lex::st_lex():
Moved definition of LEX constructor to sql_lex.cc file to be able
use sp_sroutine_key declaration from sp.h in it.
sql/sql_lex.h:
LEX:
Replaced two separate hashes for stored routines used by statement with one.
Added list linking all elements in this hash to be able to iterate through all
elements and add new elements to this hash at the same time.
Moved constructor definition to sql_lex.cc.
sql/sql_parse.cc:
mysql_execute_command():
Replaced LEX::spfuns/spprocs with one LEX::sroutines hash.
sql/sql_trigger.cc:
Added missing GNU GPL notice.
Table_triggers_list::check_n_load()
Added initialization of sroutines_key which stores key representing
triggers of this table in the set (hash) of routines used by this statement.
sql/sql_trigger.h:
Added missing GNU GPL notice.
Table_triggers_list:
Added sroutines_key member to store key representing triggers of this
table in the set (hash) of routines used by this statement.
Declared sp_cache_routines_and_add_tables_for_triggers() as friend since
it needs access to sroutines_key and trigger bodies.
sql/sql_yacc.yy:
- Now we use sp_add_used_routine() instead of sp_add_to_hash() for adding
elements to the set of stored routines used in statement.
- Enabled support of subqueries as right sides in assignments to triggers' row
accessors.
mysql-test/r/show_check.result:
test result fixed
mysql-test/r/sql_mode.result:
test result fixed
mysql-test/r/type_decimal.result:
test result fixed
mysql-test/r/type_float.result:
test result fixed
mysql-test/r/type_newdecimal.result:
test result fixed
mysql-test/t/type_decimal.test:
test fixed
mysql-test/t/type_float.test:
test fixed
mysql-test/t/type_newdecimal.test:
test case added
sql/share/errmsg.txt:
error messages added
sql/sql_parse.cc:
now precision/scale parameters are handled in required way
sql/field.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_view.cc:
Auto merged
strings/ctype-utf8.c:
Auto merged
- Mostly indentation fixes
- Added missing test
- Ensure that Item_func_case() checks for stack overruns
- Use real_item() instead of (Item_ref*) item
- Fixed wrong error handling
myisam/mi_unique.c:
Improved comments
myisam/myisampack.c:
Updated version number
mysql-test/r/group_by.result:
Added test that was lost during earlier merge
mysql-test/r/information_schema.result:
Safety fix: Drop procedures before used
mysql-test/t/group_by.test:
Added test that was lost during earlier merge
mysql-test/t/information_schema.test:
Safety fix: Drop procedures before used
mysys/hash.c:
Updated comment
sql/field.cc:
false -> FALSE
sql/ha_ndbcluster.cc:
Fix some style issues
- No () around argument to 'case'
- Space before ( in switch and if
- Removed 'goto'
- Added {}
- Added () to make expressions easier to read
- my_snprintf -> strmov
sql/handler.cc:
if( -> if (
sql/item.cc:
Indentation changes
sql/item.h:
false -> FALSE
sql/item_cmpfunc.cc:
Ensure that Item_func_case() check for stack overrun properly
sql/item_cmpfunc.h:
Ensure that Item_func_case() check for stack overrun properly
sql/item_func.cc:
Indentation fixes
Fixed wrong goto label
sql/mysqld.cc:
Remove test for opt_disable_networking as this flag can never be set here
sql/opt_range.cc:
Simplify code
sql/sql_class.h:
Move define out from middle of class definition
sql/sql_parse.cc:
Remove extra empty lines
sql/sql_select.cc:
use real_item() instead of (Item_ref*) item
Modifed function comment to be align with others
Simple optimization
sql/sql_union.cc:
Portability fix:
Don't use 'bool_variable|=...'
sql/sql_view.cc:
Move List_iterator_fast out from loops (rewind is faster than creating a new itearator)
strings/ctype-utf8.c:
if( -> if (
strings/ctype.c:
Remove disabled code
strings/decimal.c:
Indentation fixes
strings/xml.c:
Indentation fixes
Makefile.am:
Auto merged
myisam/mi_create.c:
Auto merged
myisam/mi_open.c:
Auto merged
mysql-test/r/ctype_utf8.result:
Auto merged
mysys/thr_alarm.c:
Auto merged
VC++Files/sql/mysqld.dsp:
Keep old
client/mysqldump.c:
Manual merge
client/mysqltest.c:
Automatic merge
configure.in:
Manual merge
mysql-test/r/ctype_ucs.result:
Auto merge
mysql-test/r/func_str.result:
Auto merge
mysql-test/r/group_by.result:
Auto merge
mysql-test/r/insert_select.result:
Auto merge
mysql-test/r/insert_update.result:
Auto merge
mysql-test/r/lowercase_table2.result:
Auto merge
mysql-test/r/select.result:
Manual merge
mysql-test/r/variables.result:
Auto merge
mysql-test/t/ctype_ucs.test:
Auto merge
mysql-test/t/func_str.test:
Auto merge
mysql-test/t/group_by.test:
Auto merge
mysql-test/t/insert_select.test:
Auto merge
mysql-test/t/insert_update.test:
Auto merge
mysql-test/t/ndb_alter_table.test:
Auto merge
mysql-test/t/select.test:
Auto merge
mysql-test/t/variables.test:
Auto merge
mysys/my_access.c:
Auto merge
scripts/make_win_src_distribution.sh:
Auto merge
sql/field.cc:
Manual merge
sql/ha_ndbcluster.cc:
Auto merge
sql/handler.cc:
Auto merge
sql/item.cc:
Auto merge
sql/item.h:
Manual merge
sql/item_cmpfunc.h:
Auto merge
sql/item_strfunc.cc:
Auto merge
sql/item_strfunc.h:
Auto merge
sql/mysql_priv.h:
manual merge
sql/mysqld.cc:
manual merge
sql/opt_range.cc:
manual merge
sql/set_var.cc:
Auto merge
sql/sql_base.cc:
manual merge
Restore processing of ON DUPLICATE KEY UPDATE
sql/sql_insert.cc:
manual merge
Restore processing of ON DUPLICATE KEY UPDATE
Simplify mysql_prepare_insert by using local variable for select_lex and save old values just before they are changed
sql/sql_parse.cc:
Restore processing of ON DUPLICATE KEY UPDATE
sql/sql_prepare.cc:
New ON DUPLICATE KEY UPDATE handling
sql/sql_select.cc:
manual merge
sql/sql_table.cc:
auto merge
sql/sql_yacc.yy:
auto merge
strings/ctype-ucs2.c:
auto merge
strings/ctype-utf8.c:
auto merge
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
This fixed a failure of insert_update.test on some platforms
mysys/thr_alarm.c:
Fixed problem noticed by valgrind
sql/opt_range.cc:
Simple optimization for common case
sql/sql_base.cc:
Safety assert
sql/sql_insert.cc:
Added comment
Fixes while reviewing new pushed code
NULL as argument to encrypt/decrypt should return NULL without a warning
client/mysqldump.c:
Cleanup
Ensure we free allocated memory
Portability fixes
client/mysqltest.c:
Cleanup of code during review
Portability fixes (Don't use 'bool')
mysql-test/r/func_encrypt.result:
NULL as argument to encrypt/decrypt should return NULL without a warning
mysql-test/r/func_encrypt_nossl.result:
Added test of NULL argument
mysql-test/t/func_encrypt_nossl.test:
Added test of NULL argument
sql/handler.cc:
Cleanup during code review
sql/item_strfunc.cc:
NULL as argument to encrypt/decrypt should return NULL without a warning
sql/sql_parse.cc:
Fix wrong merge (fix was not needed as the previous code was reverted)
sql/sql_table.cc:
Removed extra new line
#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
into neptunus.(none):/home/msvensson/mysql/bug10466
mysql-test/r/alias.result:
Auto merged
mysql-test/r/func_str.result:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/group_by.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/ps.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/select.result:
Auto merged
mysql-test/t/alias.test:
Auto merged
mysql-test/t/func_str.test:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/group_by.test:
Auto merged
mysql-test/t/innodb.test:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/select.test:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/share/errmsg.txt:
Auto merged
Fix for fix for bug #9728
Error caused server hang on prepared insert ... select
sql/sql_parse.cc:
Fix for fix for bug #9728
Error caused server hang on prepared insert ... select
Remove changes made by bug fix#8147. They strips list of insert_table_list to
only insert table, which results in error reported in bug #9728.
Added flag to Item to resolve ambigous fields reported in bug #8147.
sql/item.h:
Fix bug#9728 decreased functionality in "on duplicate key update".
sql/item.cc:
Fix bug#9728 decreased functionality in "on duplicate key update"
sql/sql_parse.cc:
Fix bug#9728 decreased functionality in "on duplicate key update"
sql/sql_base.cc:
Fix bug#9728 decreased functionality in "on duplicate key update".
sql/sql_yacc.yy:
Fix bug#9728 decreased functionality in "on duplicate key update"
mysql-test/t/insert_select.test:
Test case for bug#9728 Decreased functionality in "on duplicate key update".
mysql-test/r/insert_select.result:
Test case for bug#9728 Decreased functionality in "on duplicate key update".
mysql-test/r/rpl_multi_update3.result:
Changes from code review
mysql-test/t/rpl_multi_update3.test:
Changes from code review
sql/sql_parse.cc:
Changes from code review
- Print warning that says display width is not supported for datatype TIMESTAMP, if user tries to create a TIMESTAMP column with display width.
- Use display width for TIMESTAMP only in type_timestamp test to make sure warning is displayed correctly.
mysql-test/include/ps_create.inc:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/alias.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/func_date_add.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/func_str.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/func_time.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/group_by.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/innodb.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_1general.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_2myisam.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_3innodb.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_4heap.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_5merge.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_6bdb.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_7ndb.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/select.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/type_timestamp.result:
When display width is used for a TIMESTAMP column a warning is printed that the display width will be ignored.
mysql-test/r/update.result:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/alias.test:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/func_date_add.test:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/func_str.test:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/func_time.test:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/group_by.test:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/innodb.test:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/ps.test:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/ps_4heap.test:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/ps_5merge.test:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/select.test:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/update.test:
Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
sql/share/errmsg.txt:
Correct swedish error message
sql/sql_parse.cc:
Print warning if datatype is TIMESTAMP and display width is used.
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.
ALTER, OPTIMIZE and ANALYZE statements".
In 4.1 we disabled logging of slow admin statements. The fix adds an
option to enable it back.
No test case (slow log is not tested in the test suite), but tested
manually.
+ post-review fixes (word police mainly).
sql/mysql_priv.h:
- declaration for a new option
sql/mysqld.cc:
Add server option '--log-slow-admin-statements' to log slow
optimize/alter/etc statements to the slow log if it's enabled.
Add warnings that this option works only if the slow log is open.
sql/sql_class.h:
Rename 'thd->slow_command' to thd->enable_slow_log (negates
the meaning of this variable, and so resolves the need to negate
value opt_log_slow_admin_statements when setting it).
sql/sql_parse.cc:
Implement optional logging of administrative statements in the slow log.
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.
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.
into mysql.com:/home/dlenev/src/mysql-5.0-bg10015
sql/handler.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
We should not allow explicit or implicit transaction commits inside
of stored functions or triggers (so in autocommit mode we should not
do commits after execution of sub-statement).
Also since we don't support nested statement transactions in 5.0,
we shouldn't commit or rollback stmt transactions while we are inside
stored functions or triggers. This should be fixed in later (>=5.1)
releases.
mysql-test/r/sp_trans.result:
Added test for bug #10015 "Crash in InnoDB if stored routines are used"
and for general transaction handling inside of functions.
mysql-test/t/sp_trans.test:
Added test for bug #10015 "Crash in InnoDB if stored routines are used"
and for general transaction handling inside of functions.
sql/handler.cc:
ha_trans_commit()/ha_trans_rollback():
Since we don't support nested statement transactions in 5.0,
we can't commit or rollback stmt transactions while we are inside
stored functions or triggers. So we simply do nothing now.
This should be fixed in later ( >= 5.1) releases.
sql/item_func.cc:
Item_func_sp::execute():
Set THD::transaction.in_sub_stmt flag to TRUE during stored function
execution to prevent commits and rollbacks for statement level
transactions, since doing them will ruin such transaction for
stateemtn which calls this function.
sql/share/errmsg.txt:
Added error message which says that statements doing explicit or implicit
commits are disallowed in triggers and stored functions.
sql/sql_base.cc:
close_thread_tables():
Clarified comment about committing of statement transactions in
prelocked mode.
sql/sql_class.h:
THD::transaction:
Added in_sub_stmt method which indicates that we are executing
statements from trigger or stored function now, and thus
statement transaction belongs to statement which invoked this
routine and we should not commit or rollback it while executing
these sub-statements.
sql/sql_parse.cc:
end_active_trans()/begin_trans()/end_trans():
We should not commit or rollback global (non-stmt) transaction
if we are executing stored function or trigger. These checks will
catch situation when we are trying to do commit or rollback in stored
procedure which is called from function or trigger.
sql/sql_trigger.h:
Table_triggers_list::process_triggers():
Set THD::transaction.in_sub_stmt flag to TRUE during trigger
execution to prevent commits and rollbacks for statement level
transactions, since doing them will ruin such transaction for
stateemtn which invokes this trigger.
sql/sql_yacc.yy:
Prohibited usage of statements which do explicit or implicit commit or
rollback inside of stored functions and triggers.
sql/item.h:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_handler.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_repl.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
error for LIMIT placeholder".
The patch adds grammar support for LIMIT ?, ? and changes the
type of ST_SELECT_LEX::select_limit,offset_limit from ha_rows to Item*,
so that it can point to Item_param.
mysql-test/include/ps_modify.inc:
Fix existing tests: now LIMIT can contain placeholders.
mysql-test/include/ps_query.inc:
Fix existing tests: now LIMIT can contain placeholders.
mysql-test/r/ps.result:
Add basic test coverage for LIMIT ?, ? and fix test results.
mysql-test/r/ps_2myisam.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_3innodb.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_4heap.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_5merge.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_6bdb.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/r/ps_7ndb.result:
Fix test results: now LIMIT can contain placeholders.
mysql-test/t/ps.test:
Add basic test coverage for LIMIT ?, ?.
sql/item.h:
Add a short-cut for (ulonglong) val_int() to Item.
Add a constructor to Item_int() that accepts ulonglong.
Simplify Item_uint constructor by using the c-tor above.
sql/item_subselect.cc:
Now select_limit has type Item *.
We can safely create an Item in Item_exists_subselect::fix_length_and_dec():
it will be allocated in runtime memory root and freed in the end of
execution.
sql/sp_head.cc:
Add a special initalization state for stored procedures to
be able to easily distinguish the first execution of a stored procedure
from prepared statement prepare.
sql/sql_class.h:
Introduce new state 'INITIALIZED_FOR_SP' to be able to easily distinguish
the first execution of a stored procedure from prepared statement prepare.
sql/sql_derived.cc:
- use unit->set_limit() to set unit->select_limit_cnt, offset_limit_cnt
evreryplace. Add a warning about use of set_limit in
mysql_derived_filling.
sql/sql_error.cc:
- use unit->set_limit() to set unit->select_limit_cnt, offset_limit_cnt
evreryplace.
- this change is also aware of bug#11095 "show warnings limit 0 returns
all rows instead of zero rows", so the one who merges the bugfix from
4.1 can use local version of sql_error.cc.
sql/sql_handler.cc:
- use unit->set_limit() to initalize
unit->select_limit_cnt,offset_limit_cnt everyplace.
sql/sql_lex.cc:
Now ST_SELECT_LEX::select_limit, offset_limit have type Item *
sql/sql_lex.h:
Now ST_SELECT_LEX::select_limit, offset_limit have type Item *
sql/sql_parse.cc:
- use unit->set_limit() to initalize
unit->select_limit_cnt,offset_limit_cnt everyplace.
- we can create an Item_int to set global limit of a statement:
it will be created in the runtime mem root and freed in the end of
execution.
sql/sql_repl.cc:
Use unit->set_limit to initialize limits.
sql/sql_select.cc:
- select_limit is now Item* so the proper way to check for default value
is to compare it with NULL.
sql/sql_union.cc:
Evaluate offset_limit_cnt using the new type of ST_SELECT_LEX::offset_limit
sql/sql_view.cc:
Now ST_SELECT_LEX::select_limit, offset_limit have type Item *
sql/sql_yacc.yy:
Add grammar support for LIMIT ?, ? clause.
BitKeeper/etc/logging_ok:
auto-union
client/sql_string.cc:
Auto merged
configure.in:
Auto merged
include/my_global.h:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/olap.result:
Auto merged
mysql-test/r/warnings.result:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/warnings.test:
Auto merged
mysys/raid.cc:
Auto merged
scripts/make_binary_distribution.sh:
Auto merged
sql/field.cc:
Auto merged
BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e:
Auto merged
BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e:
Auto merged
sql/ha_berkeley.cc:
Auto merged
sql/ha_blackhole.cc:
Auto merged
sql/ha_heap.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/ha_myisammrg.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_geofunc.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/item_uniq.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/opt_range.h:
Auto merged
sql/procedure.cc:
Auto merged
sql/protocol.cc:
Auto merged
sql/protocol_cursor.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_analyse.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_error.cc:
Auto merged
sql/sql_handler.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_map.cc:
Auto merged
sql/sql_olap.cc:
Auto merged
sql/sql_repl.cc:
Auto merged
sql/sql_string.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_udf.cc:
Auto merged
sql/examples/ha_archive.cc:
Auto merged
sql/examples/ha_example.cc:
Auto merged
sql/examples/ha_tina.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/tztime.cc:
Auto merged
strings/ctype-win1250ch.c:
Auto merged
mysql-test/r/func_gconcat.result:
merge & ensure that 4.1 and 5.0 source have tests in same order
mysql-test/r/innodb.result:
merge & ensure that 4.1 and 5.0 source have tests in same order
mysql-test/t/func_gconcat.test:
merge & ensure that 4.1 and 5.0 source have tests in same order
mysql-test/t/innodb.test:
merge & ensure that 4.1 and 5.0 source have tests in same order
sql/item_func.cc:
merge
sql/mysqld.cc:
merge
sql/opt_range.cc:
merge
sql/sql_parse.cc:
merge
Give better name to goto labels
sql/sql_select.cc:
merge
client/mysql.cc:
Auto merged
libmysql/libmysql.c:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_bitmap.h:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
Simple optimization for 2 argument usage to function of variable arguments
Fix stack overrun when using 1+1+1+1+1+1+1+....
Update crash-me results for 5.0
Don't call post_open if pre_open() fails (optimization)
sql-bench/limits/mysql-4.1.cfg:
Rename: sql-bench/limits/mysql.cfg -> sql-bench/limits/mysql-4.1.cfg
libmysql/libmysql.c:
More portable define
mysql-test/mysql-test-run.sh:
Write also InnoDB warnings to warnings.log
mysql-test/t/type_newdecimal.test:
Don't get errors if innodb is not defined
mysys/my_alloc.c:
Cleanup comments
mysys/thr_lock.c:
Cleanup comments
sql/item.h:
Remove not needed initializer
sql/item_func.cc:
Simple optimization for 2 argument usage to function of variable arguments
sql/mysql_priv.h:
We use more stackspace with the introduction of int_op() etc.
This change ensures we don't run out of stack when doing 1+1+1+1...
(Tested on x86, 32 bit)
sql/sp_head.cc:
Don't call post_open if pre_open() fails
sql/sp_rcontext.cc:
More comments
Change so that post_open() doesn't have to be called if pre_open() fails
sql/sql_parse.cc:
Fold long lines
sql/sql_select.cc:
Simple reorganization to reduce number of if's
Ensure that table_map is updated for where clause (fixed warning from valgrind)
the code that is active for SP as well in 5.0)
sql/item.cc:
Rename of an Item_arena method.
sql/item_subselect.cc:
Rename of an Item_arena method.
sql/sql_class.h:
Rename of an Item_arena method.
sql/sql_parse.cc:
Rename of an Item_arena method.
sql/sql_union.cc:
Rename of an Item_arena method.