Server crashed in some cases when a query required a MIN/MAX
agrregation for a 'ucs2' field.
In these cases the aggregation caused calls of the function
update_tmptable_sum_func that indirectly invoked
the method Item_sum_hybrid::min_max_update_str_field()
containing a call to strip_sp for a ucs2 character set.
The latter led directly to the crash as it used my_isspace
undefined for the ucs2 character set.
Actually the call of strip_sp is not needed at all in this
situation and has been removed by the fix.
mysql-test/r/ctype_ucs.result:
Added a test case for bug #20076.
mysql-test/t/ctype_ucs.test:
Added a test case for bug #20076.
is_injective -> table_flag() HA_HAS_OWN_BINLOGGING
(Faster and easier to understand)
Allow cluster_binlogging also in mixed replication mode.
mysql-test/t/rpl_truncate_7ndb.test:
Ensure that test is only run with mixed or row based replication
sql/ha_ndbcluster.cc:
Enforce row based replication if a cluster table is used
sql/ha_ndbcluster.h:
Remove is_injective() (Is now a table flag)
sql/ha_ndbcluster_binlog.cc:
Use cluster binlogging also in mixed binary logging
(Using a cluster table will enforce row based replication in mixed mode, so this should be ok)
sql/handler.cc:
is_injective -> HA_HAS_OWN_BINLOGGING
sql/handler.h:
is_injective -> HA_HAS_OWN_BINLOGGING
mysql-test/include/have_binlog_format_mixed_or_row.inc:
New BitKeeper file ``mysql-test/include/have_binlog_format_mixed_or_row.inc''
mysql-test/r/rpl_truncate_7ndb_2.result:
New BitKeeper file ``mysql-test/r/rpl_truncate_7ndb_2.result''
mysql-test/t/rpl_truncate_7ndb_2-master.opt:
New BitKeeper file ``mysql-test/t/rpl_truncate_7ndb_2-master.opt''
mysql-test/t/rpl_truncate_7ndb_2.test:
New BitKeeper file ``mysql-test/t/rpl_truncate_7ndb_2.test''
with PREPARE fails with weird error".
More generally, re-executing a stored procedure with a complex SP cursor query
could lead to a crash.
The cause of the problem was that SP cursor queries were not optimized
properly at first execution: their parse tree belongs to sp_instr_cpush,
not sp_instr_copen, and thus the tree was tagged "EXECUTED" when the
cursor was declared, not when it was opened. This led to loss of optimization
transformations performed at first execution, as sp_instr_copen saw that the
query is already "EXECUTED" and therefore either not ran first-execution
related blocks or wrongly rolled back the transformations caused by
first-execution code.
The fix is to update the state of the parsed tree only when the tree is
executed, as opposed to when the instruction containing the tree is executed.
Assignment if i->state is moved to reset_lex_and_exec_core.
mysql-test/r/sp.result:
Test results fixed (Bug#15217)
mysql-test/t/sp.test:
Add a test case for Bug#15217
sql/sp_head.cc:
Move assignment of stmt_arena->state to reset_lex_and_exec_core
into mysql.com:/mnt/raid/alik/MySQL/devel/5.1-rt-bug20294
mysql-test/t/disabled.def:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
mysql-test/r/partition.result:
New test case
mysql-test/t/partition.test:
New test case
sql/ha_partition.cc:
Ensure index_last always uses ordered index scan
Some values were not initialized, causing Valgrind errors (and potential
random bugs):
- NDB binlog thread thd->variables.pseudo_thread_id.
- Table null bits.
- Field bytes for columns with NULL values.
sql/ha_ndbcluster_binlog.cc:
Fix initialization of thd->variables.pseudo_thread_id.
Change double alloc_root() call to multi_alloc_root().
Fix missing initialization of null bits.
sql/sql_class.cc:
Do not read from the supplied record for NULL values, use the default
value record instead.
Otherwise we will get Valgrind errors about uninitialised values written
to binlog, as NDB does not initialize the memory in records for NULL
fields.
into dator5.(none):/home/pappa/bug17138
mysql-test/r/partition.result:
Auto merged
mysql-test/t/partition.test:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/handler.cc:
Generating table maps from all locks that can be available: THD::extra_lock,
THD::lock, and THD::locked_tables.
sql/sql_class.h:
Adding member Open_tables:state::extra_lock to hold the extra lock used by select_create.
Removing select_insert::lock.
sql/sql_insert.cc:
Adding member Open_tables:state::extra_lock to hold the extra lock used by select_create.
Removing select_insert::lock.
Introduced EVENTS.EVENT_DEFINITION, like ROUTINES.ROUTINE_DEFINITION
Hence, the contents of the current EVENTS.EVENT_BODY become the contents
of EVENT_DEFINITION. EVENT_BODY will contain always, for now, "SQL" (wo
quotes).
mysql-test/r/events.result:
update result
event_body -> event_definition
event_body -> SQL
mysql-test/r/events_grant.result:
update result
event_body -> event_definition
event_body -> SQL
mysql-test/r/information_schema.result:
update result
event_body -> event_definition
mysql-test/t/events.test:
update result
event_body -> event_definition
event_body -> SQL
mysql-test/t/events_grant.test:
update result
event_body -> event_definition
event_body -> SQL
sql/sql_show.cc:
Introduce enum_i_s_events_fields, because I hate recounting
all the time a field is changed.
Rename EVENT_BODY to EVENT_DEFINITION
Introduce EVENT_BODY after that to be "SQL"
(final fix for bug#16992 Events: Information schema troubles ) ?
into mysql.com:/home/my/mysql-5.1
mysql-test/extra/rpl_tests/rpl_log.test:
Auto merged
mysql-test/r/rpl_ndb_log.result:
Auto merged
mysql-test/r/rpl_row_log.result:
Auto merged
mysql-test/r/rpl_row_log_innodb.result:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/mysql_priv.h:
SCCS merged
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
sql/ha_ndbcluster.cc:
Auto merged
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
Auto merged
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Auto merged
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Auto merged
create tablespace/logfile group should "back out changes"
mysql-test/r/ndb_dd_ddl.result:
add testcase for bug#16341
mysql-test/t/ndb_dd_ddl.test:
add testcase for bug#16341
sql/ha_ndbcluster.cc:
If create data/undo file fails, check if filegroup is same version, and if it is drop it (wo/ checking error)
storage/ndb/include/kernel/signaldata/CreateFilegroup.hpp:
add version to createfileconf
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Add NdbDictionary::ObjectId, that can be used to get [ id, version ] during create (only for DD object so far)
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
add version to createfileconf
storage/ndb/src/ndbapi/NdbDictionary.cpp:
Add NdbDictionary::ObjectId, that can be used to get [ id, version ] during create (only for DD object so far)
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
Add NdbDictionary::ObjectId, that can be used to get [ id, version ] during create (only for DD object so far)
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Add NdbDictionary::ObjectId, that can be used to get [ id, version ] during create (only for DD object so far)
Review comments
mysql-test/t/partition.test:
Changed procedure names ensured procedures were dropped
sql/ha_ndbcluster.h:
Improved name of method
sql/ha_partition.h:
Improved name of method
sql/handler.h:
Improved name of method
Removed deprecated constants
sql/item_sum.cc:
Improved name of method
sql/sql_acl.cc:
Improved name of method
sql/sql_insert.cc:
Removed use of HA_WRITE_SKIP and introduced is_fatal_error instead
sql/sql_select.cc:
Improved name of method
sql/sql_table.cc:
Improved name of method
Reintroduced dead code for future possible use
sql/sql_union.cc:
Improved name of method
sql/sql_update.cc:
Improved name of method
into bk-internal.mysql.com:/data0/bk/mysql-5.1-kt
mysql-test/r/partition_error.result:
Auto merged
sql/mysql_priv.h:
Auto merged
mysql-test/r/partition.result:
Auto merged
This bug in Field_string::cmp resulted in a wrong comparison
with keys in partial indexes over multi-byte character fields.
Given field a is declared as a varchar(16) collate utf8_unicode_ci
INDEX(a(4)) gives us an example of such an index.
Wrong key comparisons could lead to wrong result sets if
the selected query execution plan used a range scan by
a partial index over a utf8 character field.
This also caused wrong results in many other cases.
mysql-test/t/ctype_utf8.test:
Added test cases for bug #14896.
mysql-test/r/ctype_utf8.result:
Added test cases for bug #14896.
sql/field.cc:
Fixed bug #14896.
This bug in Field_string::cmp resulted in a wrong comparison
with keys in partial indexes over multi-byte character fields.
Given field a is declared as a varchar(16) collate utf8_unicode_ci
INDEX(a(4)) gives us an example of such an index.
Wrong key comparisons could lead to wrong result sets if
the selected query execution plan used a range scan by
a partial index over a utf8 character field.
This also caused wrong results in many other cases.
into bk-internal.mysql.com:/data0/bk/mysql-5.1-kt
mysql-test/r/show_check.result:
Auto merged
sql/log.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sql_delete.cc:
Auto merged
include/my_libwrap.h:
Changed includes to the header file.
mysys/my_libwrap.c:
Added comment and .c file now takes needed includes from
the corresponding .h file.
sql/mysqld.cc:
Include this block from my_libwra.h now.
Moved two variables out of the otherwise
same block.
Need to flag when a copy is needed to not overwrite a create_info
object connected to the lex structure
sql/mysql_priv.h:
Need to flag when a copy is needed to not overwrite a create_info
object connected to the lex structure
sql/sql_insert.cc:
Need to flag when a copy is needed to not overwrite a create_info
object connected to the lex structure
sql/sql_parse.cc:
Need to flag when a copy is needed to not overwrite a create_info
object connected to the lex structure
sql/sql_table.cc:
Need to flag when a copy is needed to not overwrite a create_info
object connected to the lex structure
into may.pils.ru:/home/svoj/devel/mysql/BUG20357/mysql-5.0
mysql-test/r/myisam.result:
Auto merged
mysql-test/t/myisam.test:
Auto merged
sql/opt_sum.cc:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
functions in queries
Using MAX()/MIN() on table with disabled indexes (by ALTER TABLE)
results in error 124 (wrong index) from storage engine.
The problem was that optimizer use disabled index to optimize
MAX()/MIN(). Normally it must skip disabled index and perform
table scan.
This patch skips disabled indexes for min/max optimization.
mysql-test/r/myisam.result:
Test case for BUG#20357.
mysql-test/t/myisam.test:
Test case for BUG#20357.
sql/opt_sum.cc:
Skip disabled/ignored indexes for min/max optimization.
Fix race between cleanup and thread kill at server shutdown that would
sometimes prevent proper cleanup, leading to Valgrind warnings.
sql/mysqld.cc:
Move logger cleanup to avoid races with thread kill.