SHOW CREATE TRIGGER was not checking for detected errors
opening/reading the trigger file.
Fixed to return the already generated error.
mysql-test/r/trigger.result:
Bug #31866: test case
mysql-test/t/trigger.test:
Bug #31866: test case
sql/sql_show.cc:
Bug #31866: test for error and return it.
into janus.mylan:/usr/home/serg/Abk/mysql-5.1
client/mysqldump.c:
Auto merged
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/r/mysqldump.result:
Auto merged
mysql-test/t/mysqldump.test:
Auto merged
sql/handler.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
tests/mysql_client_test.c:
Auto merged
during udf initialization. The bug is spotted while working on Bug 12713.
If a user-defined function was used in a SELECT statement, and an
error would occur during UDF initialization, this error would not terminate
execution of the SELECT, but rather would be converted to a warning.
The fix is to use a stack buffer to store the message from udf_init instead
of private my_error() buffer.
mysql-test/r/udf.result:
Update the result to reflect the fix for Bug#32007 select udf_function()
doesn't return an error if error during udf initialization
mysql-test/t/udf.test:
Update the test to reflect the fix for Bug #32007 select udf_function()
doesn't return an error if error during udf initialization
sql/item_func.cc:
A fix for Bug#32007.
net.last_error buffer was used to store the temporary message from udf_init.
Then, when my_error() was called, net.last_error was not empty so
my_error() would conclude that there is already an error in the error stack,
and not "overwrite" it.
However, thd->net.report_error was not set, so the the
SELECT was not aborted.
The fix is to use a stack buffer instead of thd->net.last_error
to store the message from udf_init. The message will end up in
thd->net.last_error anyway after a call to my_error.
check_user()/check_connection()/check_for_max_user_connections().
This is a pre-requisite patch for the fix for Bug#12713 "Error in a stored
function called from a SELECT doesn't cause ROLLBACK of statem"
Implement review comments.
sql/mysql_priv.h:
check_for_max_user_connections() is used in one place only, make it static.
sql/mysqld.cc:
Remove net_printf_error(): a consolidation of error reporting facilities
is necessary to simplify maintenance of the query cache, the
client-server protocol, stored procedure continue handlers.
Rewrite the only place where its use is somewhat justified
(my_error() can not be used since we need to report an error for the thread
that does not exist) with my_snprintf()/net_send_error().
sql/protocol.cc:
Remove net_printf_error().
sql/protocol.h:
Remove net_printf_error().
sql/sql_connect.cc:
Remove net_printf_error(). In check_connection()/check_user()/
check_for_max_user_connections() do not write directly to the network,
but use the standard my_error() mechanism to record an error in THD.
It will be sent to the client by the caller. This was the last place
in the server that would attempt to send an error directly, mainly left
untouched by 5.0 refactoring because it is executed only during
thread startup.
sql/sql_parse.cc:
In the old code, when res was greater than 0, it contained an exact
error code, e.g. ER_OUT_OF_RESOURCES or NO SUCH DATABASE,
or ER_HANDSHAKE_ERROR. I don't know the reason why this error code was
ignored, and instead a generic ER_UNKNOWN_COM_ERROR was pushed into the
error stack, but knowing the relaxed attitude towards preserving the error
codes in the old code, I'm inclinded to think that it was a bug.
After this patch, the most specific error message is already pushed,
so calling my_message() again is useless.
If res is < 0, the error used to be already sent. This is not done
by the new code, but will be done later, in the end
of dispatch_command(). When this is done, clear_error() will be called
for us - it is in the first lines of do_command.
To sum up, this change is to remove COM_CHANGE_USER specific error handling
in favor of the standard one employed for all other COM_* commands.
Marking statements containing USER() or CURRENT_USER() as unsafe, causing
them to switch to using row-based logging in MIXED mode and generate a
warning in STATEMENT mode.
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
Result change.
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
Adding test to check that USER() and CURRENT_USER() cause a switch
to row-based logging.
sql/sql_yacc.yy:
Setting statements containing USER() or CURRENT_USER() to be unsafe.
Add select_send::cleanup.
Fix a compilation warning.
Issues spotted while working on the fix for Bug#12713.
sql-common/client.c:
Fix a warning.
sql/sql_class.cc:
Give a variable a more specific name. Rewrite an incorrect comment.
Add a cleanup for select_send. The only case now this cleanup can be
necessary is when we have a prepared statement inside a stored procedure,
and a continue handler. At first execution, the statement is killed
after having executed select_send::send_fields. At the second execution
it is killed after having executed select_send::send_fields.
sql/sql_class.h:
Rename a member. Add comments.
into stella.local:/home2/mydev/mysql-5.1-axmrg
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/ha_partition.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
The new default database engine for altered table was reassigned to
the old one. That's wrong thing by itself, and (as the engine
for a subpartition gets that new value) leads to DBUG_ASSERTION
in mysql_unpack_partition()
mysql-test/r/partition.result:
Bug #31893 Partitions: crash if subpartitions and engine change.
test result
mysql-test/t/partition.test:
Bug #31893 Partitions: crash if subpartitions and engine change.
test case
sql/sql_partition.cc:
Bug #31893 Partitions: crash if subpartitions and engine change.
Don't change part_info->default_engine_type if it's already set
into stella.local:/home2/mydev/mysql-5.0-axmrg
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
sql/item_func.cc:
Auto merged
Dropping users causes huge increase in memory usage because field values were
allocated on the server memory root for temporary usage but never deallocated.
This patch changes the target memory root to be that of the thread handler
instead since this root is cleared between each statement.
sql/sql_acl.cc:
Changed memory root from server life time memory to thread life time memory.
The SET PASSWORD statement is non-transactional (no explicit transaction
boundaries) in nature and hence is forbidden inside stored functions and
triggers, but it weren't being effectively forbidden.
The implemented fix is to issue a implicit commit with every SET PASSWORD
statement, effectively prohibiting these statements in stored functions
and triggers.
mysql-test/r/sp-error.result:
Add test case result for Bug#30904
mysql-test/t/sp-error.test:
Add test case for Bug#30904
sql/sql_lex.h:
Add variable to set that a statement with SET PASSWORD causes a implicit
commit.
sql/sql_parse.cc:
End active transaction in SET PASSWORD.
sql/sql_yacc.yy:
Set the correct flag on SET PASSWORD if inside a SP, thus effectively
prohibiting SET PASSWORD statements in stored functions and triggers.
The rpl_trigger test case indicated a problem with idempotency support when run
under row-based replication, which this patch fixes.
However, despite this, the test is not designed for execution under row-based
replication and hence rpl_trigger.test is not executed under row-based
replication.
The problem is that the test expects triggers to be executed when the slave
updates rows on the slave, and this is (deliberately) not done with row-based
replication.
sql/log_event.cc:
Adding function to print symbolic name of handler errors for debug purposes.
Ignoring some more error messages to provide full idempotency support for
update and delete operations.
mysql-test/suite/rpl/r/rpl_idempotency.result:
New BitKeeper file ``mysql-test/suite/rpl/r/rpl_idempotency.result''
mysql-test/suite/rpl/t/rpl_idempotency.test:
New BitKeeper file ``mysql-test/suite/rpl/t/rpl_idempotency.test''
and convert it to a warning instead of direct manipulation with the
thread error stack.
Fix a bug in handler::print_erorr when a garbled message was
printed for HA_ERR_NO_SUCH_TABLE.
This is a pre-requisite patch for the fix for Bug#12713 Error in a stored
function called from a SELECT doesn't cause ROLLBACK of statem
sql/handler.cc:
Use a standard mechanism to intercept the error message, instead
of direct manipulation with thread error stack.
Fix a bug when for HA_ERR_NO_SUCH_TABLE handler::print_error() would
print a garbled message.
sql/log.cc:
Extend internal error handler interface to carry the message text.
sql/mysqld.cc:
Extend internal error handler interface to carry the message text.
sql/sql_base.cc:
Extend internal error handler interface to carry the message text.
sql/sql_class.cc:
Extend internal error handler interface to carry the message text.
sql/sql_class.h:
Extend internal error handler interface to carry the message text.
sql/sql_error.cc:
Extend internal error handler interface to carry the message text.
into magare.gmz:/home/kgeorge/mysql/work/B31884-5.1-opt
sql/item_subselect.h:
Auto merged
mysql-test/r/subselect.result:
merged the fix for bug 31884 to 5.1-opt
mysql-test/t/subselect.test:
merged the fix for bug 31884 to 5.1-opt
Item_in_subselect's only externally callable method is val_bool().
However the nullability in the wrapper class (Item_in_optimizer) is
established by calling the "forbidden" method val_int().
Fixed to use the correct method (val_bool() ) to establish nullability
of Item_in_subselect in Item_in_optimizer.
mysql-test/r/subselect.result:
Bug #31884: test case
mysql-test/t/subselect.test:
Bug #31884: test case
sql/item_subselect.h:
Bug #31884: Use the correct method to establish nullability
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge
mysql-test/suite/rpl/r/rpl_bug31076.result:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/sql_update.cc:
Auto merged
storage/ndb/include/ndbapi/Ndb.hpp:
Auto merged
mysql-test/suite/rpl/t/rpl_bug31076.test:
manual merge
into koti.dsl.inet.fi:/home/elkin/MySQL/5.1-merge-bug27571
client/mysql.cc:
Auto merged
mysql-test/r/ctype_euckr.result:
Auto merged
mysql-test/r/ctype_uca.result:
Auto merged
mysql-test/suite/binlog/r/binlog_killed.result:
Auto merged
mysql-test/suite/binlog/t/binlog_killed.test:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/log_event.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
strings/ctype-euc_kr.c:
Auto merged
mysql-test/suite/rpl/r/rpl_sp_effects.result:
manual merge ul
mysql-test/suite/rpl/t/rpl_sp_effects.test:
manual merge
sql/slave.cc:
leaving for manual merge
sql/sql_delete.cc:
leaving for manual merge
sql/sql_insert.cc:
leaving for manual merge
sql/sql_load.cc:
leaving for manual merge
sql/sql_update.cc:
leaving for manual merge
Item_func_inet_ntoa and Item_func_conv inherit 'maybe_null' flag from an
argument, which is wrong.
Both can be NULL with notnull arguments, so that's fixed.
mysql-test/r/func_str.result:
Bug #31758 inet_ntoa, oct crashes server with null+filesort
test case
mysql-test/t/func_str.test:
Bug #31758 inet_ntoa, oct crashes server with null+filesort
test result
sql/item_strfunc.h:
Bug #31758 inet_ntoa, oct crashes server with null+filesort
missing maybe_null flags set for Item_func_inet_ntoa and Item_func_conv
into mysql.com:/home/bar/mysql-work/mysql-5.0-rpl-merge
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/r/func_regexp.result:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
mysql-test/t/func_regexp.test:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_update.cc:
Auto merged
mysql-test/r/ctype_ucs.result:
After merge fix
mysql-test/t/ctype_ucs.test:
After merge fix
into mysql.com:/home/bar/mysql-work/mysql-5.1-new-rpl-merge
client/mysql.cc:
Auto merged
mysql-test/r/ctype_euckr.result:
Auto merged
mysql-test/r/ctype_uca.result:
Auto merged
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/r/func_regexp.result:
Auto merged
mysql-test/suite/rpl/r/rpl_bug31076.result:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
mysql-test/t/func_regexp.test:
Auto merged
mysql-test/t/partition.test:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/handler.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_xmlfunc.cc:
Auto merged
sql/log.cc:
Auto merged
sql/log.h:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_repl.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_update.cc:
Auto merged
strings/ctype-euc_kr.c:
Auto merged
sql/sql_yacc.yy:
Reverting Rafal's changes: TRANSACTIONAL_SYM was removed in a mistake.
mysql-test/r/ctype_ucs.result:
After merge fix
mysql-test/suite/rpl/t/rpl_bug31076.test:
After merge fix.
mysql-test/t/ctype_ucs.test:
After megre fix
into lambda.weblab:/home/malff/TREE/mysql-5.1-rt-merge
mysql-test/include/mix1.inc:
Auto merged
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/r/select.result:
Auto merged
sql/handler.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/protocol.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
into mysql.com:/home/ram/work/b31137/b31137.5.1
sql/sql_table.cc:
Auto merged
sql/structs.h:
Auto merged
mysql-test/include/mix1.inc:
will merge tests manually
mysql-test/r/innodb_mysql.result:
will merge tests manually
mysql-test/r/key.result:
will merge tests manually
mysql-test/t/key.test:
will merge tests manually
include/my_base.h:
manual merge.
Query_log_event::error_code
A query can perform completely having the local var error of mysql_$query
zero, where $query in insert, update, delete, load,
and be binlogged with error_code e.g KILLED_QUERY while there is no
reason do to so.
That can happen because Query_log_event consults thd->killed flag to
evaluate error_code.
Fixed with implementing a scheme suggested and partly implemented at
time of bug@22725 work-on. error_status is cached immediatly after the
control leaves the main rows-loop and that instance always corresponds
to `error' the local of mysql_$query functions. The cached value
is passed to Query_log_event constructor, not the default thd->killed
which can be changed in between of the caching and the constructing.
mysql-test/r/binlog_killed.result:
results changed
mysql-test/t/binlog_killed.test:
Demonstrating that effective killing during rows-loop execution leads to the speficied actions:
binlogging with the error for a query modified a not-transactional table or
rolling back effects for transactional table;
fixing possible non-determinism with ID when query_log_enabled;
leave commented out tests for multi-update,delete due to another bug;
removing an obsolete tests template;
changing system rm to --remove_file.
sql/log_event.cc:
adding killed status arg
sql/log_event.h:
added killed status arg
sql/sql_delete.cc:
deploying the update part patch for delete, multi-delete
sql/sql_insert.cc:
deploying the update-part patch for insert..select
sql/sql_load.cc:
deploying the update-part patch for load data.
simulation added.
sql/sql_update.cc:
Impementing the fix as described in the comments left by bug@22725.
Also simulation of killing after the loop that would affect binlogging in the old code.
mysql-test/t/binlog_killed_bug27571-master.opt:
post rows-loop killing simulation's options
mysql-test/t/binlog_killed_bug27571.test:
Checking that if killing happens inbetween of the end of rows loop and
recording into binlog that will not lead to recording any error incl
the killed error.
mysql-test/t/binlog_killed_simulate-master.opt:
simulation options
mysql-test/t/binlog_killed_simulate.test:
tests for
a query (update is choosen) being killed after the row-loop;
load data killed within the loop - effective killed error in the event is gained.
rebuild the table.
The problem was that ROW_FORMAT clause in ALTER TABLE did not trigger
table reconstruction.
The fix is to rebuild a table if ROW_FORMAT is specified.
mysql-test/include/mix1.inc:
Add a test case for BUG#27610: ALTER TABLE ROW_FORMAT=... does not
rebuild the table.
mysql-test/r/innodb_mysql.result:
Update result file.
sql/sql_table.cc:
Rebuild a table if ROW_FORMAT was specified in ALTER TABLE.
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
mysql-test/r/type_decimal.result:
Auto merged
mysql-test/t/type_decimal.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
There are two problems with ROUND(X, D) on an exact numeric
(DECIMAL, NUMERIC type) field of a table:
1) The implementation of the ROUND function would change the number of decimal
places regardless of the value decided upon in fix_length_and_dec. When the
number of decimal places is not constant, this would cause an inconsistent
state where the number of digits was less than the number of decimal places,
which crashes filesort.
Fixed by not allowing the ROUND operation to add any more decimal places than
was decided in fix_length_and_dec.
2) fix_length_and_dec would allow the number of decimals to be greater than
the maximium configured value for constant values of D. This led to the same
crash as in (1).
Fixed by not allowing the above in fix_length_and_dec.
mysql-test/r/type_decimal.result:
Bug#30889: Test result
mysql-test/t/type_decimal.test:
Bug#30889: Test case
sql/item_func.cc:
Bug#30889:
- Avoid setting number of digits after decimal point (scale) higher than its
maximum value.
- Avoid increasing the number of decimal places in ::decimal_op
sql/item_func.h:
Bug#30889: Added comments to the declarations of Item_func_numhybrid::<type>_op
family of methods.
into trift2.:/MySQL/M50/push-5.0
mysql-test/r/derived.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/sp.result:
Auto merged
mysql-test/r/type_datetime.result:
Auto merged
mysql-test/t/derived.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/field.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
mysql-test/r/type_date.result:
Null-merge 5.0.50 build clone:
The test for bug#31221 is already in the receiving tree.
mysql-test/t/type_date.test:
Null-merge 5.0.50 build clone:
The test for bug#31221 is already in the receiving tree.
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_sum.cc:
Auto merged
The fix is a copy of Martin Friebe's suggestion.
added testing for no_appended which will be false if anything,
including the empty string is in result
mysql-test/r/func_gconcat.result:
test result
mysql-test/t/func_gconcat.test:
test case
sql/item_sum.cc:
added testing for no_appended which will be False if anything,
including the empty string is in result
JOIN, and ORDER BY
Problem: improper maximum length calculation of the CASE function leads to
decimal value truncation (storing/retrieving decimal field values).
Fix: accurately calculate maximum length/unsigned flag/decimals parameters
of the CASE function.
mysql-test/r/case.result:
Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE,
JOIN, and ORDER BY
- test result.
mysql-test/t/case.test:
Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE,
JOIN, and ORDER BY
- test case.
sql/item_cmpfunc.cc:
Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE,
JOIN, and ORDER BY
- accurately calculate Item_func_case::max_length/unsigned_flag/decimals.
sql/item_cmpfunc.h:
Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE,
JOIN, and ORDER BY
- accurately calculate Item_func_case::max_length/unsigned_flag/decimals.
into polly.(none):/home/kaa/src/opt/mysql-5.1-opt
mysql-test/r/variables.result:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
into polly.(none):/home/kaa/src/opt/mysql-5.0-opt
mysql-test/r/variables.result:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
into gleb.loc:/home/uchum/work/bk/5.1-opt
mysql-test/r/type_decimal.result:
Auto merged
mysql-test/t/type_decimal.test:
Auto merged
sql/item.cc:
Auto merged
Adding code to keep skipping events while inside a transaction. Execution
will start just after the transaction has been skipped.
sql/slave.cc:
Adding code to set the thd->options flag for the slave SQL thread
even when BEGIN, ROLLBACK, COMMIT, and XID events are being skipped.
Adding code to not decrease the slave skip counter from 1 to 0 if we
are inside a transaction. This will keep the counter at 1, and keep
skipping events, until a transaction terminator is read. At that point,
the slave skip counter will be decreased to 0, and events will be read
and executed instead of read and skipped.
mysql-test/r/rpl_slave_skip.result:
New BitKeeper file ``mysql-test/r/rpl_slave_skip.result''
mysql-test/t/rpl_slave_skip-slave.opt:
New BitKeeper file ``mysql-test/t/rpl_slave_skip-slave.opt''
mysql-test/t/rpl_slave_skip.test:
New BitKeeper file ``mysql-test/t/rpl_slave_skip.test''
into gleb.loc:/home/uchum/work/bk/5.1-opt
mysql-test/r/select.result:
Auto merged
mysql-test/r/type_decimal.result:
Auto merged
mysql-test/t/select.test:
Auto merged
mysql-test/t/type_decimal.test:
Auto merged
sql/item.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/share/errmsg.txt:
Merge with 5.0-opt
file .\ha_innodb.
Problem: if a partial unique key followed by a non-partial one we declare
the second one as a primary key.
Fix: sort non-partial unique keys before partial ones.
include/my_base.h:
Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0,
file .\ha_innodb.
- sort unique keys that don't contain partial segments before other keys:
set HA_KEY_HAS_PART_KEY_SEG flag for such keys in the mysql_prepare_table(),
use it in the sort_keys();
mysql-test/r/innodb_mysql.result:
Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0,
file .\ha_innodb.
- test result.
mysql-test/r/key.result:
Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0,
file .\ha_innodb.
- test result.
mysql-test/t/innodb_mysql.test:
Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0,
file .\ha_innodb.
- test case.
mysql-test/t/key.test:
Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0,
file .\ha_innodb.
- test case.
sql/sql_table.cc:
Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0,
file .\ha_innodb.
- sort unique keys that don't contain partial segments before other keys:
set HA_KEY_HAS_PART_KEY_SEG flag for such keys in the mysql_prepare_table(),
use it in the sort_keys();
sql/structs.h:
Fix for bug #31137: Assertion failed: primary_key_no == -1 || primary_key_no == 0,
file .\ha_innodb.
- sort unique keys that don't contain partial segments before other keys:
set HA_KEY_HAS_PART_KEY_SEG flag for such keys in the mysql_prepare_table(),
use it in the sort_keys();
SHOW FIELDS FROM a view with no valid definer was possible (since fix
for Bug#26817), but gave NULL as a field-type. This led to mysqldump-ing
of such views being successful, but loading such a dump with the client
failing. Patch allows SHOW FIELDS to give data-type of field in underlying
table.
mysql-test/r/information_schema_db.result:
Fix test results: SHOW FIELDS FROM a view with no valid DEFINER
gives us the field-type of the underlying table now rather than NULL.
sql/sql_base.cc:
In the case of SHOW FIELDS FROM <view>, do not require a valid
DEFINER for determining underlying data-type like we usually do.
This is needed for mysqldump.
"Dynamic plugins fail to load on FreeBSD"
ELF executables need to be linked using the -export-dynamic option to
ld(1) for symbols defined in the executable to become visible to dlsym().
Also, do not build plugins on an all-static build.
configure.in:
Bug#30296
Use "-export-dynamic" when building executable for use with plugins.
Add required option using MYSQLD_EXTRA_LDFLAGS variable so we do not
affect any other binary.
config/ac-macros/plugins.m4:
Do not build plugins when building all-static
sql/sql_yacc.yy:
build fix - surplus semicolon
doesn't recognize it
This is a 5.1 version of the patch.
Problem:
'log' and 'log_slow_queries' were "fixed" variables, i.e. they showed up
in SHOW VARIABLES, but could not be used in expressions like
"select @@log". Also, using them in the SET statement produced an
incorrect "unknown system variable" error.
Solution:
Since as of MySQL 5.1.12 one can enable or disable the general query log
or the slow query log at runtime by changing values of
general_log/slow_query_log, make 'log' and 'log_slow_queries" to be
synonyms for 'general_log' and 'slow_query_log' respectively. This
makes expressions using the '@@var' syntax backward compatible with
5.0 and SHOW VARIABLES output to be consistent with the SET statement.
mysql-test/r/log_state.result:
Added a test case for bug #29131.
mysql-test/t/log_state.test:
Added a test case for bug #29131.
sql/set_var.cc:
Made the 'log' and 'log_slow_queries' system variables to be synonyms for 'general_log' and 'slow_query_log'.
doesn't recognize it
This is a 5.0 version of the patch, it will be null-merged to 5.1
Problem:
'log' and 'log_slow_queries' were "fixed" variables, i.e. they showed up
in SHOW VARIABLES, but could not be used in expressions like
"select @@log". Also, using them in the SET statement produced an
incorrect "unknown system variable" error.
Solution:
Make 'log' and 'log_slow_queries' read-only dynamic variables to make
them available for use in expressions, and produce a correct error
about the variable being read-only when used in the SET statement.
mysql-test/r/variables.result:
Added a test case for bug #29131.
mysql-test/t/variables.test:
Added a test case for bug #29131.
sql/mysql_priv.h:
Changed the type of opt_log and opt_slow_log to my_bool to
align with the interfaces in set_var.cc
sql/mysqld.cc:
Changed the type of opt_log and opt_slow_log to my_bool to
align with the interfaces in set_var.cc
sql/set_var.cc:
Made 'log' and 'log_slow_queries' to be read-only dynamic system
variable, i.e. available for use in expressions with the @@var syntax.
sql/set_var.h:
Added a new system variable class representing a read-only boolean
variable.
Documented some binlog events using doxygen. More will be done later.
Also fixed typos in other comments and added remarks about dubious code.
Only comments are affected, there is no change to the actual code.
sql/log_event.cc:
Fixed typos in some comments.
Added remarks (as comments) about questionable code.
sql/log_event.h:
Documented the binary format of following binlog events:
Log_event
Query_log_event
Muted_query_log_event
Slave_log_event (partial)
Load_log_event
Intvar_log_event
Rand_log_event
Rotate_log_event (partial)
sql/sql_class.h:
Fixed typo in comment.
into loke.(none):/home/knielsen/devel/mysql-5.1-new-ndb
storage/ndb/include/kernel/AttributeHeader.hpp:
Auto merged
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
Auto merged
storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp:
Auto merged
storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp:
Auto merged
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
Auto merged
sql/ha_ndbcluster.cc:
manual merge.
all space column names.
The parser has been modified to check VIEW column names
with the check_column_name function and to report an error
on empty and all space column names (same as for TABLE
column names).
sql/sql_yacc.yy:
Fixed bug #27695.
The parser has been modified to check VIEW column aliases
with the check_column_name function and to report an error
on empty columns and all space columns (same as for TABLE
column names).
mysql-test/t/select.test:
Updated test case for bug #27695.
mysql-test/r/select.result:
Updated test case for bug #27695.
The root cause of this defect is that a call to my_error() is using a
'LEX_STRING' parameter instead of a 'char*'
This patch fixes the failing calls to my_error(), as well as similar calls
found during investigation.
This is a compiling bug (see the instrumentation in the bug report), no test cases provided.
sql/sql_base.cc:
Fix broken calls to "..." (va_args) functions.
sql/sql_table.cc:
Fix broken calls to "..." (va_args) functions.
replication):
Incremental patch to enable idempotency support for update events again.
The final handling of errors will be done in BUG#31609, and until then
the handling of errors should be consistent between the different types
of changes.
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
Result change.
mysql-test/suite/rpl/r/rpl_temporary_errors.result:
Result change.
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
Changing test to assume idempotency handling of update event.
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
Changing test to assume idempotency handling of update event.
sql/log_event.cc:
Incremental patch to enable idempotency support for the update events again.
The real error handling will be implemented in BUG#31609.
into mysql.com:/home/svoj/devel/mysql/BUG31159/mysql-5.0-engines
include/my_sys.h:
Auto merged
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
mysys/charset.c:
Manual merge.
sql/item_func.cc:
Manual merge.
ucs2 doesn't provide required by fulltext ctype array. Crash
happens because fulltext attempts to use unitialized ctype
array.
Fixed by converting ucs2 fields to compatible utf8 analogue.
include/my_sys.h:
Added a function to find compatible character set with ctype array
available. Currently used by fulltext search to find compatible
substitute for ucs2 collations.
mysql-test/r/ctype_ucs.result:
A test case for BUG#31159.
mysql-test/t/ctype_ucs.test:
A test case for BUG#31159.
mysys/charset.c:
Added a function to find compatible character set with ctype array
available. Currently used by fulltext search to find compatible
substitute for ucs2 collations.
sql/item_func.cc:
Convert ucs2 fields to utf8. Fulltext requires ctype array, but
ucs2 doesn't provide it.
into magare.gmz:/home/kgeorge/mysql/work/B30715-merged-5.1-opt
mysql-test/r/func_group.result:
Auto merged
mysql-test/r/type_decimal.result:
Auto merged
mysql-test/t/func_group.test:
Auto merged
mysql-test/t/type_decimal.test:
Auto merged
sql/item.cc:
Auto merged
sql/opt_sum.cc:
merge bug 30715 to 5.1-opt
file .\opt_sum.cc, line
The optimizer pre-calculates the MIN/MAX values for queries like
SELECT MIN(kp_k) WHERE kp_1 = const AND ... AND kp_k-1 = const
when there is a key over kp_1...kp_k
In doing so it was not checking correctly nullability and
there was a superfluous assert().
Fixed by making sure that the field can be null before checking and
taking out the wrong assert().
.
Introduced a correct check for nullability
The MIN(field) can return NULL when all the row values in the group
are NULL-able or if there were no rows.
Fixed the assertion to reflect the case when there are no rows.
mysql-test/r/func_group.result:
Bug #30715: test case
mysql-test/t/func_group.test:
Bug #30715: test case
sql/opt_sum.cc:
Bug #30715: correct nullability check for MIN/MAX pre-calculation over index.
into station.:/mnt/raid/alik/MySQL/devel/5.1-rt
mysql-test/r/select.result:
Auto merged
mysql-test/t/select.test:
Auto merged
sql/sql_table.cc:
Auto merged
into mysql.com:/home/bar/mysql-work/mysql-5.0-rpl-mr
client/mysql.cc:
Auto merged
mysql-test/r/ctype_euckr.result:
Auto merged
mysql-test/r/ctype_uca.result:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
strings/ctype-euc_kr.c:
Auto merged
into mattiasj-laptop.(none):/home/mattiasj/clones/mysql-5.1-bug30878
mysql-test/r/partition.result:
Auto merged
mysql-test/t/partition.test:
Auto merged
sql/sql_partition.cc:
Auto merged
causes the Server to crash.
Accessing partitioned table with an apostrophe in partition options
like DATA DIRECTORY, INDEX DIRECTORY or COMMENT causes server crash.
Partition options were saved in .frm file without escaping.
When accessing such table it is not possible to properly restore
partition information.
Crashed because there was no check for partition info parser failure.
Fixed by escaping quoted text in the partition info when writing it to
the frm-file and added a check that it was able to parse the partition
info before using it
NOTE: If the comment is written by an earlier version of the server,
the corrupted frm-file is not fixed, but left corrupted, you have to
manually drop the table and recreate it.
mysql-test/r/partition.result:
bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes
the Server to crash.
testresult
mysql-test/t/partition.test:
bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes
the Server to crash.
testcase
sql/sql_partition.cc:
Bug #30695: An apostrophe ' in the comment of the ADD PARTITION causes
the Server to crash.
Crashes when there is an non escaped apostrophe in the partition options
fixed by escaping quoted text before writing to the frm-file
sql/table.cc:
Bug #30695 An apostrophe ' in the comment of the ADD PARTITION
causes the Server to crash
problem was using a null poiter without check -> crash.
added a check that the previus call succeded
- Let Item::save_in_field() call set_field_to_null_with_conversions()
for decimal type, like this is done for the other item result types.
mysql-test/r/type_decimal.result:
BUG#31450: Query causes error 1048: testcase
mysql-test/t/type_decimal.test:
BUG#31450: Query causes error 1048: testcase
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
client/client_priv.h:
Auto merged
client/mysqldump.c:
Auto merged
include/config-win.h:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/func_sapdb.result:
Auto merged
mysql-test/r/information_schema.result:
Auto merged
mysql-test/r/variables.result:
Auto merged
mysql-test/t/information_schema.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/field.cc:
Auto merged
sql/ha_partition.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_timefunc.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/protocol.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
storage/innobase/handler/ha_innodb.cc:
Auto merged
storage/myisam/sort.c:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/r/query_cache.result:
manual merge
mysql-test/include/mix1.inc:
manual merge
mysql-test/r/innodb_mysql.result:
manual merge
mysql-test/r/type_datetime.result:
manual merge
mysql-test/r/type_decimal.result:
manual merge
mysql-test/t/query_cache.test:
manual merge
mysql-test/t/type_datetime.test:
manual merge
mysql-test/t/type_decimal.test:
manual merge
sql/item.cc:
manual merge
Inserting Data.
The problem was that under some circumstances Field class was not
properly initialized before calling create_length_to_internal_length()
function, which led to assert failure.
The fix is to do the proper initialization.
The user-visible problem was that under some circumstances
CREATE TABLE ... SELECT statement crashed the server or led
to wrong error message (wrong results).
mysql-test/r/select.result:
Update result file.
mysql-test/t/select.test:
Add a test case for BUG#30736: Row Size Too Large Error
Creating a Table and Inserting Data.
sql/sql_table.cc:
Move sql_field->decimals initialization before
sql_field->create_length_to_internal_length() call.
into mysql.com:/home/gluh/MySQL/Merge/5.0-opt
client/mysqldump.c:
Auto merged
include/config-win.h:
Auto merged
libmysql/libmysql.c:
Auto merged
myisam/sort.c:
Auto merged
mysql-test/r/func_sapdb.result:
Auto merged
mysql-test/r/variables.result:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/field.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_timefunc.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/r/type_datetime.result:
manual merge
mysql-test/r/type_decimal.result:
manual merge
mysql-test/t/type_datetime.test:
manual merge
mysql-test/t/type_decimal.test:
manual merge
sql/item.cc:
manual merge
in the SELECT INTO OUTFILE clause starts with a special
character (one of n, t, r, b, 0, Z or N) and ENCLOSED BY
is empty, every occurrence of this character within a
field value is duplicated.
Duplication has been avoided.
New warning message has been added: "First character of
the FIELDS TERMINATED string is ambiguous; please use
non-optional and non-empty FIELDS ENCLOSED BY".
mysql-test/r/outfile_loaddata.result:
BitKeeper file /home/uchum/work/bk/5.0-opt-31663/mysql-test/r/outfile_loaddata.result
Added test case for bug #31663.
mysql-test/t/outfile_loaddata.test:
BitKeeper file /home/uchum/work/bk/5.0-opt-31663/mysql-test/t/outfile_loaddata.test
Added test case for bug #31663.
sql/sql_class.h:
Fixed bug #31663.
The select_export::is_ambiguous_field_term field has been added.
This field is true if select_export::field_sep_char contains
the first char of the FIELDS TERMINATED BY (ENCLOSED BY is empty),
and items can contain this character.
The select_export::field_term_char field has been added (first
char of the FIELDS TERMINATED BY string or INT_MAX).
sql/sql_class.cc:
Fixed bug #31663.
The select_export::prepare method has been modified to calculate
a value of the select_export::is_ambiguous_field_term field and
to warn if this value is true.
The select_export::send_data method has been modified to
avoid escaping or duplication of the field_set_char if
is_ambiguous_field_term is true.
sql/share/errmsg.txt:
Fixed bug #31663.
The ER_AMBIGUOUS_FIELD_TERM warning has been added.
into mysql.com:/home/ram/work/b31615/b31615.5.0
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
myisam/mi_write.c:
type conversion fixed
myisam/sort.c:
type conversion fixed
sql/ha_federated.cc:
type conversion fixed
sql/ha_heap.cc:
type conversion fixed
sql/ha_innodb.cc:
type conversion fixed
sql/ha_myisam.cc:
type conversion fixed
sql/opt_range.cc:
type conversion fixed
sql/sql_map.cc:
type conversion fixed
sql/sql_select.cc:
type conversion fixed
sql/sql_update.cc:
type conversion fixed
into mysql.com:/home/ram/work/b31349/b31349.5.1
mysql-test/r/func_misc.result:
Auto merged
mysql-test/t/func_misc.test:
Auto merged
sql/item_strfunc.h:
Auto merged
added correct handling of NULL values for lookup fields
mysql-test/r/information_schema.result:
test result
mysql-test/t/information_schema.test:
test case
sql/sql_show.cc:
added correct handling of NULL values for lookup fields
into mysql.com:/scratch/tnurnberg/20901/51-20901
mysql-test/r/create.result:
Auto merged
mysql-test/t/create.test:
Auto merged
sql/sql_parse.cc:
Auto merged
into mysql.com:/scratch/tnurnberg/20901/51-20901
mysql-test/r/create.result:
Auto merged
mysql-test/r/grant.result:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/grant.test:
Auto merged
sql/sql_parse.cc:
Auto merged
into mysql.com:/scratch/tnurnberg/20901/50-20901
mysql-test/r/grant.result:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/grant.test:
Auto merged
sql/sql_parse.cc:
Auto merged
mysql-test/r/create.result:
SCCS merged
CREATE TABLE IF NOT EXISTS ... SELECT let you insert into an existing
table as long as you had the CREATE privilege. CREATE ... SELECT
variants now always require INSERT privilege on target table.
mysql-test/r/create.result:
Show that CREATE...SELECT requires INSERT privilege on target table.
mysql-test/r/grant.result:
Sort output for a defined state.
mysql-test/t/create.test:
Show that CREATE...SELECT requires INSERT privilege on target table.
mysql-test/t/grant.test:
Sort output for a defined state.
sql/sql_parse.cc:
Require INSERT privilege on target table for CREATE ... SELECT.
Changed the behaviour of the --event-scheduler option when used without an arguments. It
now turns the option on.
mysql-test/r/events_bugs.result:
Test that --event-scheduler with no options in events_bugs-master.opt turns the option
on.
mysql-test/t/events_bugs.test:
Test that --event-scheduler with no options in events_bugs-master.opt turns the option
on.
sql/events.cc:
Changed the behaviour of the --event-scheduler option when used without an arguments.
It now turns the option on.
mysql-test/t/events_bugs-master.opt:
Test that --event-scheduler with no options in events_bugs-master.opt turns the option
on.
into janus.mylan:/usr/home/serg/Abk/mysql-5.1
mysql-test/r/innodb_mysql.result:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_plugin.cc:
Auto merged
sql/table.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
When doing indexed search the server constructs a key image for
faster comparison to the stored keys. While doing that it must not
perform (and stop if they fail) the additional date checks that can
be turned on by the SQL mode because there already may be values in
the table that don't comply with the error checks.
Fixed by ignoring these SQL mode bits while making the key image.
mysql-test/r/type_date.result:
Bug #28687: test case
mysql-test/t/type_date.test:
Bug #28687: test case
sql/item.cc:
Bug #28687: no invalid date warnings
an error, asserts server
In case of a fatal error during filesort in find_all_keys() the error
was returned without the necessary handler uninitialization.
Fixed by changing the code so that handler uninitialization is performed
before returning the error.
mysql-test/r/delete.result:
Added a test case for bug #31742.
mysql-test/t/delete.test:
Added a test case for bug #31742.
sql/filesort.cc:
In case of a fatal error in find_all_keys() do not return before doing
the necessary handler uninitialization steps.
into kindahl-laptop.dnsalias.net:/home/bk/b28618-mysql-5.1-rpl
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
Auto merged
sql/log_event.cc:
Auto merged
sql/log_event.h:
Auto merged
sql/rpl_rli.h:
Auto merged
sql/slave.cc:
Auto merged
into polly.(none):/home/kaa/src/opt/bug28550/my51-bug28550
mysql-test/t/func_str.test:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_strfunc.h:
Auto merged
mysql-test/r/func_str.result:
Manual merge.
Since, as of MySQL 5.0.15, CHAR() arguments larger than 255 are converted into multiple result bytes, a single CHAR() argument can now take up to 4 bytes. This patch fixes Item_func_char::fix_length_and_dec() to take this into account.
This patch also fixes a regression introduced by the patch for bug21513. As now we do not always have the 'name' member of Item set for Item_hex_string and Item_bin_string, an own print() method has been added to Item_hex_string so that it could correctly be printed by Item_func::print_args().
mysql-test/r/func_str.result:
Import patch bug288550.patch
mysql-test/t/func_str.test:
Import patch bug288550.patch
sql/item.cc:
Import patch bug288550.patch
sql/item.h:
Import patch bug288550.patch
sql/item_strfunc.h:
Import patch bug288550.patch
The value of the actual argument of BIT-type-arg stored procedure was binlogged as non-escaped
sequence of bytes corresponding to internal representation of the bit value.
The patch enforces binlogging of the bit-argument as a valid literal: prefixing the quoted bytes
sequence with _binary.
Note, that behaviour of Item_field::var_str for field_type() of MYSQL_TYPE_BIT is exceptional
in that the returned string contains the binary representation even though result_type() of
the item is INT_RESULT.
mysql-test/r/rpl_sp_effects.result:
testing stored function and procedure called with BIT-arg.
mysql-test/t/rpl_sp_effects.test:
results changed
sql/sp_head.cc:
Treating BIT field type specially to for its value to be prefixed and quoted.
If a temporary error occured inside a group on an event that was not the first
event of the group, the slave could get stuck because the retry counter is reset
whenever an event was executed successfully.
This patch only reset the retry counter when an entire group has been successfully
executed, or failed with a non-transient error.
sql/slave.cc:
Adding debug printouts to every place where Relay_log_info::trans_retries
is changed and to has_temporary_error() to print the error when returning.
Adding debug variable all_errors_are_temporary_errors to make all errors
for slave thread temporary errors.
Adding code so that the Relay_log_info::trans_retries is only reset when
an entire group was sucessfully executed, or a non-temporary error occured.
mysql-test/suite/rpl/r/rpl_temporary_errors.result:
New BitKeeper file ``mysql-test/suite/rpl/r/rpl_temporary_errors.result''
mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt:
New BitKeeper file ``mysql-test/suite/rpl/t/rpl_temporary_errors-slave.opt''
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
New BitKeeper file ``mysql-test/suite/rpl/t/rpl_temporary_errors.test''
Assertion `table->key_read == 0' failed.
The problem was that key_read on a table in a sub-select was not
properly reset. That happens because the code responsible for that
is copy&pasted all around the server. In some place, it was obviously
forgotten to be pasted.
The fix is to reset key_read properly.
mysql-test/r/key.result:
Update result file.
mysql-test/t/key.test:
A test case for BUG#31148: bool close_thread_table(THD*, TABLE**):
Assertion `table->key_read == 0' failed.
sql/sql_select.cc:
Reset key_read before closing index.
When replicating an update pair (before image, after image) under row-based
replication, and the before image is not found on the slave, the after image
was not discared, and was hence read as a before image for the next row.
Eventually, this lead to an after image being read outside the block of rows
in the event, causing an assertion to fire.
This patch fixes this by reading the after image in the event that the row
was not found on the slave, adds some extra debug assertion to catch future
errors earlier, and also adds a few non-debug checks to prevent reading
outside the block of the event.
include/my_base.h:
Adding error code HA_ERR_CORRUPT_EVENT.
mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
Result change.
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
Adding test to try to use row-based replication to replicate an
update of a row that doesn't exist on the slave. We should get
an apropriate error and the slave should stop.
sql/log_event.cc:
Adding debug printouts. Adding code to Update_rows_log_event::do_exec_row()
so that the after image is read (and ignored) in the event of an error in
finding the row. This is necessary so that the second pair of images is
read correctly for the next update pair.
Changing logic for ignoring errors to not include update events, since
a "key not found" error or a "record changed" error is not idempotent
for updates, just for deletes and inserts.
sql/log_event.h:
Adding debug assertions to check that row reading is within the events block of rows.
Add comments.
sql/ha_ndbcluster_binlog.cc:
query_error -> slave_error
sql/handler.cc:
query_error -> slave_error
sql/log.cc:
query_error -> slave_error
sql/log_event.cc:
query_error -> slave_error
sql/log_event_old.cc:
query_error -> slave_error
sql/mysqld.cc:
query_error -> slave_error
sql/protocol.cc:
query_error -> slave_error
sql/slave.cc:
query_error -> slave_error
sql/sp_head.cc:
query_error -> slave_error
sql/sql_class.cc:
query_error -> slave_error
sql/sql_class.h:
Rename: query_error -> is_slave_error, to avoid confusion.
Add commenta.
sql/sql_connect.cc:
Rename: query_error -> is_slave_error, to avoid confusion.
Originally it was the same code to handle init-connect and init-slave
mysqld options. Then init-connect implementation forked off,
but the one who copy-pasted the code didn't change it to not
use a replication-specific variable.
into anubis.xiphis.org:/usr/home/antony/work/mysql-5.1-engines.merge
configure.in:
Auto merged
mysql-test/r/heap_btree.result:
Auto merged
mysql-test/r/log_tables.result:
Auto merged
mysql-test/r/partition.result:
Auto merged
mysql-test/r/system_mysql_db.result:
Auto merged
mysql-test/t/heap_btree.test:
Auto merged
mysql-test/t/log_tables.test:
Auto merged
mysql-test/t/partition.test:
Auto merged
mysys/my_getopt.c:
Auto merged
scripts/mysql_system_tables.sql:
Auto merged
sql/sql_base.cc:
Auto merged
There actually were several problems here:
- WRITE-lock is required to load events from the mysql.event table,
but in the read-only mode an ordinary user can not acquire it;
- Security_context::master_access attribute was not properly
initialized in Security_context::init(), which led to differences
in behavior with and without debug configure options.
- if the server failed to load events from mysql.event, it forgot to
close the mysql.event table, that led to the coredump, described
in the bug report.
The patch is to fix all these problems:
- Use the super-user to acquire WRITE-lock on the mysql.even table;
- The WRITE-lock is acquired by the event scheduler in two cases:
- on initial loading of events from the database;
- when an event has been executed, so its attributes should
be updated.
Other cases when WRITE-lock is needed for the mysql.event table
happen under the user account. So, nothing should be changed there
for the read-only mode. The user is able to create/update/drop
an event only if he is a super-user.
- Initialize Security_context::master_access;
- Close the mysql.event table in case something went wrong.
mysql-test/r/events_bugs.result:
Update result file.
mysql-test/t/events_bugs.test:
A test case for BUG#31111: --read-only crashes MySQL (events fail
to load).
sql/event_data_objects.cc:
When the worker thread is going to drop event after the execution
we should do it under the super-user privileges in order to be able
to lock the mysql.event table for writing in the read-only mode.
This is a system operation, where user SQL can not be executed.
So, there is no risk in compromising security by dropping an event
under the super-user privileges.
sql/event_db_repository.cc:
1. Close tables if something went wrong in simple_open_n_lock_tables();
2. As soon as the system event scheduler thread is running under
the super-user privileges, we should always be able to acquire
WRITE-lock on the mysql.event table. However, let's have an assert
to check this.
sql/event_scheduler.cc:
Run the system event scheduler thread under the super-user privileges.
In particular, this is needed to be able to lock the mysql.event table
for writing when the server is running in the read-only mode.
The event scheduler executes only system operations and does not
execute user SQL (this is what the worker threads for). So, there
is no risk in compromising security by running the event scheduler
under the super-user privileges.
sql/events.cc:
Open the mysql.event table as the super user to be able to acquire
WRITE-lock in the read-only mode.
sql/sql_class.cc:
Initialize Security_context::master_acces.
The uncacheable flag should be set at fix_fields() stage.
Fixed by moving the flag setting to match the one in 5.1
mysql-test/r/query_cache.result:
Bug #31157: test case
mysql-test/t/query_cache.test:
Bug #31157: test case
sql/item_func.cc:
Bug #31157: The uncacheable flag should be set at
fix_fields() stage.
sql/item_func.h:
Bug #31157: The uncacheable flag should be set at
fix_fields() stage.
is possible):
When skipping the beginning of a transaction starting with BEGIN, the OPTION_BEGIN
flag was not set correctly, which caused the slave to not recognize that it was
inside a group. This patch sets the OPTION_BEGIN flag for BEGIN, COMMIT, ROLLBACK,
and XID events. It also adds checks if inside a group before decreasing the
slave skip counter to zero.
Begin_query_log_event was not marked that it could not end a group, which is now
corrected.
mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
Correcting slave skip counter to get the correct behaviour.
mysql-test/suite/rpl/r/rpl_slave_skip.result:
Result change.
mysql-test/suite/rpl/t/rpl_slave_skip.test:
Adding tests to check that skipping works for transactions:
- Skipping one group with BEGIN first
- Skipping two groups with BEGIN first
- Skipping one group without BEGIN first but with AUTOCOMMIT=0
- LOAD DATA INFILE under statement-based replication
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
Result change.
sql/log_event.cc:
Adding checks if we're in a group when the slave skip counter is 1.
In that case, we should keep going.
Adding helping member function Log_event::continue_group() denoting
that this event cannot end a group, and if the skip counter indicates
that the group ends after this event, it should not decrease the skip
counter.
Query_log_event will change the OPTION_BEGIN flag for BEGIN, COMMIT, and
ROLLBACK, even when skipping because of a positive skip count, and
Xid_log_event will also affect the OPTION_BEGIN flag, even when being
skipped.
Begin_load_query_log_event cannot end a group, so it is marked to
continue the group.
sql/log_event.h:
Adding helper function Log_event::continue_group().
sql/rpl_rli.h:
Adding Relay_log_info::get_flag() to get the value of a
replication flag.
sql/slave.cc:
Adding debug output and changing debug message.
mysql-test/suite/rpl/data/rpl_bug28618.dat:
New BitKeeper file ``mysql-test/suite/rpl/data/rpl_bug28618.dat''
mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt:
New BitKeeper file ``mysql-test/suite/rpl/t/rpl_slave_skip-slave.opt''
into janus.mylan:/usr/home/serg/Abk/mysql-5.1
client/mysqldump.c:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
mysql-test/r/innodb_mysql.result:
Auto merged
sql/sql_lex.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
Problem: lying to the optimizer that a function (Item_func_inet_ntoa)
cannot return NULL values leads to unexpected results (in the case group
keys creation/comparison is broken).
Fix: Item_func_inet_ntoa::maybe_null should be set properly.
mysql-test/r/func_misc.result:
Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
- test result.
mysql-test/t/func_misc.test:
Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
- test case.
sql/item_strfunc.h:
Fix for bug #31349: ERROR 1062 (23000): Duplicate entry '' for key 'group_key'
- set Item_func_inet_ntoa::maybe_null flag.
into lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge
client/mysqltest.c:
Auto merged
mysql-test/r/udf.result:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
mysql-test/t/udf.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/udf_example.c:
Auto merged
sql/udf_example.def:
Auto merged
into lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge
client/mysqlcheck.c:
Auto merged
client/mysqltest.c:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/include/mix1.inc:
Auto merged
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/r/udf.result:
Auto merged
mysql-test/t/udf.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_select.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
into lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-rt-merge
mysql-test/r/udf.result:
Auto merged
mysql-test/t/udf.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/udf_example.c:
Auto merged
sql/udf_example.def:
Auto merged
The general log write function (general_log_print) uses printf style
arguments which need to be pre-processed, meaning that the all arguments
are copied to a single buffer and the problem is that the buffer size is
constant (1022 characters) but queries can be much larger then this.
The solution is to introduce a new log write function that accepts a
buffer and it's length as arguments. The function is to be used when
a formatted output is not required, which is the case for almost all
query write-to-log calls.
This is a incompatible change with respect to the log format of prepared
statements.
mysql-test/r/log_tables.result:
Add test case result for Bug#21557
mysql-test/t/log_tables.test:
Add test case for Bug#21557
sql/log.cc:
Introduce the logger function general_log_write which is similar to
general_log_print but accepts a single buffer and the buffer length.
The function doesn't perform any formatting and sends the buffer
directly to the underlying log handlers.
sql/log.h:
Introduce the logger function general_log_write.
sql/log_event.cc:
Pass the query buffer directly to the logger function, formatting
is not required on this case.
sql/mysql_priv.h:
Prototype for the logger function general_log_write.
sql/sp_head.cc:
Pass the query buffer directly to the logger function, formatting
is not required on this case.
sql/sql_parse.cc:
Pass the buffer directly to the logger function when formatting
is not required.
sql/sql_prepare.cc:
Don't log the statement id, it avoids making a extra copy of the query
and the query is not truncated anymore if it exceeds the limit.
The server crashed when a thread was killed while locking the
general_log table at statement begin.
The general_log table is handled like a performance schema table.
The state of open tables is saved and cleared so that this table
seems to be the only open one. Then this table is opened and locked.
After writing, the table is closed and the open table state is
restored. Before restoring, however, it is asserted that there is
no current table open.
After locking the table, mysql_lock_tables() checks if the thread
was killed in between. If so, it unlocks the table and returns an
error. open_ltable() just returns with the error and leaves closing
of the table to close_thread_tables(), which is called at
statement end.
open_performance_schema_table() did not take this into account.
It assumed that a failed open_ltable() would not leave an open
table behind.
Fixed by closing thread tables after open_ltable() and before
restore_backup_open_tables_state() if the thread was killed.
No test case. It requires correctly timed parallel execution.
Since this bug was detected by the test suite, it seems
dispensable to add another test.
sql/sql_base.cc:
Bug#31692 - binlog_killed.test crashes sometimes
Closing thread tables after open_ltable() and before
restore_backup_open_tables_state() if the thread was killed.
into magare.gmz:/home/kgeorge/mysql/work/B31221-5.1-opt
mysql-test/r/derived.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/type_datetime.result:
Auto merged
mysql-test/t/type_date.test:
Auto merged
BitKeeper/deleted/.del-ps_6bdb.result:
Auto merged
mysql-test/suite/ndb/r/ps_7ndb.result:
Auto merged
sql/field.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
mysql-test/r/type_date.result:
merge 5.0-opt -> 5.1-opt
No warning was generated when a TIMESTAMP with a non-zero time part
was converted to a DATE value. This caused index lookup to assume
that this is a valid conversion and was returning rows that match
a comparison between a TIMESTAMP value and a DATE keypart.
Fixed by generating a warning on such a truncation.
mysql-test/r/derived.result:
Bug #31221: fixed an existing not-precise test case
mysql-test/r/ps_2myisam.result:
Bug #31221: Warnings cased by existing tests
mysql-test/r/ps_3innodb.result:
Bug #31221: Warnings cased by existing tests
mysql-test/r/ps_4heap.result:
Bug #31221: Warnings cased by existing tests
mysql-test/r/ps_5merge.result:
Bug #31221: Warnings cased by existing tests
mysql-test/r/ps_6bdb.result:
Bug #31221: Warnings cased by existing tests
mysql-test/r/ps_7ndb.result:
Bug #31221: Warnings cased by existing tests
mysql-test/r/type_date.result:
Bug #31221: Warnings cased by existing tests
mysql-test/r/type_datetime.result:
Bug #31221: test case
mysql-test/t/derived.test:
Bug #31221: fixed an existing not-precise test case
mysql-test/t/type_date.test:
Bug #31221: test case
sql/field.cc:
Bug #31221:
- Upgraded fix for bug 29729
- issue a warning only if the hh:mm:ss.msec is not zero consistently
for all the Field_newdate::store function
sql/item_timefunc.cc:
Bug #31221: don't ignore the errors when storing data
into polly.(none):/home/kaa/src/maint/mysql-5.1-maint
include/my_sys.h:
Auto merged
libmysql/Makefile.shared:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/records.cc:
Auto merged
sql/sql_array.h:
Auto merged
sql/sql_help.cc:
Auto merged
sql/sql_select.cc:
Auto merged
storage/myisam/ft_boolean_search.c:
Auto merged
storage/myisam/ft_nlq_search.c:
Auto merged
storage/myisam/myisampack.c:
Auto merged
mysys/mf_keycache.c:
Manual merge.
mysys/mf_sort.c:
Manual merge.
mysys/my_lib.c:
Manual merge.
mysys/queues.c:
Manual merge.
sql/sql_acl.cc:
Manual merge.
sql/sql_table.cc:
Manual merge.
storage/csv/ha_tina.cc:
Manual merge.
storage/myisam/sort.c:
Manual merge.
into sin.intern.azundris.com:/misc/mysql/31588/51-31588
mysql-test/r/variables.result:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/set_var.cc:
Auto merged
Buffer used when setting variables was not dimensioned to accomodate
trailing '\0'. An overflow by one character was therefore possible.
CS corrects limits to prevent such overflows.
mysql-test/r/variables.result:
Try to overflow buffer used for setting system variables.
Unpatched server should throw a valgrind warning here.
Actual value and error message irrelevant, only length counts.
mysql-test/t/variables.test:
Try to overflow buffer used for setting system variables.
sql/set_var.cc:
Adjust maximum number of characters we can store in 'buff' by one
as strmake() will write a terminating '\0'.
Previously, UDF *_init functions were passed constant strings with erroneous lengths. The length came from the containing variable's size, not the length of the value itself.
Now the *_init functions get the constant as a null terminated string with the correct length supplied too.
mysql-test/r/udf.result:
Test case to check constants passed UDFs.
mysql-test/t/udf.test:
Test case to check constants passed UDFs.
sql/item_func.cc:
UDF _init functions are now passed the length of the constants, rather than the max length of the var containing the constant.
sql/udf_example.c:
Added check_const_len functions. The check_const_len_init functions checks that lengths of constants are correctly passed.
sql/udf_example.def:
Add new example functions to windows dll export list.
table to partitioned
Problem:
Crashed because usage of an uninitialised mutex when auto_incrementing
a partitioned temporary table
Fix:
Only locking (using the mutex) if not temporary table.
mysql-test/r/partition.result:
Bug #30878: Crashing when alter an auto_increment non partitioned
table to partitioned
test result
mysql-test/t/partition.test:
Bug #30878: Crashing when alter an auto_increment non partitioned
table to partitioned
testcase
sql/ha_partition.cc:
Bug #30878: Crashing when alter an auto_increment non partitioned
table to partitioned
If the table is a temporary table, the table_share->mutex is not
initialised.
Checking if not temporary table, then OK to lock (else no need
to lock)
CPUs / Intel's ICC compile
The bug is a combination of two problems:
1. IA64/ICC MySQL binaries use glibc's qsort(), not the one in mysys.
2. The order relation implemented by join_tab_cmp() is not transitive,
i.e. it is possible to choose such a, b and c that (a < b) && (b < c)
but (c < a). This implies that result of a sort using the relation
implemented by join_tab_cmp() depends on the order in which
elements are compared, i.e. the result is implementation-specific. Since
choose_plan() uses qsort() to pre-sort the
join tables using join_tab_cmp() as a compare function, the results of
the sorting may vary depending on qsort() implementation.
It is neither possible nor important to implement a better ordering
algorithm in join_tab_cmp(). Therefore the only way to fix it is to
force our own qsort() to be used by renaming it to my_qsort(), so we don't depend
on linker to decide that.
This patch also "fixes" bug #20530: qsort redefinition violates the
standard.
include/my_sys.h:
Renamed qsort() and qsort2() to my_qsort() and my_qsort2(). Since
previously we relied on stdlib.h to provide a declaration for qsort(), a
separate declaration for my_qsort() is now required.
libmysql/Makefile.shared:
Added mf_qsort.c to libmysql, since my_lib.c now uses my_qsort() instead of qsort().
myisam/ft_boolean_search.c:
Replaced qsort2() with my_qsort2().
myisam/ft_nlq_search.c:
Replaced qsort2() with my_qsort2().
myisam/myisampack.c:
Replaced qsort() with my_qsort().
myisam/sort.c:
Replaced qsort2() with my_qsort2().
mysys/mf_keycache.c:
Replaced qsort() with my_qsort().
mysys/mf_qsort.c:
Renamed qsort() to my_qsort() and qsort2() to my_qsort2().
mysys/mf_sort.c:
Replaced qsort2() with my_qsort2().
mysys/my_lib.c:
Replaced qsort() with my_qsort().
mysys/queues.c:
Replaced qsort2() with my_qsort2().
sql/item_cmpfunc.cc:
Replaced qsort2() with my_qsort2().
sql/item_cmpfunc.h:
Replaced qsort2() with my_qsort2().
sql/opt_range.cc:
Replaced qsort() with my_qsort().
sql/records.cc:
Replaced qsort() with my_qsort().
sql/sql_acl.cc:
Replaced qsort() with my_qsort().
sql/sql_array.h:
Replaced qsort() with my_qsort().
sql/sql_help.cc:
Replaced qsort() with my_qsort().
sql/sql_select.cc:
Replaced qsort() with my_qsort().
sql/examples/ha_tina.cc:
Replaced qsort() with my_qsort().
sql/sql_table.cc:
Replaced qsort() with my_qsort().
Problem: currently, UCS-2 cannot be used as a client character set.
Fix: raise an error if one attempts to set it to USC-2.
mysql-test/r/ctype_ucs.result:
Fix for bug#31615: crash after set names ucs2 collate xxx
- test result.
mysql-test/t/ctype_ucs.test:
Fix for bug#31615: crash after set names ucs2 collate xxx
- test case.
sql/set_var.cc:
Fix for bug#31615: crash after set names ucs2 collate xxx
- raise an error if one is going to set character_set_client to UCS-2.
sql/set_var.h:
Fix for bug#31615: crash after set names ucs2 collate xxx
- raise an error if one is going to set character_set_client to UCS-2.
move 'table_collation' field filling outside of if(file) condition
because this field has 'OPEN_FRM_ONLY' attribute
mysql-test/r/information_schema.result:
test result
mysql-test/t/information_schema.test:
test case
sql/sql_show.cc:
move 'table_collation' field filling outside of if(file) condition
because this field has 'OPEN_FRM_ONLY' attribute
The problem was that the RETURNS column in the mysql.proc was of
CHAR(64). That was not enough for storing long-named datatypes.
The fix is to change CHAR(64) to LONGBLOB, and to throw warnings
at the time a stored routine is created if some data is truncated
during writing into mysql.proc.
mysql-test/r/sp.result:
Update test result.
mysql-test/t/sp.test:
Add a test case for BUG#24923.
scripts/mysql_system_tables.sql:
Change the data type of column 'returns' from char(64) to longblob.
scripts/mysql_system_tables_fix.sql:
Change the data type of column 'returns' from char(64) to longblob.
sql/sp.cc:
Produce warnings if any data was truncated during writing
into mysql.proc.
sql/sp.h:
Add new error code.
sql/share/errmsg.txt:
Add new error message.
sql/sql_parse.cc:
Hande
storage engines do not set the unused null bits (i.e., the
filler bits and the X bit) correctly. Also adding some casts
to debug printouts to eliminate compiler warnings.
sql/ha_ndbcluster.cc:
Changing debug enter names to use full names for member functions.
sql/records.cc:
Emptying records before starting to read records since some engines do
not set the unused null bits, leading to valgrind errors.
sql/rpl_record.cc:
Adding casts to debug printouts to eliminate compiler warnings.
into lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge
mysql-test/t/sp-error.test:
Auto merged
mysql-test/t/udf.test:
Auto merged
sql/item.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_udf.cc:
Auto merged
mysql-test/r/sp-error.result:
failed auto merge
mysql-test/r/sp.result:
failed auto merge
mysql-test/r/udf.result:
failed auto merge
mysql-test/t/sp.test:
failed auto merge
sql/sp_head.cc:
failed auto merge
sql/sql_yacc.yy:
failed auto merge
The embedded version of the server doesn't use column level grants, and
the compile directive NO_EMBEDDED_ACCESS_CHECKS should be checked instead of
the redundant HAVE_QUERY_CACHE (which is always the case) to determine if
column level grants should be compiled or not.
mysql-test/r/query_cache.result:
Updated result file
mysql-test/r/query_cache_notembedded.result:
Updated result file
mysql-test/t/query_cache.test:
Moved test with GRANT to query_cache_notembedded test.
mysql-test/t/query_cache_notembedded.test:
Moved test with GRANT to query_cache_notembedded test.
sql/sql_cache.cc:
Changed the conditional compilation directive to only compile column level grant
checks if NO_EMBEDDED_ACCESS_CHECKS isn't defined.
Problem: we don't evaluate given expression checking values of the
slow_query_log_file/general_log_file, don't check it for NULL.
Fix: evaluate the expression, check result returned.
mysql-test/r/log_state.result:
Fix bug #31604: server crash when setting slow_query_log_file/global general_log_file variable
- test result.
mysql-test/t/log_state.test:
Fix bug #31604: server crash when setting slow_query_log_file/global general_log_file variable
- test case.
sql/set_var.cc:
Fix bug #31604: server crash when setting slow_query_log_file/global general_log_file variable
- evaluate var->value calling val_str() method;
- check for null values returned;
- return proper errors if any.
into mysql.com:/home/bar/mysql-work/mysql-5.1.b31081
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/r/func_regexp.result:
Auto merged
mysql-test/t/ctype_uca.test:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
The root cause of the issue was that the CREATE FUNCTION grammar,
for User Defined Functions, was using the sp_name rule.
The sp_name rule is intended for fully qualified stored procedure names,
like either ident.ident, or just ident but with a default database
implicitly selected.
A UDF does not have a fully qualified name, only a name (ident), and should
not use the sp_name grammar fragment during parsing.
The fix is to re-organize the CREATE FUNCTION grammar, to better separate:
- creating UDF (no definer, can have AGGREGATE, simple ident)
- creating Stored Functions (definer, no AGGREGATE, fully qualified name)
With the test case provided, another issue was exposed which is also fixed:
the DROP FUNCTION statement was using sp_name and also failing when no database
is implicitly selected, when droping UDF functions.
The fix is also to change the grammar so that DROP FUNCTION works with
both the ident.ident syntax (to drop a stored function), or just the ident
syntax (to drop either a UDF or a Stored Function, in the current database)
mysql-test/r/sp-error.result:
Adjust test results
mysql-test/r/udf.result:
Adjust test results
mysql-test/t/sp-error.test:
Adjust test results
mysql-test/t/udf.test:
Adjust test results
sql/sql_parse.cc:
CREATE UDF FUNCTION does not use a fully qualified name.
sql/sql_yacc.yy:
Fix grammar for CREATE / DROP FUNCTION, FOR udf
Improve error messages for select no_such_function()
issue an error if string has illegal characters
mysql-test/r/ctype_utf8.result:
issue an error if string has illegal characters
mysql-test/t/ctype_utf8.test:
issue an error if string has illegal characters
sql/item.cc:
issue an error if string has illegal characters
sql/item.h:
issue an error if string has illegal characters
sql/sql_yacc.yy:
issue an error if string has illegal characters
of the stored procedure cursors (materialized on disk).
include/mysql_com.h:
Remove an unused variable.
sql/protocol.cc:
net->no_send_eof was not used anywhere.
if remote server sends malicious response.
We need to check if the SHOW TABLE STATUS query we issue inside the
FEDERATED engine returned the result with the proper (or just sufficient)
number of rows. Otherwise statements like row[12] can crash the server.
sql/ha_federated.cc:
bug #29801 Federated engine crashes local server
if remote server sends malicious response.
Return with the error if the remote server return fewer rows than we need.
into mysql.com:/home/ram/work/b31154/b31154.5.1
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
sql/item_sum.cc:
Auto merged
mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test:
manual merge from 5.0
mysql-test/r/innodb.result:
results changed
mysql-test/r/multi_update.result:
results changed
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
manual merge: results re-recorded
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
results changed
mysql-test/suite/manual/r/rpl_replication_delay.result:
results recorded for 5.1
mysql-test/t/innodb.test:
removing bug27716 regression test as one exists in binlog suite already.
mysql-test/t/multi_update.test:
manual merge plus refining for execution in both binlog_format.
sql/log_event.cc:
bloody manual merge;
the fact that an event is artificial is encode with setting timestamp argument to zero.
rli's last_master_timestamp won't be updated in stmt_done in such case.
sql/rpl_rli.cc:
simulation and the real fixing code.
Don't update last_master_timestamp with zero.
sql/sql_delete.cc:
manual merge
into koti.dsl.inet.fi:/home/elkin/MySQL/merge-5.1
mysql-test/t/multi_update.test:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_update.cc:
Auto merged
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
manual merge use local; another file has to be changed in 5_1.
mysql-test/r/innodb.result:
manual merge use local to re-record the results
mysql-test/r/multi_update.result:
manual merge use local to re-record the results
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
manual merge use local to re-record the results
mysql-test/t/innodb.test:
restoring bug#27716 snippet
sql/log_event.cc:
trasfering simulation to another file: rpl_rli.cc
similar to bug_27716, but it was stressed on in the synopsis on that there is another
side of the artifact affecting behaviour in transaction.
Fixed with deploying multi_delete::send_error() - otherwise never called - and refining its logic
to perform binlogging job if needed.
The changeset includes the following side effects:
- added tests to check bug_23333's scenarios on the mixture of tables for multi_update;
- fixes bug@30763 with two-liner patch and a test coinciding to one added for bug_23333.
mysql-test/r/innodb.result:
results changed
mysql-test/r/mix_innodb_myisam_binlog.result:
results changed
mysql-test/r/multi_update.result:
results changed
mysql-test/t/innodb.test:
trans table specific test added
mysql-test/t/mix_innodb_myisam_binlog.test:
multi-update and multi-delete of mixure of ta and not-ta tables tests added (relates to bug_23333).
mysql-test/t/multi_update.test:
testing another branch of mult-delete: send_eof() (binloggin there), send_error (early return)
sql/sql_class.h:
a new flag to designate the fact the statement's error has been handled.
The flag is checked by ::send_error() methods (multi_update and _delete classes)
sql/sql_delete.cc:
expanding multi_delete::send_error to
1. early return if error_handled == t
2. binlogging locally if there was a non-trans table modified side effect
sql/sql_parse.cc:
adding multi_update::send_error which can perform binlogging and rollback job in needed
sql/sql_update.cc:
issues relating to
1. bug_27716 with zeroing of `updated' to serve as the flag of early return from send_error().
The flag is changed to be a new member error_handled; also moved outside binlogging branch.
The reason for this change is that bug_23333 fixes were pushed after the bug_27716's and they
left this flaw (also no test coverage).
2. bug_30763 with assertion on trans_safe. I decide to make 2 liner fix for that bug here instead of to remove
those two assertions. This new bug test case is the same as for multi-update on the mixure of tables.
The rational for this fix:
presumption for mutli_update::trans_safe to be set to zero at
multi_update::multi_update or multi_update::initialize_tables() is incorrect.
trans_safe := false should happen only when a non-transactional table gets modified.
Therefore, at initialization the member must be be set to true.
into magare.gmz:/home/kgeorge/mysql/work/B31156-5.1-opt
mysql-test/r/func_group.result:
Auto merged
mysql-test/t/func_group.test:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_sum.cc:
Auto merged
Post-merge fixes. Setting write bit before calling Field::store() since the function asserts that
the write bit has been set.
sql/field.cc:
Setting bit in write set to prevent assertion from throwing when calling Field::store().
If mysql_lock_tables fails because the lock was aborted, we need to
reset thd->some_tables_delete, otherwise we might loop indefinitely
because handler's tables are not closed in a standard way, meaning
that close_thread_tables() (which resets some_tables_deleted) is not
used.
This patch fixes sporadical failures of handler_myisam/innodb tests
which were introduced by previous fix for this bug.
sql/sql_handler.cc:
Properly reset thd->some_tables_deleted if mysql_lock_tables
fails for some reason.
into kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1-rpl
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/log_event.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/rpl_record.cc:
Manual merge.
into mysql.com:/home/hf/work/31155/my51-31155
sql/item.h:
Auto merged
sql/item_geofunc.h:
Auto merged
sql/item.cc:
merging
sql/item_geofunc.cc:
merging
Options to mysqld were not processed correctly because switch statement
was missing some "break"s. CS adds them.
No test case; would require .opt file and server restart. Manually tested.
sql/mysqld.cc:
Add missing "break"s to switch() in mysqld to fix option processing.
Before this patch, failures to write to the log tables (mysql.slow_log
and mysql.general_log) were improperly printed (the time was printed twice),
or not printed at all.
With this patch, failures to write to the log tables is reported in the
error log, for all cases of failures.
mysql-test/r/log_tables.result:
Bug#27858 (Failing to log to a log table doesn't log anything to error log)
mysql-test/t/log_tables.test:
Bug#27858 (Failing to log to a log table doesn't log anything to error log)
sql/log.cc:
Bug#27858 (Failing to log to a log table doesn't log anything to error log)
"DECLARE CURSOR FOR SHOW ..." is a syntax that currently appears to work,
but is untested for some SHOW commands and does not work for other SHOW
commands.
Since this is an un-intended feature that leaked as a result of a coding bug
(in the parser grammar), the correct fix is to fix the grammar to not accept
this construct.
In other words, "DECLARE CURSOR FOR SHOW <other commands that don't work>"
is not considered a bug, and we will not implement other features to make all
the SHOW commands usable inside a cursor just because someone exploited a bug.
mysql-test/r/sp-error.result:
Only allow declaring cursors for SELECT statements to avoid
possible further confusion/problems.
mysql-test/t/information_schema.test:
Only SELECT statements are allowed in cursors.
mysql-test/t/sp-error.test:
Add test case for Bug#29223. Non-SELECT statements in cursors now
yields a parser error.
sql/sql_yacc.yy:
Rework DECLARE CURSOR statement to not allow non-SELECT statements.
into gleb.loc:/home/uchum/work/bk/5.1-opt
mysql-test/r/create.result:
Auto merged
mysql-test/r/null.result:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
Refactoring code to add parameter to pack() and unpack() functions with
purpose of indicating if data should be packed in little-endian or
native order. Using new functions to always pack data for binary log
in little-endian order. The purpose of this refactoring is to allow
proper implementation of endian-agnostic pack() and unpack() functions.
Eliminating several versions of virtual pack() and unpack() functions
in favor for one single virtual function which is overridden in
subclasses.
Implementing pack() and unpack() functions for some field types that
packed data in native format regardless of the value of the
st_table_share::db_low_byte_first flag.
The field types that were packed in native format regardless are:
Field_real, Field_decimal, Field_tiny, Field_short, Field_medium,
Field_long, Field_longlong, and Field_blob.
Before the patch, row-based logging wrote the rows incorrectly on
big-endian machines where the storage engine defined its own
low_byte_first() to be FALSE on big-endian machines (the default
is TRUE), while little-endian machines wrote the fields in correct
order. The only known storage engine that does this is NDB. In effect,
this means that row-based replication from or to a big-endian
machine where the table was using NDB as storage engine failed if the
other engine was either non-NDB or on a little-endian machine.
With this patch, row-based logging is now always done in little-endian
order, while ORDER BY uses the native order if the storage engine
defines low_byte_first() to return FALSE for big-endian machines.
In addition, the max_data_length() function available in Field_blob
was generalized to the entire Field hierarchy to give the maximum
number of bytes that Field::pack() will write.
mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
Sorting by columns that produces deterministic order.
mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result:
Result change.
mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result:
Result change.
mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result:
Result change.
mysql-test/suite/rpl/t/disabled.def:
Enabling tests.
mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test:
Adding missing sync_slave_with_master causing slave to keep tables
after shutdown.
mysql-test/suite/rpl_ndb/t/disabled.def:
Enabling tests.
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt:
Adding --new option
mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test:
Adding have_log_bin.
mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt:
Adding --new option
mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test:
Adding have_log_bin
mysql-test/t/partition.test:
Adding have_archive, since that is used in the test.
sql/field.cc:
Eliminating all two-argument pack() and unpack() functions and moving
functionality into the four-argument version. The four argument version
is introduced so that it is possible to avoid using the storage engine
default when writing and reading the packed format (the unpacked format
still uses the storage engine's default). This is used by row-based
replication to write the fields in a storage engine- and endian-agnostic
format.
Packing integral and floating-point numbers in little-endian format
(if requested).
Using pad_char for the field instead of spaces (0x20) when unpacking.
Adding some Doxygen documentation.
---
Adding max_data_length() to denote the maximum number of bytes that
pack() will write.
Adding casts to remove warnings for debug printouts.
sql/field.h:
Eliminating all virtual pack() and unpack() functions except the four-
argument version, which now is the function that shall be overridden.
The two-argument versions are convenience functions, to prevent changes
to code that uses these.
Adding code to pack integer numbers and floating-point numbers in
little-endian format, if requested.
---
Adding max_data_length() to denote the maximum number of bytes that
pack() will write.
sql/log.cc:
Removing debug printout causing crash when starting NDB on Solaris.
sql/log_event.cc:
Adding missing #ifndef causing compile failure. Adding debug printouts.
sql/rpl_record.cc:
Debriding code. Using new pack() and unpack() functions to always pack
fields little-endian. Adding debug printouts.
---
Using max_data_length() when packing field into row.
Adding casts to debug printouts.
sql/sql_show.cc:
Adding code that causes crash on Solaris machines since printf() cannot
handle NULL values for strings properly.
mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result:
New BitKeeper file ``mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result''
mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result:
New BitKeeper file ``mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result''
mysql_change_user().
The problem was that THD::ull was not reset in THD::cleanup().
The fix is to reset it.
sql/sql_class.cc:
Reset THD::ull after cleanup to prevent memory corruption.
tests/mysql_client_test.c:
Add test case for BUG#31418.
Problem: GROUP_CONCAT(DISTINCT BIT_FIELD...) uses a tree to store keys;
which are constructed using a temporary table fields,
see Item_func_group_concat::setup().
As a) we don't store null bits in the tree where the bit fields store parts
of their data and b) there's no method to properly compare two table records
we've got problem.
Fix: convert BIT fields to INT in the temporary table used.
mysql-test/r/func_gconcat.result:
Fix for bug #31154: field.h:1649: virtual int Field_bit::cmp(const uchar*, const uchar*): Assertion
- test result.
mysql-test/t/func_gconcat.test:
Fix for bug #31154: field.h:1649: virtual int Field_bit::cmp(const uchar*, const uchar*): Assertion
- test case.
sql/item_sum.cc:
Fix for bug #31154: field.h:1649: virtual int Field_bit::cmp(const uchar*, const uchar*): Assertion
- force the create_tmp_table() to convert BIT columns to INT
in order to be able to compare records containing BIT fields.
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/r/ctype_utf8.result:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
mysql-test/t/ctype_utf8.test:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/sql_yacc.yy:
manual merge
Bug#30982 CHAR(..USING..) can return a not-well-formed string
Bug#30986 Character set introducer followed by a HEX string can return bad result
check_well_formed_result moved to Item from Item_str_func
fixed Item_func_char::val_str for proper ucs symbols converting
added check for well formed strings for correct conversion of constants with underscore
charset
mysql-test/r/ctype_ucs.result:
test result
mysql-test/r/ctype_utf8.result:
test result
mysql-test/t/ctype_ucs.test:
test case
mysql-test/t/ctype_utf8.test:
test case
sql/item.cc:
check_well_formed_result() moved from Item_str_func
sql/item.h:
check_well_formed_result() moved from Item_str_func
sql/item_strfunc.cc:
check_well_formed_result moved to Item
fixed Item_func_char::val_str for proper ucs symbols converting
sql/item_strfunc.h:
check_well_formed_result moved to Item
sql/sql_yacc.yy:
added check for well formed string
The special case with NULL as a regular expression
was handled at prepare time. But in this special case
the item was not marked as fixed. This caused an assertion
at execution time.
Fixed my marking the item as fixed even when known to
return NULL at prepare time.
mysql-test/r/func_regexp.result:
Bug #31440: test case
mysql-test/t/func_regexp.test:
Bug #31440: test case
sql/item_cmpfunc.cc:
Bug #31440: mark the item as fixed even when
known to return NULL.
static but it's still used by another compilation unit.
Remove static qualifier from do_command definition.
sql/sql_parse.cc:
do_command is also used by sql_connect.c in 5.1
into ramayana.hindu.god:/home/tsmith/m/bk/maint/51
configure.in:
Auto merged
mysql-test/Makefile.am:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
scripts/Makefile.am:
Auto merged
scripts/mysql_system_tables_data.sql:
Auto merged
scripts/mysqld_safe.sh:
Auto merged
sql/sql_select.cc:
Auto merged
storage/innobase/handler/ha_innodb.cc:
Auto merged
Introduced in mark_transaction_to_rollback(), part of fix for bug 24989;
fix is to check thd for NULL before using it.
sql/sql_class.cc:
It is possible that mark_transaction_to_rollback() may be
called in rare circumstances when thd is NULL (e.g., from
some calls to convert_error_code_to_mysql()). Don't use thd
if it is NULL.
precision > 0 && scale <= precision'.
A sign of a resulting item of the IFNULL function was not
updated and the maximal length of this result was calculated
improperly. Correct algorithm was copy&pasted from the IF
function implementation.
sql/item_cmpfunc.cc:
Fixed bug #31471.
The Item_func_ifnull::fix_length_and_dec method has been
modified to update the Item_func_ifnull::unsigned_flag field
and to take this field into account when calculating the
Item_func_ifnull::max_length value.
(See Item_func_if::fix_length_and_dec for reference).
mysql-test/t/null.test:
Added test case for bug #31471.
mysql-test/r/null.result:
Added test case for bug #31471.
mysql-test/r/create.result:
Update test case after the bugfix of bug #31471.
of SQL_BIG_SELECTS.
The bug was that SQL_BIG_SELECTS was not properly set
in COM_CHANGE_USER.
The fix is to update SQL_BIG_SELECTS properly.
sql/mysql_priv.h:
Cleanup: make prepare_new_connection_state() private for module.
sql/sql_class.cc:
Update THD::options with the respect to SQL_BIG_SELECTS
in COM_CHANGE_USER.
sql/sql_connect.cc:
Cleanup: make prepare_new_connection_state() private for module.
tests/mysql_client_test.c:
Add a test case BUG#20023.
Fixed the usage of spatial data (and Point in specific) with
non-spatial indexes.
Several problems :
- The length of the Point class was not updated to include the
spatial reference system identifier. Fixed by increasing with 4
bytes.
- The storage length of the spatial columns was not accounting for
the length that is prepended to it. Fixed by treating the
spatial data columns as blobs (and thus increasing the storage
length)
- When creating the key image for comparison in index read wrong
key image was created (the one needed for and r-tree search,
not the one for b-tree/other search). Fixed by treating the
spatial data columns as blobs (and creating the correct kind of
image based on the index type).
mysql-test/r/bdb_gis.result:
Bug #30825: bdb tests
mysql-test/r/gis-rtree.result:
Bug #30825: key length changed
mysql-test/r/gis.result:
Bug #30825: MyISAM tests
mysql-test/r/innodb_gis.result:
Bug #30825: InnoDB tests
mysql-test/t/bdb_gis.test:
Bug #30825: bdb tests
mysql-test/t/gis.test:
Bug #30825: MyISAM tests
mysql-test/t/innodb_gis.test:
Bug #30825: InnoDB tests
sql/field.cc:
Bug #30825: Removed Field_geom::get_key_image as Field_blog::get_key_image
takes type parameter into consideration and is a superset of
Field_geom::get_key_image()
sql/field.h:
Bug #30825: Removed Field_geom::get_key_image as Field_blog::get_key_image
takes type parameter into consideration and is a superset of
Field_geom::get_key_image()
sql/sql_select.h:
Bug #30825: Geometry data are a blob derivate
sql/sql_table.cc:
Bug #30825: Increased key length to accomodate for
spatial reference system identifier (srid)
sql/sql_yacc.yy:
Bug #30825: Increased key length to accomodate for
spatial reference system identifier (srid)
sql/table.cc:
Bug #30825: It stores a length for spatial data
as well, so increase the storage length (as it's
done for blobs).
mysql-test/include/gis_keys.inc:
Bug #30825: Test file for spatial data and non-spatial indexes
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
libmysql/libmysql.c:
Auto merged
mysql-test/include/mix1.inc:
Auto merged
mysql-test/r/innodb_mysql.result:
Auto merged
sql/field.cc:
Auto merged
sql/ha_partition.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_select.cc:
Auto merged
added variables relay_log, relay_log_index, relay_log_info_file to init_vars[]
to make them visible within SHOW VARIABLES
mysql-test/r/rpl_flush_log_loop.result:
test result
mysql-test/t/rpl_flush_log_loop.test:
test case
sql/set_var.cc:
added variables relay_log, relay_log_index, relay_log_info_file to init_vars[]
to make them visible within SHOW VARIABLES
Bug#29816 Syntactically wrong query fails with misleading error message
The core problem is that an SQL-invoked function name can be a <schema
qualified routine name> that contains no <schema name>, but the mysql
parser insists that all stored procedures (function, procedures and
triggers) must have a <schema name>, which is not true for functions.
This problem is especially visible when trying to create a function
or when a query contains a syntax error after a function call (in the
same query), both will fail with a "No database selected" message if
the session is not attached to a particular schema, but the first
one should succeed and the second fail with a "syntax error" message.
Part of the fix is to revamp the sp name handling so that a schema
name may be omitted for functions -- this means that the internal
function name representation may not have a dot, which represents
that the function doesn't have a schema name. The other part is
to place schema checks after the type (function, trigger or procedure)
of the routine is known.
mysql-test/r/sp-error.result:
Add test case result for Bug#29816
mysql-test/r/udf.result:
Add test case result for Bug#28318
mysql-test/t/sp-error.test:
Add test case for Bug#29816
mysql-test/t/udf.test:
Add test case for Bug#28318
sql/sp.cc:
Copy the (last) nul byte of the stored routine key and move name parsing
code to the sp_name class constructor.
sql/sp_head.cc:
Revamp routine name parsing for when no schema is specified and
omit dot from the qualified name if the routine is not associated
with a scheme name.
sql/sp_head.h:
Name parsing got bigger, uninline by moving to a single unit -- the sp_head.cc
file.
sql/sql_yacc.yy:
Only copy the schema name if one is actually set and check for schema
name presence only where it's necessary.
This deadlock occurs when a client issues a HANDLER ... OPEN statement
that tries to open a table that has a pending name-lock on it by another
client that also needs a name-lock on some other table which is already
open and associated to a HANDLER instance owned by the first client.
The deadlock happens because the open_table() function will back-off
and wait until the name-lock goes away, causing a circular wait if some
other name-lock is also pending for one of the open HANDLER tables.
Such situation, for example, can be easily repeated by issuing a RENAME
TABLE command in such a way that the existing table is already open
as a HANDLER table by another client and this client tries to open
a HANDLER to the new table name.
The solution is to allow handler tables with older versions (marked for
flush) to be closed before waiting for the name-lock completion. This is
safe because no other name-lock can be issued between the flush and the
check for pending name-locks.
The test case for this bug is going to be committed into 5.1 because it
requires a test feature only avaiable in 5.1 (wait_condition).
sql/sql_base.cc:
Improve comments in the open_table() function, stating the importance
of the handler tables flushing for the back-off process.
sql/sql_handler.cc:
Allows handler tables flushes when opening new tables in order to avoid
potential deadlocks. Add comments explaining the importance of the flush.
Problem: creating a partitioned table during name resolution for the
partition function we search for column names in all parts of the
CREATE TABLE query. It is superfluous (and wrong) sometimes.
Fix: launch name resolution for the partition function against
the table we're creating.
mysql-test/r/partition.result:
Fix for bug #29444: crash with partition refering to table in create-select
- test result.
mysql-test/t/partition.test:
Fix for bug #29444: crash with partition refering to table in create-select
- test result.
sql/item.cc:
Fix for bug #29444: crash with partition refering to table in create-select
- LEX::use_only_table_context introduced, which is used in the
Item_field::fix_fields() to resolve names only against
context->first_name_resolution_table/last_name_resolution_table.
sql/sql_lex.cc:
Fix for bug #29444: crash with partition refering to table in create-select
- LEX::use_only_table_context introduced, which is used in the
Item_field::fix_fields() to resolve names only against
context->first_name_resolution_table/last_name_resolution_table.
sql/sql_lex.h:
Fix for bug #29444: crash with partition refering to table in create-select
- LEX::use_only_table_context introduced, which is used in the
Item_field::fix_fields() to resolve names only against
context->first_name_resolution_table/last_name_resolution_table.
sql/sql_partition.cc:
Fix for bug #29444: crash with partition refering to table in create-select
- set the lex->use_only_table_context before the func_expr->fix_fields()
call to ensure we're resolving names against the table we're creating;
then restore it back after the call.
into linux-st28.site:/home/martin/mysql/src/bug31160/my51-bug31160
mysql-test/r/func_sapdb.result:
Auto merged
mysql-test/r/func_time.result:
Auto merged
sql/item_timefunc.h:
Auto merged
mysql-test/t/func_time.test:
SCCS merged
Even though it returns NULL, the MAKETIME function did not have this property set,
causing a failed assertion (designed to catch exactly this).
Fixed by setting the nullability property of MAKETIME().
mysql-test/r/func_sapdb.result:
Bug#31160: Changed test result.
mysql-test/r/func_time.result:
Bug#31160: Test result.
mysql-test/t/func_time.test:
Bug#31160: Test case.
sql/item_timefunc.h:
Bug#31160: The fix: Initializing maybe_null to true
into mysql.com:/home/ram/work/b31249/b31249.5.1
sql/item_timefunc.h:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/type_datetime.result:
manual merge.
mysql-test/t/type_datetime.test:
manual merge.
into linux-st28.site:/home/martin/mysql/src/bug30832-again/my51-bug30832-again
mysql-test/r/func_misc.result:
Auto merged
mysql-test/t/func_misc.test:
Auto merged
sql/item_func.h:
Auto merged
bitmap_is_set(table->write_set, fiel
Problem: creating a temporary table we allocate the group buffer if needed
followed by table bitmaps (see create_tmp_table()). Reserving less memory for
the group buffer than actually needed (used) for values retrieval may lead
to overlapping with followed bitmaps in the memory pool that in turn leads
to unpredictable consequences.
As we use Item->max_length sometimes to calculate group buffer size,
it must be set to proper value. In this particular case
Item_datetime_typecast::max_length is too small.
Another problem is that we use max_length to calculate the group buffer
key length for items represented as DATE/TIME fields which is superfluous.
Fix: set Item_datetime_typecast::max_length properly,
accurately calculate the group buffer key length for items
represented as DATE/TIME fields in the buffer.
mysql-test/r/type_datetime.result:
Fix for bug #31249: Assertion `!table || (!table->write_set ||
bitmap_is_set(table->write_set, fiel
- test result.
mysql-test/t/type_datetime.test:
Fix for bug #31249: Assertion `!table || (!table->write_set ||
bitmap_is_set(table->write_set, fiel
- test case.
sql/item_timefunc.h:
Fix for bug #31249: Assertion `!table || (!table->write_set ||
bitmap_is_set(table->write_set, fiel
- set Item_datetime_typecast::max_length properly.
sql/sql_select.cc:
Fix for bug #31249: Assertion `!table || (!table->write_set ||
bitmap_is_set(table->write_set, fiel
- the group buffer key length for items represented as
DATE/TIME fields in the buffer should be calculated using
the maximum pack length of such fields (== 8), using
max_length here is redundant.
Completion of previous patch. Negative number were denied
as the second argument to NAME_CONST.
mysql-test/r/func_misc.result:
Bug#30832 completion: test result
mysql-test/t/func_misc.test:
Bug#30832 completion: test case
added negative numbers
sql/item_func.h:
Bug#30832 completion
The function that represents unary minus is considered a constant if the argument is.
Performance improvements made.
ExtractValue for large XML values is now much faster
(about 2000 times faster of 1Mb-long XML values).
sql/item_xmlfunc.cc:
Performance improvement for huge XML values:
1. Avoid reallocs - reserve extra memory:
using String::reserve() + String::q_append()
instead of String::append()
2. Parent is now not searched through the all previous
nodes in backward direction. Instead, we do the following:
- we introduce data->parent - a new member in MY_XML_USER_DATA
- when entering a new tag/attribute node, we remember offset
of the current node in data->parent
- when leaving a tag/attribute node, we change data->parent
to offset of the parent of the current node.
Locked rows of the InnoDB storage was silently skipped in the read-committed
isolation level.
QUICK_RANGE_SELECT for unique ranges lacks second (blocking) read
of the record that was read semi-consistently and just skip it.
The handler::read_multi_range_next method has been modified
to retry previous unique range if the previous read was
semi-consistent.
sql/handler.cc:
Fixed bug #31310.
The handler::read_multi_range_next method has been modified
to retry previous unique range if the previous read was
semi-consistent.
mysql-test/include/mix1.inc:
Added test case for bug #31310.
mysql-test/r/innodb_mysql.result:
Added test case for bug #31310.
fixed uninit memory access in SET pluginvar=DEFAULT
innodb_mysql.test, innodb_mysql.result:
test case for SET pluginvar=DEFAULT
mysql-test/r/innodb_mysql.result:
test case for SET pluginvar=DEFAULT
mysql-test/t/innodb_mysql.test:
test case for SET pluginvar=DEFAULT
sql/sql_plugin.cc:
fixed uninit memory access in SET pluginvar=DEFAULT