New syntax: CHAR(x USING charset)
Adding test case.
sql_yacc.yy:
New syntax: CHAR(x USING charset)
Adding new parser rule.
item_strfunc.h:
New syntax: CHAR(x USING charset)
Adding a new constructor.
sql/item_strfunc.h:
New syntax: CHAR(x USING charset)
Adding a new constructor.
sql/sql_yacc.yy:
New syntax: CHAR(x USING charset)
Adding new parser rule.
mysql-test/t/ctype_utf8.test:
New syntax: CHAR(x USING charset)
Adding test case.
mysql-test/r/ctype_utf8.result:
New syntax: CHAR(x USING charset)
Adding test case.
Disallow conflicting use of variables named "password" and "names". If such
a variable is declared, and "SET ... = ..." is used for them, an error is
returned; the user must resolve the conflict by either using `var` (indicating
that the local variable is set) or by renaming the variable.
This is necessary since setting "password" and "names" are treated as special
cases by the parser.
mysql-test/r/sp-error.result:
New test cases for BUG#13510
mysql-test/t/sp-error.test:
New test cases for BUG#13510
sql/share/errmsg.txt:
New error message for when certain variable names are use which would be
parsed the wrong way. (E.g. "password" and "names")
sql/sql_yacc.yy:
Check if "names" or "password" are used as local variable/parameter, in which
case "set names" or "set password" will be parsed the wrong way. Give an error
message instead.
Part 2 postreview fixes.
sql/ha_innodb.cc:
Renamed structure st_security_context to class Security_context
sql/item_func.cc:
Renamed structure st_security_context to class Security_context
sql/item_strfunc.cc:
fixed USER() function
sql/log.cc:
variable used to optimize access to security context
sql/mysql_priv.h:
Renamed structure st_security_context to class Security_context
sql/mysqld.cc:
main security context used direcly
sql/sp_head.cc:
Renamed structure st_security_context to class Security_context
removed unneed variable
sql/sp_head.h:
Comment inmroved
Renamed structure st_security_context to class Security_context
sql/sql_acl.cc:
Renamed structure st_security_context to class Security_context
fixed function comment and return value
variable used to optimize access to security context
Renamed method of Security_ontext
sql/sql_acl.h:
fixed return value type
sql/sql_class.cc:
Renamed structure st_security_context to class Security_context
sql/sql_class.h:
Renamed structure st_security_context to class Security_context
Method renamed
sql/sql_db.cc:
Renamed structure st_security_context to class Security_context
fixed layout
sql/sql_parse.cc:
registration of wanted access for underlying tables
sql/sql_show.cc:
Renamed structure st_security_context to class Security_context
fixed layout
sql/sql_yacc.yy:
Renamed structure st_security_context to class Security_context
sql/sql_yacc.yy:
a fix (bug #11553: gives error if aggregate user-defined function in HAVING clause).
- call inc_in_sum_expr() before udf_expr_list rule parsing in case of
aggregate udf functions.
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0
ndb/include/ndbapi/NdbBlob.hpp:
Auto merged
ndb/include/ndbapi/NdbOperation.hpp:
Auto merged
ndb/include/ndbapi/NdbRecAttr.hpp:
Auto merged
ndb/src/ndbapi/NdbApiSignal.cpp:
Auto merged
ndb/src/ndbapi/NdbApiSignal.hpp:
Auto merged
ndb/src/ndbapi/NdbBlob.cpp:
Auto merged
ndb/src/ndbapi/NdbRecAttr.cpp:
Auto merged
ndb/src/ndbapi/Ndbif.cpp:
Auto merged
ndb/src/ndbapi/Ndbinit.cpp:
Auto merged
ndb/test/include/NDBT_Test.hpp:
Auto merged
ndb/test/ndbapi/bank/BankLoad.cpp:
Auto merged
ndb/test/ndbapi/testOIBasic.cpp:
Auto merged
ndb/test/src/NdbBackup.cpp:
Auto merged
ndb/test/src/NdbRestarts.cpp:
Auto merged
ndb/tools/restore/Restore.cpp:
Auto merged
sql/ha_ndbcluster.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
ndb/include/ndbapi/Ndb.hpp:
merge
ndb/include/ndbapi/NdbIndexOperation.hpp:
merge
ndb/include/ndbapi/NdbIndexScanOperation.hpp:
merge
ndb/include/ndbapi/NdbTransaction.hpp:
merge
ndb/src/ndbapi/NdbImpl.hpp:
merge
ndb/src/ndbapi/Ndblist.cpp:
merge
ndb/test/src/HugoCalculator.cpp:
merge
ndb/test/src/NDBT_Test.cpp:
merge
sql/ha_ndbcluster.cc:
merge
sql/mysqld.cc:
merge
sql/sql_lex.h:
merge
sql/sql_parse.cc:
merge
that dump free list allocation per connection
sql/ha_ndbcluster.cc:
imlp. show engine ndb status;
that dump free list allocation per connection
sql/ha_ndbcluster.h:
imlp. show engine ndb status;
that dump free list allocation per connection
sql/mysqld.cc:
imlp. show engine ndb status;
that dump free list allocation per connection
sql/sql_lex.h:
imlp. show engine ndb status;
that dump free list allocation per connection
sql/sql_parse.cc:
imlp. show engine ndb status;
that dump free list allocation per connection
sql/sql_yacc.yy:
imlp. show engine ndb status;
that dump free list allocation per connection
mysql-test/r/sp.result:
Added missing drop table.
mysql-test/t/sp.test:
Added missing drop table.
sql/sp_head.h:
Post-review fix for autocommit check in SPs and triggers.
sql/sql_yacc.yy:
Post-review fix for autocommit check in SPs and triggers.
view definer information syntax/storage/replication
fixed SOURCE field of .frm
mysql-test/r/func_in.result:
definer information added to CREATE VIEW
mysql-test/r/lowercase_view.result:
definer information added to CREATE VIEW
mysql-test/r/mysqldump.result:
definer information added to CREATE VIEW
mysql-test/r/rpl_view.result:
check log of queries
mysql-test/r/skip_grants.result:
--skip-grants do not allow use user information
mysql-test/r/sql_mode.result:
definer information added to CREATE VIEW
mysql-test/r/temp_table.result:
definer information added to CREATE VIEW
mysql-test/r/view.result:
definer information added to CREATE VIEW
test of storing/restoring definer information
mysql-test/r/view_grant.result:
test of grant check of definer information
definer information added to CREATE VIEW
mysql-test/t/rpl_view.test:
check log of queries
mysql-test/t/skip_grants.test:
--skip-grants do not allow use user information
mysql-test/t/view.test:
test of storing/restoring definer information
mysql-test/t/view_grant.test:
test of grant check of definer information
sql/mysql_priv.h:
CREATE/ALTER VIEW print support
set current user as definer procedure
sql/share/errmsg.txt:
new errors/warnings
sql/sql_acl.cc:
make find_acl_user public to allow to check user
sql/sql_acl.h:
make find_acl_user public to allow to check user
sql/sql_lex.h:
storing definer information
sql/sql_parse.cc:
send CREATE/ALTER VIEW for replication with full list of options
set current user as definer procedure
sql/sql_show.cc:
new CREATE VIEW options printed
sql/sql_view.cc:
check of definer clause
changes in .frm file
definer information storage support
now we store only original SELECT in SOURCE field of .frm
sql/sql_yacc.yy:
definer information sintax support
getting SOURCE field information for .frm
sql/table.h:
definer information storage
Second version after review. Allow 'set autocommit' in procedures, but not
functions or triggers. Can return error in run-time (when a function calls
a procedure).
mysql-test/r/sp-error.result:
New test case for BUG#12712.
mysql-test/t/sp-error.test:
New test case for BUG#12712.
sql/set_var.cc:
Made sys_autocommit external, to allow testing in sql_yacc.yy.
sql/set_var.h:
Made sys_autocommit external, to allow testing in sql_yacc.yy.
sql/share/errmsg.txt:
New error message for disallowing the setting of autocommit in stored functions and triggers.
sql/sp_head.h:
New flag: has 'set autocommit', and testing for this in is_not_allowed_in_function().
sql/sql_yacc.yy:
Disallow setting AUTOCOMMIT in stored function and triggers.
Have to init. all local variables in their frames, not just once at the beginning
of invocation.
mysql-test/r/sp.result:
New test case for BUG#13133.
mysql-test/t/sp.test:
New test case for BUG#13133.
sql/sp_head.cc:
Just init. local variable slots in the fram to NULL. (Real init. will be done
in each block.)
sql/sp_pcontext.cc:
Removed isset flag, since it's not used.
sql/sp_pcontext.h:
Removed isset flag, since it's not used.
sql/sql_yacc.yy:
Initialize local variables in the block to null, or the default value, given.
(Untabifed block too.)
(per Monty's patch).
Remove references to the "COMMENT" field.
WL#2414
mysql-test/r/federated.result:
alter from "COMMENT=" to "CONNECTION="
mysql-test/r/federated_archive.result:
change "COMMENT=" to "CONNECTION="
mysql-test/t/federated.test:
change from "COMMENT=" to "CONNECTION="
mysql-test/t/federated_archive.test:
change from "COMMENT=" to "CONNECTION="
sql/ha_federated.cc:
Change parsing of char* table->s->comment to LEX_STRING table->s->connect_string
(per Monty's patch)
sql/handler.h:
added LEX_STRING "connection_string"
(per Monty's patch)
sql/sql_yacc.yy:
added setting of "connect_string" string and length
sql/table.cc:
Modifying frm file to store connecting information (code change came from Monty).
sql/table.h:
added connect_string
sql/unireg.cc:
Storing information on connection_string (code came from Monty).
The problem was that in the first production in rule 'join_table', that
processes simple cross joins, the parser was processing the second join operand
before the first one due to unspecified priorities of JOINs. As a result in the
case of cross joins the parser constructed a tree with incorrect nesting:
the expression "t1 join t2 join t3 on some_cond" was interpreted as
"t1 join (t2 join t3 on some_cond)" instead of
"(t1 join t2) join t3 on some_cond".
Because of this incorrect nesting the method make_join_on_context picked an
incorrect table as the first table of the name resolution context.
The solution assignes correct priorities to the related production.
mysql-test/r/select.result:
Added test for BUG#12943.
mysql-test/t/select.test:
Added test for BUG#12943.
sql/sql_parse.cc:
Fixed typo.
sql/sql_yacc.yy:
Provide explicit priorities of the JOIN operator and the 'table_ref' rule,
to enforce left-associativity of [INNER | CROSS] JOIN.
Any form of HANDLER statement is forbidden from usage in stored procedures/functions.
mysql-test/r/sp-error.result:
Results for the test case for Bug#12995 added.
mysql-test/t/sp-error.test:
Test case for Bug#12995 added.
sql/sql_yacc.yy:
Forbid any form of "HANDLER" statement from use in stored procedures/functions.
into mysql.com:/home/alexi/dev/mysql-5.0-0
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Post merge changes
sql_yacc.yy:
Post merge changes
sql_select.cc:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions (post merge changes).
The function add_key_fields() is modified. There cannot be NOT before
BETWEEN/IN anymore. Rather Item_func_between/in objects can represent
now [NOT]BETWEEN/IN expressions.
sql/item_cmpfunc.cc:
Post merge changes
sql/opt_range.cc:
Post merge changes
sql/sql_select.cc:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions (post merge changes).
The function add_key_fields() is modified. There cannot be NOT before
BETWEEN/IN anymore. Rather Item_func_between/in objects can represent
now [NOT]BETWEEN/IN expressions.
sql/sql_yacc.yy:
Post merge changes.
mysql-test/r/join_outer.result:
Post merge changes
OPTIMIZE TABLE statement is forbidden from usage in stored procedures/functions.
NOTE: OPTIMIZE TABLE statement can be useful in stored procedures. The idea is
that the user/administrator can create a stored procedure for admin
tasks (optimizing, backing up, etc). This procedure can be scheduled to run
automatically (by mean of internal cron (WL#1034)). So, once we can make this
statement work, it is worth doing it.
mysql-test/r/sp-error.result:
Results for the test case for Bug#12953 added.
mysql-test/t/sp-error.test:
Test case for Bug#12953 "Stored procedures: crash if OPTIMIZE TABLE in function" added.
sql/sql_yacc.yy:
Forbid "OPTIMIZE TABLE" statement from use in stored procedures/functions.
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
The classes Item_func_between, Item_func_if, Item_func_in are modified.
Item_func_between/in objects can represent now [NOT]BETWEEN/IN expressions.
The class Item_func_opt_neg is added to factor out the functionality
common for the modified classes Item_func_between and Item_func_in.
item_cmpfunc.cc:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
Added Item_func_between::fix_fields(), Item_func_if::fix_fields(),
Item_func_in::fix_fields(). They correct generic calculation of
the not_null_tables attribute when it is needed.
Modified Item_func_between::val_int(), Item_func_in::val_int().
opt_range.cc:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
The function get_mm_tree() is modified. There cannot be NOT before
BETWEEN/IN anymore. Rather Item_func_between/in objects can represent
now [NOT]BETWEEN/IN expressions.
sql_yacc.yy:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
Item_func_between/in objects can represent now [NOT]BETWEEN/IN expresions.
join_outer.result:
Fixed some testcases results (bugs #12101, #12102)
join_outer.test:
Added testcases for bugs #12101, #12102
mysql-test/t/join_outer.test:
Added testcases for bugs #12101, #12102
mysql-test/r/join_outer.result:
Fixed some testcases results (bugs #12101, #12102)
sql/sql_yacc.yy:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
Item_func_between/in objects can represent now [NOT]BETWEEN/IN expresions.
sql/opt_range.cc:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
The function get_mm_tree() is modified. There cannot be NOT before
BETWEEN/IN anymore. Rather Item_func_between/in objects can represent
now [NOT]BETWEEN/IN expressions.
sql/item_cmpfunc.cc:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
Added Item_func_between::fix_fields(), Item_func_if::fix_fields(),
Item_func_in::fix_fields(). They correct generic calculation of
the not_null_tables attribute when it is needed.
Modified Item_func_between::val_int(), Item_func_in::val_int().
sql/item_cmpfunc.h:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
for some expressions.
The classes Item_func_between, Item_func_if, Item_func_in are modified.
Item_func_between/in objects can represent now [NOT]BETWEEN/IN expressions.
The class Item_func_opt_neg is added to factor out the functionality
common for the modified classes Item_func_between and Item_func_in.
The idea of the patch is to separate statement processing logic,
such as parsing, validation of the parsed tree, execution and cleanup,
from global query processing logic, such as logging, resetting
priorities of a thread, resetting stored procedure cache, resetting
thread count of errors and warnings.
This makes PREPARE and EXECUTE behave similarly to the rest of SQL
statements and allows their use in stored procedures.
This patch contains a change in behaviour:
until recently for each SQL prepared statement command, 2 queries
were written to the general log, e.g.
[Query] prepare stmt from @stmt_text;
[Prepare] select * from t1 <-- contents of @stmt_text
The chagne was necessary to prevent [Prepare] commands from being written
to the general log when executing a stored procedure with Dynamic SQL.
We should consider whether the old behavior is preferrable and probably
restore it.
This patch refixes Bug#7115, Bug#10975 (partially), Bug#10605 (various bugs
in Dynamic SQL reported before it was disabled).
mysql-test/r/not_embedded_server.result:
Since we don't want to log Dynamic SQL in stored procedures,
now the general log gets only one log entry per SQL statement.
mysql-test/r/sp-error.result:
- remove obsolete tests
- a better error message for the case when a stored procedure that
returns a result set is called from a function
mysql-test/r/trigger.result:
- a better error message for the case when a stored procedure that
returns a result set is called from a trigger
mysql-test/t/sp-error.test:
- a better error message for the case when a stored procedure that
returns a result set is called from a function.
- move the comment to its place (end of file).
mysql-test/t/trigger.test:
- a better error message for the case when a stored procedure that
returns a result set is called from a trigger
sql/item_func.cc:
- we need to pass sql_command explicitly to get_var_with_binlog, because
when creating a query for SQL prepared statement thd->lex->sql_command
points at SQLCOM_EXECUTE, which is not listed in the list of update
queries.
sql/log_event.h:
- remove an extra copy of the previous sentence
sql/mysql_priv.h:
- fix declarations of sql_prepare.cc API
sql/share/errmsg.txt:
- a new error message, when one attempts to execute a prepared statement
which is currently being executed (this can happen only in Dynamic SQL
at the moment).
sql/sp_head.cc:
- extend sp_multi_results_command to return different flags for a
command (and rename it)
- add support for SQLCOM_PREPARE,SQLCOM_EXECUTE, SQLCOM_DEALLOCATE
to sp_get_flags_for_command
- replace multiple boolean sp_head members with uint m_flags
- a fix for a crash when user variables are used in a stored procedure
and binlog is on. A temporary fix for Bug#12637 "SP crashes the server
if it has update query with user var & binlog is enabled", which actually
stands for stored functions: now instead of a crash we break
replication if a user variable is used in a stored function which
is executed in prelocked mode.
sql/sp_head.h:
- replace multiple boolean flags of sp_head with uint m_flags;
- add flag CONTAINS_DYNAMIC_SQL
- use this flag to error if a stored procedure with Dynamic SQL is
called from a function or trigger.
sql/sql_class.cc:
- Statement_map::insert should not delete a statement if it exists,
now it's done externally to be able to handle the case when the
statement being deleted is in use.
- remove extra code (free_list is already reset in free_items)
sql/sql_lex.cc:
- add lex->stmt_prepare_mode; we can't rely on thd->command any more,
because we don't reset it any more (Dynamic SQL requirement is that
PS are as little intrusive as possible).
sql/sql_lex.h:
- declare bool LEX::stmt_prepare_mode
sql/sql_parse.cc:
- move prepared statement code to sql_prepare.cc
- change declarations (refactored code)
- better error message when one attempts to use Dynamic SQL or a
stored procedure that returns a result set in a function or trigger.
sql/sql_prepare.cc:
- major refactoring to ensure PREPARE/EXECUTE commands do not reset global THD
state and allow their use in stored procedures.
- add Prepared_statement::flags and use it to ensure no recursive execution
of a prepared statement is possible
- better comments
sql/sql_yacc.yy:
- enable PREPARE/EXECUTE/DEALLOCATE in stored procedures
- produce an error message on attempt to use PREPARE/EXECUTE/DEALLOCATE
in a stored function or trigger
mysql-test/r/sp-dynamic.result:
- sp-dynamic.test results
mysql-test/t/sp-dynamic.test:
- a new test for PREPARE/EXECUTE/DEALLOCATE in stored procedures.
Added a switch to reject illegal values for PACK_KEYS.
mysql-test/r/myisam.result:
Bug#10056 - PACK_KEYS option take values greater than 1 while creating table
The test result.
mysql-test/t/myisam.test:
Bug#10056 - PACK_KEYS option take values greater than 1 while creating table
The test case.
(Packets out of order if calling HELP CONTENTS from Stored Procedure)
mysql-test/r/sp-error.result:
results of test of bug 12490
mysql-test/t/sp-error.test:
test for bug 12490
(Packets out of order if calling HELP CONTENTS from Stored Procedure)
sql/sql_yacc.yy:
disable HELP in SP
(fixes bug 12490)
"Creating a function with char binary IN parameter fails"
Parse BINARY as part of type declaration, not as
a column attribute.
mysql-test/r/sp.result:
test for bug 9048
mysql-test/t/sp.test:
test for bug 9048
sql/sql_yacc.yy:
fix bug 9048
parse BINARY as part of type declaration and not as column modifier.
"Interleaved SPs execution is now binlogged properly, "SELECT spfunc()" is binlogged too.
The known remaining issue is binlogging/replication of "a routine is deleted while it is executed" scenario.
mysql-test/r/rpl_sp.result:
Fix for BUG#12335: updated test cases/results
mysql-test/t/rpl_sp.test:
Fix for BUG#12335: updated test cases/results
sql/item.cc:
Fix for BUG#12335 (SP replication):
- Added Item_name_const 'function'
- Addede 'delete reuse' to call dtor on item reuse
sql/item.h:
Fix for BUG#12335 (SP replication) : Added Item_name_const 'function' + code cleanup
sql/item_create.cc:
Fix for BUG#12335 (SP replication) : Added Item_name_const 'function'
sql/item_create.h:
Fix for BUG#12335 (SP replication) : Added Item_name_const 'function'
sql/item_func.cc:
Fix for BUG#12335 (SP replication) : binary log is now constrolled from within execute_function.
sql/lex.h:
Fix for BUG#12335 (SP replication) : Added Item_name_const 'function'
sql/log.cc:
Fix for BUG#12335 (SP replication) : Added MYSQL_LOG::{start|stop}_union_events to allow
one to temporary disable binlogging but collect a 'union' information about binlog write
calls.
sql/mysql_priv.h:
Fix for BUG#12335 (SP replication)
sql/sp_head.cc:
Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for
StoredRoutinesBinlogging for details
sql/sp_head.h:
Comments added
sql/sp_pcontext.h:
Comments added
sql/sp_rcontext.h:
Comments added
sql/sql_class.cc:
Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for
StoredRoutinesBinlogging for details
sql/sql_class.h:
Fix for BUG#12335 (SP replication) : Added MYSQL_LOG::{start|stop}_union_events to allow
one to temporary disable binlogging but collect a 'union' information about binlog write
calls.
sql/sql_delete.cc:
Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog.
sql/sql_insert.cc:
Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog.
sql/sql_lex.cc:
Fix for BUG#12335 (SP replication): Add ability to extract previous returned token from
the tokenizer.
sql/sql_lex.h:
Fix for BUG#12335 (SP replication): Add ability to extract previous returned token from
the tokenizer.
sql/sql_parse.cc:
Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for
StoredRoutinesBinlogging for details
sql/sql_update.cc:
Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog.
sql/sql_yacc.yy:
Fix for BUG#12335 (SP replication) : When creating Item_splocal, remember where it is located
in the query.
datetime of when the current statement began. This also makes SYSDATE()
not safe in replication. (Bug #12562)
mysql-test/r/func_time.result:
Add new results
mysql-test/t/func_time.test:
Add tests for new SYSDATE() behavior
sql/item_timefunc.cc:
Add Item_func_sysdate_local implementation
sql/item_timefunc.h:
Add Item_func_sysdate_local, so SYSDATE() can behave differently
than NOW().
sql/lex.h:
SYSDATE() is no longer an alias for NOW().
sql/sql_yacc.yy:
Handle SYSDATE()
mysql-test/t/kill.test:
Moved --disable_reconnect earlier to avoid race condition
sql/sql_help.cc:
Cleanup during review of new code
(Moved variable definitions first in function
sql/sql_insert.cc:
Cleanup during review of new code
sql/sql_lex.cc:
Cleanup during review of new code
sql/sql_parse.cc:
Cleanup during review of new code
Changed potential problem with previous_table_ref where it dependent that TABLE_LIST first element would be next_local
Rearanged code in add_table_to_list() to remove extra if
Combined 2 calls to calloc() to one
sql/sql_view.cc:
Remove extra indentation level
Combined common 'on error' exit
sql/sql_yacc.yy:
Fixed comment style
sql/table.cc:
Cleanup during review of new code
- Changed while() loops to for() loop (to make code more readable)
- Removed not needed initialization of variables
- Removed not needed 'else' cases
- Removed trivial ASSERT's that was checked by previous code
- Moved comment setting last in Natural_join_column::check_grants()
into mysql.com:/home/my/mysql-5.0
sql/ha_berkeley.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_derived.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/share/errmsg.txt:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/sql_class.cc:
Manual merge
This allows us to use statement replication with functions and triggers
The following things are fixed with this patch:
- NOW() and automatic timestamps takes the value from the main event for functions and triggers (which allows these to replicate with statement level logging)
- No side effects for triggers or functions with auto-increment values(), last_insert_id(), rand() or found_rows()
- Triggers can't return result sets
Fixes bugs:
#12480: NOW() is not constant in a trigger
#12481: Using NOW() in a stored function breaks statement based replication
#12482: Triggers has side effects with auto_increment values
#11587: trigger causes lost connection error
mysql-test/r/trigger.result:
Added test fpr big
mysql-test/t/sp-error.test:
Changed error message numbers
mysql-test/t/trigger.test:
Added test for trigger returning result (#11587)
sql/item_func.cc:
Store the first used seed value for RAND() value.
(This makes rand() replicatable in functions and triggers)
Save and clear run context before executing a stored function and restore it afterwards.
This removes side effects of stored functions for RAND(), auto-increment values and NOW() and makes most stored function replicatable
sql/share/errmsg.txt:
Reuse error message also for triggers
sql/sp_head.cc:
If in function or trigger, don't change value of NOW()
(This allows us to use statement replication with functions that directly or indirectly uses timestamps)
sql/sql_class.cc:
Added framework for storing and retrieving run context while exceuting triggers or stored functions.
sql/sql_class.h:
Added framework for storing and retrieving run context while exceuting triggers or stored functions.
sql/sql_parse.cc:
If in function or trigger, don't change value of NOW()
(This allows us to use statement replication with functions that directly or indirectly uses timestamps)
sql/sql_trigger.cc:
Moved process_triggers function from sql_trigger.h
Use reset/restore sub_statement_state while executing triggers to avoid side effects and make them replicatable
sql/sql_trigger.h:
Moved process_triggers function from sql_trigger.h
Use reset/restore sub_statement_state while executing triggers to avoid side effects and make them replicatable
sql/sql_yacc.yy:
Give error message if trigger can return a result set (Bug #11587)
tests/fork_big2.pl:
Removed return from end of lines
mysql-test/r/rpl_trigger.result:
New BitKeeper file ``mysql-test/r/rpl_trigger.result''
mysql-test/t/rpl_trigger.test:
New BitKeeper file ``mysql-test/t/rpl_trigger.test''
into mysql.com:/home/timka/mysql/src/5.0-2486-merge
mysql-test/r/errors.result:
Auto merged
mysql-test/r/fulltext.result:
Auto merged
mysql-test/r/fulltext_order_by.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/join_nested.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/t/errors.test:
Auto merged
mysql-test/t/fulltext.test:
Auto merged
mysql-test/t/fulltext_order_by.test:
Auto merged
mysql-test/t/innodb.test:
Auto merged
mysql-test/t/join_nested.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
sql/item.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_base.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_select.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.h:
Auto merged
tests/mysql_client_test.c:
Auto merged
sql/sql_insert.cc:
merge WL#2486
sql/sql_show.cc:
merge WL#2486
"Process NATURAL and USING joins according to SQL:2003".
* Some of the main problems fixed by the patch:
- in "select *" queries the * expanded correctly according to
ANSI for arbitrary natural/using joins
- natural/using joins are correctly transformed into JOIN ... ON
for any number/nesting of the joins.
- column references are correctly resolved against natural joins
of any nesting and combined with arbitrary other joins.
* This patch also contains a fix for name resolution of items
inside the ON condition of JOIN ... ON - in this case items must
be resolved only against the JOIN operands. To support such
'local' name resolution, the patch introduces a stack of
name resolution contexts used at parse time.
NOTICE:
- This patch is not complete in the sense that
- there are 2 test cases that still do not pass -
one in join.test, one in select.test. Both are marked
with a comment "TODO: WL#2486".
- it does not include a new test specific for the task
mysql-test/include/ps_query.inc:
Adjusted according to standard NATURAL/USING join semantics.,
mysql-test/r/bdb.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/derived.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/errors.result:
The column as a whole cannot be resolved, so different error message.
mysql-test/r/fulltext.result:
Adjusted according to standard JOIN ... ON semantics =>
the ON condition can refer only to the join operands.
mysql-test/r/fulltext_order_by.result:
More detailed error message.
mysql-test/r/innodb.result:
Adjusted according to standard NATURAL/USING join semantics.
This test doesn't pass completetly yet!
mysql-test/r/insert_select.result:
More detailed error message.
mysql-test/r/join.result:
Adjusted according to standard NATURAL/USING join semantics.
NOTICE: there is one test case that still fails, and it is
commeted out and marked with WL#2486 in the test file.
mysql-test/r/join_crash.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/join_nested.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/join_outer.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/multi_update.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/null_key.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/order_by.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_2myisam.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_3innodb.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_4heap.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_5merge.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_6bdb.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_7ndb.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/select.result:
Adjusted according to standard NATURAL/USING join semantics.
NOTICE: there is one failing test case which is commented with
WL#2486 in the test file.
mysql-test/r/subselect.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/type_ranges.result:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/union.result:
More detailed error message.
mysql-test/t/bdb.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/errors.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/fulltext.test:
Adjusted according to standard JOIN ... ON semantics =>
the ON condition can refer only to the join operands.
mysql-test/t/fulltext_order_by.test:
More detailed error message.
mysql-test/t/innodb.test:
Adjusted according to standard NATURAL/USING join semantics.
This test doesn't pass completetly yet!
mysql-test/t/insert_select.test:
More detailed error message.
mysql-test/t/join.test:
Adjusted according to standard NATURAL/USING join semantics.
NOTICE: there is one test case that still fails, and it is
commeted out and marked with WL#2486 in the test file.
mysql-test/t/join_crash.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/join_nested.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/join_outer.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/null_key.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/order_by.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/select.test:
Adjusted according to standard NATURAL/USING join semantics.
NOTICE: there is one test case that still fails, and it is
commeted out and marked with WL#2486 in the test file.
mysql-test/t/subselect.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/type_ranges.test:
Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/union.test:
More detailed error message.
sql/item.cc:
- extra parameter to find_field_in_tables
- find_field_in_real_table renamed to find_field_in_table
- fixed comments/typos
sql/item.h:
- added [first | last]_name_resolution_table to class
Name_resolution_context
- commented old code
- standardized formatting
sql/mysql_priv.h:
- refactored the find_field_in_XXX procedures,
- added a new procedure for natural join table references,
- renamed the find_field_in_XXX procedures to clearer names
sql/sp.cc:
- pass the top-most list of the FROM clause to setup_tables
- extra parameter to find_field_in_tables
sql/sql_acl.cc:
- renamed find_field_in_table => find_field_in_table_ref
- extra parameter to find_field_in_table_ref
- commented old code
sql/sql_base.cc:
This file contains the core of the implementation of the processing
of NATURAL/USING joins (WL#2486).
- added many comments to old code
- refactored the group of find_field_in_XXX procedures, and added a
new procedure for natural joins. There is one find_field_in_XXX procedure
per each type of table reference (stored table, merge view, or natural
join); one meta-procedure that selects the correct one depeneding on the
table reference; and one procedure that goes over a list of table
referenes.
- NATURAL/USING joins are processed through the procedures:
mark_common_columns, store_natural_using_join_columns,
store_top_level_join_columns, setup_natural_join_row_types.
The entry point to processing NATURAL/USING joins is the
procedure 'setup_natural_join_row_types'.
- Replaced the specialized Field_iterator_XXX iterators with one
generic iterator over the fields of a table reference.
- Simplified 'insert_fields' and 'setup_conds' due to encapsulation of
the processing of natural joins in a separate set of procedures.
sql/sql_class.h:
- Commented old code.
sql/sql_delete.cc:
- Pass the FROM clause to setup_tables.
sql/sql_help.cc:
- pass the end name resolution table to find_field_in_tables
- adjust the list of tables for name resolution
sql/sql_insert.cc:
- Changed the code that saves and restores the current context to
support the list of tables for name resolution -
context->first_name_resolution_table, and
table_list->next_name_resolution_table.
Needed to support an ugly trick to resolve inserted columns only in
the first table.
- Added Name_resolution_context::[first | last]_name_resolution_table.
- Commented old code
sql/sql_lex.cc:
- set select_lex.parent_lex correctly
- set correct state of the current name resolution context
sql/sql_lex.h:
- Added a stack of name resolution contexts to support local
contexts for JOIN ... ON conditions.
- Commented old code.
sql/sql_load.cc:
- Pass the FROM clause to setup_tables.
sql/sql_olap.cc:
- Pass the FROM clause to setup_tables.
sql/sql_parse.cc:
- correctly set SELECT_LEX::parent_lex
- set the first table of the current name resoltion context
- added support for NATURAL/USING joins
- commented old code
sql/sql_select.cc:
- Pass the FROM clause to setup_tables.
- Pass the end table to find_field_in_tables
- Improved comments
sql/sql_show.cc:
- Set SELECT_LEX::parent_lex.
sql/sql_update.cc:
- Pass the FROM clause to setup_tables.
sql/sql_yacc.yy:
- Added support for a stack of name resolution contexts needed to
implement name resolution for JOIN ... ON. A context is pushed
for each new JOIN ... ON, and popped afterwards.
- Added support for NATURAL/USING joins.
sql/table.cc:
- Added new class Natural_join_column to hide the heterogeneous
representation of column references for stored tables and for
views.
- Added a new list TABLE_LIST::next_name_resolution_table to
support name resolution with NATURAL/USING joins. Also added
other members to TABLE_LIST to support NATURAL/USING joins.
- Added a generic iterator over the fields of table references
of various types - class Field_iterator_table_ref
sql/table.h:
- Added new class Natural_join_column to hide the heterogeneous
representation of column references for stored tables and for
views.
- Added a new list TABLE_LIST::next_name_resolution_table to
support name resolution with NATURAL/USING joins. Also added
other members to TABLE_LIST to support NATURAL/USING joins.
- Added a generic iterator over the fields of table references
of various types - class Field_iterator_table_ref
tests/mysql_client_test.c:
Adjusted according to standard NATURAL JOIN syntax.
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/ha_berkeley.cc:
Removed not used variable (and options)
sql/ha_berkeley.h:
Removed not used argument
sql/ha_ndbcluster.cc:
Remove compiler warning
sql/init.cc:
Simplify code
sql/item_sum.cc:
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/mysql_priv.h:
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/mysqld.cc:
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_class.h:
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_delete.cc:
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_derived.cc:
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_lex.h:
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_parse.cc:
Indentation fixes
sql/sql_select.cc:
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_select.h:
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_show.cc:
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_union.cc:
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_update.cc:
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
sql/sql_yacc.yy:
Changed variable name i to more descriptive name
Removed compiler warning
mysql-test/r/gis.result:
test result fixed
mysql-test/t/gis.test:
test case
sql/sp_head.cc:
m_geom_returns is sent to make_field
sql/sp_head.h:
m_geom_returns declared
sql/sql_yacc.yy:
m_geom_returns initializing added
We should not allow FLUSH statement to be executed inside both triggers
and stored functions.
mysql-test/r/sp-error.result:
Updated test after replacing error, which is thrown when one uses FLUSH
statement inside of stored function, with more specific.
Also now we issue more general error when we barking about USE command
in stored routines.
mysql-test/r/trigger.result:
Added test for bug #12280 "Triggers: crash if flush tables"
mysql-test/t/sp-error.test:
Updated test after replacing error, which is thrown when one uses FLUSH
statement inside of stored function, with more specific.
Also now we issue more general error when we barking about USE command
in stored routines.
mysql-test/t/trigger.test:
Added test for bug #12280 "Triggers: crash if flush tables"
sql/share/errmsg.txt:
Removed ER_SP_NO_USE error. Now we use more general ER_SP_BADSTATEMENT in this
case. Instead added error message for barking about statements which should not
be allowed inside of stored functions or triggers.
It is safe to do this since it is highly unprobable that someone will upgrade
first to the new 5.0 release and then downgrade back to the old one.
sql/sql_parse.cc:
reload_acl_and_cache():
FLUSH TABLES and FLUSH PRIVILEGES should not be allowed if we are inside
of stored function or trigger.
sql/sql_yacc.yy:
We should not allow FLUSH statement inside both triggers and stored
functions. Replaced error which is thrown in this case with more
specific.
Also now we issue more general ER_SP_BADSTATEMENT error when one tries
to use USE command inside of stored routine.
into mysql.com:/home/dlenev/src/mysql-5.0-tn
mysql-test/r/information_schema.result:
Auto merged
mysql-test/t/information_schema.test:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/share/errmsg.txt:
Manual merge.