Post-pushbuild fix.
- Windows does not have 'socket' system variable.
- Compiler warning in sql/slave.cc
mysql-test/r/variables.result:
Bug#28234 - global/session scope - documentation vs implementation
Updated test result.
mysql-test/t/variables.test:
Bug#28234 - global/session scope - documentation vs implementation
Removed test for 'socket' variable. Windows doesn't have it.
sql/slave.cc:
Bug#28234 - global/session scope - documentation vs implementation
Changed type of constant to avoid a compiler warning.
We pretended that TIMEDIFF() would always return positive results;
this gave strange results in comparisons of the TIMEDIFF(low,hi)<TIME(0)
type that rendered a negative result, but still gave false in comparison.
We also inadvertantly dropped the sign when converting times to
decimal.
CAST(time AS DECIMAL) handles signs of the times correctly.
TIMEDIFF() marked up as signed. Time/date comparison code switched to
signed for clarity.
mysql-test/r/func_sapdb.result:
show that time-related comparisons work with negative
time values now.
show that converting time to DECIMAL no longer drops sign.
mysql-test/t/func_sapdb.test:
show that time-related comparisons work with negative
time values now.
show that converting time to DECIMAL no longer drops sign.
sql/item_cmpfunc.cc:
signed returns
sql/item_cmpfunc.h:
signed now (time/date < > =)
sql/item_func.cc:
signed now
sql/item_timefunc.h:
Functions such as TIMEDIFF() return signed results!
The file-comments pretended we were doing that all along, anyway...
sql/my_decimal.cc:
heed sign when converting time to my_decimal;
times may actually be negative!
Needed for SELECT CAST(time('-73:42:12') AS DECIMAL);
sql/mysql_priv.h:
using signed for dates and times now
so that it stops crashing pushbuild2/5.1-maria and we can see the other failures which it hid.
mysql-test/r/partition.result:
Manually applying the patch for BUG40954 "Crash in MyISAM index code with concurrency test using partitioned tables"
mysql-test/t/partition.test:
Manually applying the patch for BUG40954 "Crash in MyISAM index code with concurrency test using partitioned tables"
sql/ha_partition.cc:
Manually applying the patch for BUG40954 "Crash in MyISAM index code with concurrency test using partitioned tables"
Problem: in 5.0 'check table for upgrade' doesn't detect
incompatible collation changes made in 5.0.48.
Fix: backport #39585 fix to 5.0
sql/handler.cc:
Fix for bug#40984: backport fix from 39585 into 5.0
- backport of #39585 fix
sql/handler.h:
Fix for bug#40984: backport fix from 39585 into 5.0
- backport of #39585 fix
mysql-test/t/partition.test
sql/ha_partition.cc
Bug#40954: Crash in MyISAM index code with concurrency test using partitioned tables
Problem was usage of read_range_first with an empty key.
Solution was to not to give a key if it was empty. (real author Mattias Jonsson)
storage/archive/archive_reader.c
client/mysqlslap.c
Aligned the copyright texts output from "--version" of tools, to
let internal tools be able to change them if needed.
storage/ndb/test/tools/connect.cpp
storage/ndb/test/run-test/atrt.hpp
Corrected a few GPL headers not restricted to GPL version 2
Makefile.am
Added missing --report-features to the 'test-bt-fast' target
support-files/mysql.spec.sh
Reversed the removal of the "%define license GPL" in as internal
tools depended on it
Problem was usage of read_range_first with an empty key.
Solution was to not to give a key if it was empty.
mysql-test/r/partition.result:
Bug#40954: Crash in MyISAM index code with concurrency test using partitioned tables
Updated test result.
mysql-test/t/partition.test:
Bug#40954: Crash in MyISAM index code with concurrency test using partitioned tables
Added test case
ONLY_FULL_GROUP_BY
The check for non-aggregated columns in queries with aggregate function, but without
GROUP BY was treating all the parts of the query as if they are in the SELECT list.
Fixed by ignoring the non-aggregated fields in the WHERE clause.
mysql-test/r/func_group.result:
Bug #39656: test case
mysql-test/t/func_group.test:
Bug #39656: test case
sql/sql_select.cc:
Bug #39656: ignore the new non-aggregated column refs in a WHERE
by saving the state so far and then adding only the new values of the other
parts of the bitmask.
Several system variables did not behave like system variables should do.
When trying to SET them or use them in SELECT, they were reported as
"unknown system variable". But they appeared in SHOW VARIABLES.
This has been fixed by removing the "fixed_vars" array of variables
and integrating the variables into the normal system variables chain.
All of these variables do now behave as read-only global-only
variables. Trying to SET them tells they are read-only, trying to
SELECT the session value tells they are global only. Selecting the
global value works. It delivers the same value as SHOW VARIABLES.
mysql-test/r/variables-notembedded.result:
Bug#28234 - global/session scope - documentation vs implementation
New test result.
mysql-test/r/variables.result:
Bug#28234 - global/session scope - documentation vs implementation
New test result.
mysql-test/t/variables-notembedded.test:
Bug#28234 - global/session scope - documentation vs implementation
Added a test for each moved variable that is not present in an
embedded server.
mysql-test/t/variables.test:
Bug#28234 - global/session scope - documentation vs implementation
Added a test for each moved variable that is also present in an
embedded server.
sql/item_func.cc:
Bug#28234 - global/session scope - documentation vs implementation
Added SHOW_BOOL to some Item_func_get_system_var methods.
sql/set_var.cc:
Bug#28234 - global/session scope - documentation vs implementation
Moved all variables from the "fixed_vars" array into the normal
system variables chain by using the new variable class sys_var_const.
Removed the fixed_show_vars array and its initialization in
enumerate_sys_vars().
Removed mysql_append_static_vars(), which added fixed_vars arrays
to the fixed_show_vars array.
sql/set_var.h:
Bug#28234 - global/session scope - documentation vs implementation
Added the new system variable class sys_var_const.
Removed declaration of mysql_append_static_vars().
sql/slave.cc:
Bug#28234 - global/session scope - documentation vs implementation
Moved the definition of show_slave_skip_errors() from sql_repl.cc
to here and renamed it to print_slave_skip_errors().
Changed print_slave_skip_errors() to create a static buffer with
a printable version of the error numbers set.
Added a call of print_slave_skip_errors() to init_slave_skip_errors().
sql/slave.h:
Bug#28234 - global/session scope - documentation vs implementation
Added declaration of slave_skip_error_names.
sql/sql_repl.cc:
Bug#28234 - global/session scope - documentation vs implementation
Moved all variables from the "fixed_vars" array into the normal
system variables chain by using the new variable class sys_var_const.
Moved the definition of show_slave_skip_errors() to slave.cc and
modified it to compute the string once at server initialization only.
Removed the call to mysql_append_static_vars().
the problem is the same as reported in bug#20835,
so the fix is backport of bug#20835 patch.
mysql-test/r/subselect.result:
test result
mysql-test/t/subselect.test:
test case
returns truncated results
Problem: performig conversion from {INT, DECIMAL, REAL} to CHAR
we incorrectly set its max length in some cases that may lead
to truncated results returned.
Fix: properly set CONVERT({INT, DECIMAL, REAL}, CHAR) result's
max length.
mysql-test/r/ctype_utf8.result:
Fix for bug#36772: When using UTF8, CONVERT with GROUP BY
returns truncated results
- test result.
mysql-test/t/ctype_utf8.test:
Fix for bug#36772: When using UTF8, CONVERT with GROUP BY
returns truncated results
- test case.
sql/item_timefunc.cc:
Fix for bug#36772: When using UTF8, CONVERT with GROUP BY
returns truncated results
- calculating Item_char_typecast::max_length use initial
argument's charset mbmaxlen instead of from_cs->mbmaxlen,
as from_cs may differ in some case (see comment above).
It was possible to crash a mysqld build with EXTRA_DEBUG using
CREATE TABLE ... COMMENT with a specially-crafted UTF-8 string.
This CS removes the check that caused it since it no longer
applies in current servers anyway, and adds comments instead
to avoid future confusion.
mysql-test/r/strict.result:
Try to crash mysqld with a "suitable" multi-byte (3-byte UTF-8) string
for a table comment.
mysql-test/t/strict.test:
Try to crash mysqld with a "suitable" multi-byte (3-byte UTF-8) string
for a table comment.
sql/unireg.cc:
Talk at length about limits in .frm form-info, characters vs bytes,
inlined vs extra-segement TABLE-COMMENTS, and the differences in
6.0+ vs <6.0 when it comes to UTF-8.
Also, remove a check that no longer applies and that could lead to
problems in pathological cases.
variable settings (rpl_sys)
Problem: under certain conditions (e.g. user variables usage in triggers)
accessing a user defined variable we may use a variables hash table that
belongs to already deleted thread. It happens if
thd= new THD;
has the same address as just deleted thd as we use
if (stored_thd == thd)
to check.
That may lead to unpredictable results, server crash etc.
Fix: use thread_id instead of thd address to distinguish threads.
Note: no simple and repeatable test case.
sql/item_func.cc:
Fix for bug#40770: Server Crash when running with triggers including
variable settings (rpl_sys)
- store and use thd->thread_id to distinguish threads instead of
thread address as it may be the same as just deleted thread had,
i.e. we may get (old_thd == new_thd) after
delete old_thd;
new_thd= new THD;
- set entry_thread_id only when we get a real entry, clear it
if the hash search fails.
sql/item_func.h:
Fix for bug#40770: Server Crash when running with triggers including
variable settings (rpl_sys)
- Item_func_set_user_var::entry_thread_id introduced.
Problem: memory leak occurs when we open a federated table
that has its share in the hash.
Fix: free not used memory.
Note: the fix should NOT be merged to 5.1 (the code changed).
sql/ha_federated.cc:
Fix for bug#40875: Memory leak in FEDERATED handler
- free memory (tmp_share.scheme) allocated in the parse_url()
if it isn't used anymore.
set but is ignored".
This patch makes @@session.max_allowed_packed and
@@session.net_buffer_length read-only as suggested in the bug
report. The user will have to use SET GLOBAL (and reconnect)
to alter the session values of these variables.
The error string ER_VARIABLE_IS_READONLY is introduced.
Tests are modified accordingly.
sql/set_var.cc:
The class sys_var_thd_ulong_session_readonly is introduced as
a specialization of sys_var_thd_ulong implementing a read-only
session variable. The class overrides check() and
check_default() to achieve the read-only property for the
session part of the variable.
sql/set_var.h:
The class sys_var_thd_ulong_session_readonly is introduced as
a specialization of sys_var_thd_ulong implementing a read-only
session variable. The class overrides check() and
check_default() to achieve the read-only property for the
session part of the variable.
sql/share/errmsg.txt:
New error ER_VARIABLE_IS_READONLY.
Cache size is truncated via 32bit ulong in ha_init_key_cache() and
ha_resize_key_cache()
This change fixes the cast to size_t instead of ulong. This cast is safe,
because key_buffer_size parameter is limited to SIZE_T_MAX
That's a Win-specific error.
When we create libmysqld.dll we have many libraries like mysys, dbug,
strings, etc linked into that dll, so the application built upon
this library shouldn't link these libraries to itself, rather use
those inside the dll.
Fixed by redirecting calls into the libmysqld.dll
per-file comments:
dbug/dbug.c
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
fake _db_something definitions added
include/my_dbug.h
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
fake _db_something declarations added
libmysqld/examples/CMakeLists.txt
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
superfluous libraries removed from linking
libmysqld/libmysqld.def
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
set of mysys functions added to the export section
When a CSV file contained comma separated elements
that were not enclosed in quotes, it was causing the
mysql server to crash.
The old algorithm that parsed the content of a row in
mysql 5.0 was assuming that the values of the fields
in a .CSV file will be enclosed in quotes and will be
separated by commas.
This was causing the old algorithm to fail when the
content of the file resembled the following
3,"sans quotes"
The CSV engine that is part of mysql 5.0 was expecting
the above to be
"3","sans quotes"
The above is just one example of where the engine was
failing for what would be recognized as a valid .CSV
file content otherwise.
The proposed fix changes the old algorithm being used
to parse rows from the .CSV file to handle two separate
cases
1) When the current field of the row is enclosed in quotes
2) When the current field of the row is not enclosed in
quotes
mysql-test/r/csv.result:
Contains additional test output corresponding to the new
tests added.
mysql-test/t/csv.test:
Contains additional tests for testing the behaviour of the CSV
storage engine when the fields are not enclosed in quotes.
sql/examples/ha_tina.cc:
Changes the parsing logic of the rows in a CSV file to account for
fields that are not enclosed in quotes.
Item_func_div didn't calculate the precision of the result properly.
The result of 5/0.0001 is 5000 so we have to add decimals of the divisor
to the planned precision.
per-file comments:
mysql-test/r/type_newdecimal.result
Bug#31616 div_precision_increment description looks wrong
test result fixed
mysql-test/t/type_newdecimal.test
Bug#31616 div_precision_increment description looks wrong
test case
sql/item_func.cc
Bug#31616 div_precision_increment description looks wrong
precision must be increased with args[1]->decimals parameter
The function thd_security_context allocates memory on an unprotected MEM_ROOT if the
message length becomes longer than requested and the initial buffer memory needs to
be reallocated.
This patch fixes the design error by copying parts of the reallocated buffer
to the destination buffer. This works because the destination buffer isn't
owned by the String object and thus isn't freed when a new buffer is allocated.
Any new memory allocated by the String object is reclaimed when the object
is destroyed at the end of the function call.
sql_view.cc: required_view_parameters has been decreased by 2
(not by 1) because its value was incorrect: 16 instead of 15
(minor performance issue).
sql/sql_view.cc:
sql_view.cc: required_view_parameters has been decreased by 2
(not by 1) because its value was incorrect: 16 instead of 15
(minor performance issue).
missing after downgrade
Obsolete arc/ directory and view .frm file backup support
has been removed by the patch for bug 17823. However, that
bugfix caused a problem with "live downgrades" of the
server: if we rename some view 4 times under 5.1.29/5.0.72
and then try to rename it under 5.1.28/5.0.70 on the same
database, the server fails with a error:
query 'RENAME TABLE ... TO ...' failed: 6: Error on
delete of '....frm-0001' (Errcode: 2)
Also .frm file of that view may be lost (renamed to .frm~).
The server failed because it tried to rename latest 3
backup .frm files renaming the view: the server used an
integer value of the "revision" field of .frm file to
extract those file names. After the fix for bug 17823 those
files were not created/maintained any more, however the
"revision" field was incremented as usual. So, the server
failed renaming non existent files.
This fix solves the problem by removing the support for
"revision" .frm file field:
1. New server silently ignores existent "revision" fields
in old .frm files and never write it down;
2. Old server assumes, that missing "revision" field in new
.frm files means default value of 0.
3. Accordingly to the fix for bug 17823 the new server
drops arc/ directory on alter/rename view, so after
"live downgrade" old server begins maintenance of the
arc/ directory from scratch without conflicts with .frm
files.
sql/parse_file.cc:
Bug #40021: Renaming view fails, archived .frm for view is
missing after downgrade
1. static write_parameter(): the old_version parameter
and the section for FILE_OPTIONS_REV have been re moved.
2. write_parameter(): the max_versions parameter has been
removed;
3. sql_create_definition_file(): removal of dead code;
4. rename_in_schema_file(): revision and num_view_backups
parameters and dead code have been removed;
5. File_parser::parse(): FILE_OPTIONS_REV section has been
removed.
sql/parse_file.h:
Bug #40021: Renaming view fails, archived .frm for view is
missing after downgrade
1. The FILE_OPTIONS_REV constant has been removed.
2. sql_create_definition_file and rename_in_schema_file
functions: obsolete versions, revision and
num_view_backups parameters have been removed.
sql/sql_db.cc:
Bug #40021: Renaming view fails, archived .frm for view is
missing after downgrade
Commentary update.
sql/sql_trigger.cc:
Bug #40021: Renaming view fails, archived .frm for view is
missing after downgrade
sql_create_definition_file() calls have been updates to
new parameter lists.
sql/sql_view.cc:
Bug #40021: Renaming view fails, archived .frm for view is
missing after downgrade
1. The mysql_create_view function code is used for both
CREATE VIEW and ALTER queries, but query cache is
necessary for ALTER command only. Check for a non first
view revision has been replaced with a direct check for
ALTER query.
2. The num_view_backups global constant has been removed.
3. view_parameters: the "revision" .frm field support has
been removed.
4. sql_create_definition_file and rename_in_schema_file
function calls have been updates to new parameter lists.
sql/table.h:
Bug #40021: Renaming view fails, archived .frm for view is
missing after downgrade
TABLE_LIST: the revision field has been removed.
status
The problem appears to be a race condition, when service is being
stopped right after startup. We set the service status to SERVICE_RUNNING
way too early it cannot yet handle stop requests - initialization has
not finished and hEventShutdown that signals server to stop is not yet
created. If somebody issues "net stop MySQL" at this time, MySQL is not
informed about the stop and continues to run as usual, while
NTService::ServiceMain() stucks forever waiting for mysql's "main" thread
to finish.
Solution is to remain in SERVICE_START_PENDING status until after server
initialization is fully complete and only then change the status to
SERVICE_RUNNING. In SERVICE_START_PENDING we do not accept service control
requests, i.e it is not possible to stop service in that time.
sql/mysqld.cc:
Set service status to running after all initialization is complete
sql/nt_servc.cc:
New method SetRunning() to be called by application
to set service status to SERVICE_RUNNING when apllication
has finished initialization.
sql/nt_servc.h:
New method SetRunning() to be called by application
when initialization completes
issue 'The storage engine for the table doesn't support check' note for I_S tables
mysql-test/r/mysqlcheck.result:
test result
mysql-test/t/mysqlcheck.test:
test case
sql/sql_table.cc:
issue 'The storage engine for the table doesn't support check' note for I_S tables
table->partition_info is unitialized when we open frm file only.
The fix is check share->partition_info_len which is set on
frm opening stage.
mysql-test/r/information_schema_part.result:
test result
mysql-test/t/information_schema_part.test:
test case
sql/sql_show.cc:
table->partition_info is unitialized when we open frm file only.
The fix is check share->partition_info_len which is set on
frm opening stage.
VARIABLE_VALUE field is decreased to 1024 symbols.
(affected I_S tables: GLOBAL_VARIABLES, SESSION_VARIABLES,
GLOBAL_STATUS, SESSION_STATUS).
The only variable which can be longer than 1024 is
init_connect. The variable will be truncated with warning.
Additional fix:
Added where condition filter which speed up queries which
have where condition with expressions which use VARIABLE_NAME
field.
mysql-test/r/information_schema.result:
test result
mysql-test/r/show_check.result:
result fix
mysql-test/suite/funcs_1/r/is_columns_is.result:
result fix
mysql-test/t/information_schema.test:
test case
sql/sql_show.cc:
VARIABLE_VALUE field is decreased to 1024 symbols.
(affected I_S tables: GLOBAL_VARIABLES, SESSION_VARIABLES,
GLOBAL_STATUS, SESSION_STATUS).
The only variable which can be longer than 1024 is
init_connect. The variable will be truncated with warning.
Additional fix:
Added where condition filter which speed up queries which
have where condition with expressions which use VARIABLE_NAME
field.
changed 'charset', 'collation' field length from 64 to MY_CS_NAME_SIZE(32)
in tables:
SCHEMATA, TABLES, COLUMNS, CHARACTER_SETS,
COLLATIONS, COLLATION_CHARACTER_SET_APPLICABILITY
mysql-test/r/create.result:
result fix
mysql-test/r/information_schema.result:
result fix
mysql-test/r/show_check.result:
result fix
mysql-test/suite/funcs_1/r/is_character_sets.result:
result fix
mysql-test/suite/funcs_1/r/is_collation_character_set_applicability.result:
result fix
mysql-test/suite/funcs_1/r/is_collations.result:
result fix
mysql-test/suite/funcs_1/r/is_columns.result:
result fix
mysql-test/suite/funcs_1/r/is_columns_is.result:
result fix
mysql-test/suite/funcs_1/r/is_routines.result:
result fix
mysql-test/suite/funcs_1/r/is_schemata.result:
result fix
mysql-test/suite/funcs_1/r/is_tables.result:
result fix
sql/sql_show.cc:
changed 'charset', 'collation' field length from 64 to MY_CS_NAME_SIZE(32)
in tables:
SCHEMATA, TABLES, COLUMNS, CHARACTER_SETS,
COLLATIONS, COLLATION_CHARACTER_SET_APPLICABILITY
additional fix: ROUTINES.SQL_MODE is changed to be VARCHAR(addon for Bug#29153)
Occurred with EXTRA_DEBUG on windows.
Problem was insufficient length of a local variable that stored path names.
Solution was to use the correct length.
CMakeLists.txt:
Bug#38784: Mysql server crash if table is altered with partition changes.
Added support for EXTRA_DEBUG
sql/sql_partition.cc:
Bug#38784: Mysql server crash if table is altered with partition changes.
Changed from FN_LEN to FN_REFLEN since the variable was use for paths,
not filenames without path.
win/configure.js:
Bug#38784: Mysql server crash if table is altered with partition changes.
Added support for EXTRA_DEBUG
With fix for bug 25951 index hints are ignored for fulltext
searches, as handling of fulltext indexes is different from
handling regular indexes. Meaning it is not possible to
implement true index hints support for fulltext indexes within
the scope of current fulltext architecture.
The problem is that prior to fix for bug 25951, some useful
index hints still could be given for boolean mode searches.
This patch implements special index hints support for fulltext
indexes with the following characteristics:
- all index hints are still ignored for NLQ mode searches -
it cannot work without an index;
- for 5.1 and up index hints FOR ORDER BY and FOR GROUP BY are
still ignored for fulltext indexes;
- boolean mode searches honor USE/FORCE/IGNORE INDEX hints;
- as opposed to index hints for regular indexes, index hints
for fulltext BOOLEAN mode searches affect the usage of the
index for the whole query.
mysql-test/r/fulltext.result:
A test case for BUG#38842.
mysql-test/t/fulltext.test:
A test case for BUG#38842.
sql/item_func.cc:
For boolean mode searches, which can work without fulltext
index, use keys_in_use_for_query bitmap instead of keys_in_use.
The effect is that boolean mode searches now honor index hints.
on tables with partitions
Problem was that the handler function try_semi_consistent_read
was not propagated to the innodb handler.
Solution was to implement that function in the partitioning
handler.
mysql-test/r/partition_innodb.result:
Bug#40595: Non-matching rows not released with READ-COMMITTED
on tables with partitions
Updated test result.
mysql-test/t/partition_innodb.test:
Bug#40595: Non-matching rows not released with READ-COMMITTED
on tables with partitions
Added test case for bug#40595.
Note: the replace_regex is taking long time. I have not found
any better regex (it takes time using 'sed' too).
sql/ha_partition.cc:
Bug#40595: Non-matching rows not released with READ-COMMITTED
on tables with partitions
Added function to the partitioning handler for handling
semi consistent reads (unlock_row was already implemented,
and this is needed for unlock_row to work properly in innodb).
It uses pruning for optimizing the call.
sql/ha_partition.h:
Bug#40595: Non-matching rows not released with READ-COMMITTED
on tables with partitions
Added function to the partitioning handler for handling
semi consistent reads (unlock_row was already implemented,
and this is needed for unlock_row to work properly in innodb).
Innodb monitor could cause a server crash because of invalid access to a
shared variable in a concurrent environment.
This patch adds a guard to protect against crashes but not against
inconsistent values because of performance reasons.
sql/sql_class.cc:
* Attempt snapshot of static memory pointer proc_info to avoid null pointers.
The convert_constant_item function converts a constant to integer using
field for condition like 'field = a_constant'. In some cases the
convert_constant_item is called for a subquery when outer select is already
being executed, so convert_constant_item saves field's value to prevent its
corruption. For EXPLAIN and at the prepare phase field's value isn't
initialized yet, thus when convert_constant_item tries to restore saved
value it fails assertion.
Now the convert_constant_item doesn't save/restore field's value if it's
haven't been read yet. Outer constant values are always saved.
mysql-test/r/explain.result:
Added a test case for the bug#37870.
mysql-test/t/explain.test:
Added a test case for the bug#37870.
sql/item_cmpfunc.cc:
Bug#37870: Usage of uninitialized value caused failed assertion.
Now the convert_constant_item doesn't save/restore field's value if it's
haven't been read yet. Outer constant values are always saved.
order by
Problem was that the first index read was unordered,
and the next was ordered, resulting in use of
uninitialized data.
Solution was to use the correct variable to see if
the 'next' call should be ordered or not.
mysql-test/r/partition.result:
Bug#40494: MYSQL server crashes on range access with
partitioning and order by
Added test case for the bug.
mysql-test/t/partition.test:
Bug#40494: MYSQL server crashes on range access with
partitioning and order by
Added test case for the bug.
sql/ha_partition.cc:
Bug#40494: MYSQL server crashes on range access with
partitioning and order by
Used the wrong variable to decide to continue with
ordered or unordered scan.
The partitioning clause is only a very long single line, which is very
hard to interpret for a human. This patch breaks the partitioning
syntax into one line for the partitioning type, and one line per
partition/subpartition.
mysql-test/r/information_schema_part.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/r/partition.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/r/partition_archive.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/r/partition_datatype.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/r/partition_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/r/partition_mgm.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/r/partition_mgm_err.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/r/partition_not_windows.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/r/partition_range.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/r/partition_symlink.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/ndb/r/ndb_partition_key.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/ndb/r/ndb_partition_range.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/inc/partition_directory.inc:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Changed partitioning clause format for verifying the new output format.
mysql-test/suite/parts/r/ndb_dd_backuprestore.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/part_supported_sql_func_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/part_supported_sql_func_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/part_supported_sql_func_ndb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter1_1_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter1_1_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter1_2_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter1_2_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter2_1_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter2_1_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter2_2_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter2_2_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter3_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter3_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter4_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_alter4_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_auto_increment_archive.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_auto_increment_blackhole.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_auto_increment_memory.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_auto_increment_ndb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_basic_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_basic_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_basic_symlink_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_basic_symlink_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_bit_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_bit_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_bit_ndb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_char_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_char_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_datetime_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_datetime_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_decimal_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_decimal_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_engine_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_engine_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_engine_ndb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_float_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_float_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_int_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_int_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_int_ndb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc0_archive.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc0_memory.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc1_archive.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc1_memory.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc2_archive.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc2_memory.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_special_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_special_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_syntax_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/partition_syntax_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/parts/r/rpl_partition.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/rpl/r/rpl_extraCol_innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/rpl/r/rpl_extraCol_myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/rpl/r/rpl_row_basic_8partition.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Updated test result due to the new partitioning clause output format.
mysql-test/t/partition.test:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Added small tests for for the new partitioning clause output format.
mysql-test/t/partition_mgm.test:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Added small tests for for the new partitioning clause output format.
sql/sql_partition.cc:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Changed formatting of the partitioning clause from single line into
multiple indented lines
sql/sql_show.cc:
Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
Changed formatting of the partitioning clause from single line into
multiple indented lines
TRUNCATE TABLE for InnoDB tables returned a count showing an approximation
of the number of rows affected to gain efficiency.
Now the statement always returns 0 rows affected for clarity.
sql/sql_delete.cc:
* Set row count to 0 if auto increment was reset which can happen
if TRUNCATE TABLE was issued.
When statement-based replication is used, and the
transaction isolation level is READ-COMMITTED or stricter,
InnoDB will print an error because statement-based
replication might lead to inconsistency between master
and slave databases. However, when the binary log is not
engaged, this is not an issue and an error should
not be printed.
This patch makes thd_binlog_format() return BINLOG_FORMAT_
UNSPEC when the binary log is not engaged for the given
thread.
mysql-test/t/innodb_mysql.test:
Adding test that no error message is printed from inside
InnoDB when the binary log is turned off.
Problem was that partitioning cached the table flags.
These flags could change due to TRANSACTION LEVEL changes.
Solution was to remove the cache and always return the table flags
from the first partition (if the handler was initialized).
mysql-test/r/partition_innodb_stmt.result:
Bug#39084: Getting intermittent errors with statement-based binary logging
New test result file.
mysql-test/t/partition_innodb_stmt.test:
Bug#39084: Getting intermittent errors with statement-based binary logging
New test file.
sql/ha_partition.cc:
Bug#39084: Getting intermittent errors with statement-based binary logging
Removed m_table_flags, and added m_handler_status.
Added checks that all partitions have the same
table flags.
Moved some variable initializations.
Updated some comments.
Fixed typo initialise -> initialize
Changed HA_EXTTA_NO_READCHECK to do nothing, since it
is only used in ha_open, which is called for every
partition in ::open anyway.
sql/ha_partition.h:
Bug#39084: Getting intermittent errors with statement-based binary logging
Removed m_table_flags, and added m_handler_status.
Always return the first partitions table flags, instead of using
cached table flags.
Added define of enabled/disabled partitioning table flags
Fixed type initialise -> initialize
Updated some comments.
sql/handler.cc:
Bug#39084: Getting intermittent errors with statement-based binary logging
Fixed type initialise -> initialize.
sql/handler.h:
Bug#39084: Getting intermittent errors with statement-based binary logging
Added comment to understand where the cached value is set.
A string buffers which were included in the 'view' data structure
were allocated on the stack, causing an invalid pointer when used
after the function returned.
The fix: use copy of values for view->md5 & view->queries
mysql-test/r/view.result:
test result
mysql-test/t/view.test:
test case
sql/sql_view.cc:
A string buffers which were included in the 'view' data structure
were allocated on the stack, causing an invalid pointer when used
after the function returned.
The fix: use copy of values for view->md5 & view->queries
The convert_constant_item function converts a constant to integer using
field for condition like 'field = a_constant'. When the convert_constant_item
is called for a subquery the outer select is already being executed, so
convert_constant_item saves field's value to prevent its corruption.
For EXPLAIN field's value isn't initialized thus when convert_constant_item
tries to restore saved value it fails assertion.
Now the convert_constant_item doesn't save/restore field's value
for EXPLAIN.
mysql-test/r/explain.result:
Added a test case for the bug#37870.
mysql-test/t/explain.test:
Added a test case for the bug#37870.
sql/item_cmpfunc.cc:
Bug#37870: Usage of uninitialized value caused failed assertion.
Now the convert_constant_item doesn't save/restore field's value
for EXPLAIN.
sql/sql_class.cc:
Backport of fix made in 6.0-maria in revision guilhem@mysql.com-20081020202418-yay1h55w9ffagp42
(this undoes a change made in WL 3064 (the deadlock detector patch) which asserted in
"./mtr --embedded innodb_mysql" in 6.0-maria)
mysql-test/r/partition_not_windows.result:
Update warning number due to new errors appearing earlier
in the list.
mysql-test/r/partition_symlink.result:
Update warning number due to new errors appearing earlier
in the list.
mysql-test/r/symlink.result:
Update warning number due to new errors appearing earlier
in the list.
Problem: mysqld doesn't detect that enum data must be reinserted performing
'ALTER TABLE' in some cases.
Fix: reinsert data altering an enum field if enum values are changed.
mysql-test/r/alter_table.result:
Fix for bug#23113: Different behavior on altering ENUM fields between 5.0 and 5.1
- test result.
mysql-test/t/alter_table.test:
Fix for bug#23113: Different behavior on altering ENUM fields between 5.0 and 5.1
- test case.
sql/field.cc:
Fix for bug#23113: Different behavior on altering ENUM fields between 5.0 and 5.1
- Field_enum::is_equal() introduced, which is called to detect that a field
is changing by 'ALTER TABLE'.
sql/field.h:
Fix for bug#23113: Different behavior on altering ENUM fields between 5.0 and 5.1
- Field_enum::is_equal() introduced, which is called to detect that a field
is changing by 'ALTER TABLE'.
- Make send_row_on_empty_set() return FALSE when simplify_cond() has found out
that HAVING is always FALSE
re-committing to put the fix into 5.0 and 5.1
mysql-test/r/group_by.result:
BUG#38072: Wrong result: HAVING not observed in a query with aggregate
- Testcase
mysql-test/t/group_by.test:
BUG#38072: Wrong result: HAVING not observed in a query with aggregate
- Testcase
sql/sql_select.h:
BUG#38072: Wrong result: HAVING not observed in a query with aggregate
- Make send_row_on_empty_set() return FALSE when simplify_cond() has found out
that HAVING is always FALSE
breaks auto increment
The auto_increment value was not initialized if
the first statement after opening a table was
an 'UPDATE'.
solution was to check initialize if it was not,
before trying to increase it in update.
mysql-test/suite/parts/inc/partition_auto_increment.inc:
Bug#40176: update as first partitioning statement
breaks auto increment
Added tests for verifying the bug and show some more
auto_increment flaws
mysql-test/suite/parts/r/partition_auto_increment_archive.result:
Bug#40176: update as first partitioning statement
breaks auto increment
Updated test results, due to added tests
mysql-test/suite/parts/r/partition_auto_increment_blackhole.result:
Bug#40176: update as first partitioning statement
breaks auto increment
Updated test results, due to added tests
mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
Bug#40176: update as first partitioning statement
breaks auto increment
Updated test results, due to added tests
mysql-test/suite/parts/r/partition_auto_increment_memory.result:
Bug#40176: update as first partitioning statement
breaks auto increment
Updated test results, due to added tests
mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
Bug#40176: update as first partitioning statement
breaks auto increment
Updated test results, due to added tests
mysql-test/suite/parts/r/partition_auto_increment_ndb.result:
Bug#40176: update as first partitioning statement
breaks auto increment
Updated test results, due to added tests
sql/ha_partition.cc:
Bug#40176: update as first partitioning statement
breaks auto increment
make sure that the auto_increment value is initialized
before updating it.
(missed initializing in mysql_update_row).
sql/ha_partition.h:
Bug#40176: update as first partitioning statement
breaks auto increment
Assert that it is initialized, before updating
the auto_increment value
Visual Studio 2008 Express edition does not include message compiler mc.exe
It is not possible to build MySQL server if only VC2008 Express is installed,
because we use mc.exe to generate event log messages.
This patch removes the mc.exe dependency. Generated files message.h,
message.rc and MSG00001.bin are checked into source code repository.
Instructions on how to add or change messages are added to messages.mc
The problem was that the server did not robustly handle a
unilateral roll back issued by the Resource Manager (RM)
due to a resource deadlock within the transaction branch.
By not acknowledging the roll back, the server (TM) would
eventually corrupt the XA transaction state and crash.
The solution is to mark the transaction as rollback-only
if the RM indicates that it rolled back its branch of the
transaction.
mysql-test/r/xa.result:
Add test case result for Bug#28323
mysql-test/t/xa.test:
Add test case for Bug#28323
sql/handler.cc:
Reset XID only at the end of the global transaction.
sql/share/errmsg.txt:
Add new error codes.
sql/sql_class.h:
Remember the error reported by the Resource Manager.
sql/sql_parse.cc:
Rollback the transaction if the Resource Manager reported
a error and rolled back its branch of the transaction.
The problem was that the server did not robustly handle a
unilateral roll back issued by the Resource Manager (RM)
due to a resource deadlock within the transaction branch.
By not acknowledging the roll back, the server (TM) would
eventually corrupt the XA transaction state and crash.
The solution is to mark the transaction as rollback-only
if the RM indicates that it rolled back its branch of the
transaction.
mysql-test/r/xa.result:
Add test case result for Bug#28323
mysql-test/t/xa.test:
Add test case for Bug#28323
sql/handler.cc:
Reset XID only at the end of the global transaction.
sql/share/errmsg.txt:
Add new error codes.
sql/sql_class.h:
Remember the error reported by the Resource Manager.
sql/sql_parse.cc:
Rollback the transaction if the Resource Manager reported
a error and rolled back its branch of the transaction.
Debug builds of MySQL 5.1, 6.0 with Sun Studio 12 broke because of
use of gcc specific feature.
The fix is to replace __FUNCTION__ with the corresponding character string
In certain situations, a scan of the table will return the error
code HA_ERR_RECORD_DELETED, and this error code is not
correctly caught in the Rows_log_event::find_row() function, which
causes an error to be returned for this case.
This patch fixes the problem by adding code to either ignore the
record and continuing with the next one, the the event of a table
scan, or change the error code to HA_ERR_KEY_NOT_FOUND, in the event
that a key lookup is attempted.
fails after the first time
Two separate problems :
1. When flattening joins the linked list used for name resolution
(next_name_resolution_table) was not updated.
Fixed by updating the pointers when extending the table list
2. The items created by expanding a * (star) as a column reference
were marked as fixed, but no cached table was assigned to them
(unlike what Item_field::fix_fields does).
Fixed by assigning a cached table (so the re-preparation is done
faster).
Note that the fix for #2 hides the fix for #1 in most cases
(except when a table reference cannot be cached).
mysql-test/r/sp.result:
Bug #33811: test case
mysql-test/t/sp.test:
Bug #33811: test case
sql/sql_base.cc:
Bug #33811: cache the table for Item_fields created by expanding '*'
sql/sql_select.cc:
Bug #33811: maintain a correct name resolution chain when
flattening joins.
collation change made in 5.1.24-rc
Problem: 'CHECK TABLE ... FOR UPGRADE' did not check for
incompatible collation changes made in MySQL 5.1.24-rc.
Fix: add the check.
sql/handler.cc:
- check for incompatible collation changes made in 5.1.24-rc:
bug #27877:
utf8_general_ci
ucs2_general_ci
IS NULL was not checking the correct row in a HAVING context.
At the first row of a new group (where the HAVING clause is evaluated)
the column and SELECT list references in the HAVING clause should
refer to the last row of the previous group and not to the current one.
This was not done for IS NULL, because it was using Item::is_null() doesn't
have a Item_is_null_result() counterpart to access the data from the
last row of the previous group. Note that all the Item::val_xxx() functions
(e.g. Item::val_int()) have their _result counterparts (e.g. Item::val_int_result()).
Fixed by implementing a is_null_result() (similarly to int_result()) and
calling this instead of is_null() column and SELECT list references inside
the HAVING clause.
mysql-test/r/having.result:
Bug #38637: test case
mysql-test/t/having.test:
Bug #38637: test case
sql/item.cc:
Bug #38637: implement Item::is_null_result() and call it
from Item_ref and Item_field as appropriate.
sql/item.h:
Bug #38637: implement Item::is_null_result() and call it
from Item_ref and Item_field as appropriate.
sql/item_func.cc:
Bug #38637: implement Item::is_null_result() and call it
from Item_ref and Item_field as appropriate.
sql/item_func.h:
Bug #38637: implement Item::is_null_result() and call it
from Item_ref and Item_field as appropriate.
Server crashed during a sort order optimization
of a dependent subquery:
SELECT
(SELECT t1.a FROM t1, t2
WHERE t1.a = t2.b AND t2.a = t3.c
ORDER BY t1.a)
FROM t3;
Bitmap of tables, that the reference to outer table
column uses, in addition to the regular table bit
has the OUTER_REF_TABLE_BIT bit set.
The only_eq_ref_tables function traverses this map
bit by bit simultaneously with join->map2table list.
Obviously join->map2table never contains an entry
for the OUTER_REF_TABLE_BIT pseudo-table, so the
server crashed there.
The only_eq_ref_tables function has been modified
to traverse regular table bits only like the
update_depend_map function (resetting of the
OUTER_REF_TABLE_BIT there is enough, but
resetting of the whole set of PSEUDO_TABLE_BITS
is used there for sure).
mysql-test/r/order_by.result:
Added test case for bug #39844.
mysql-test/t/order_by.test:
Added test case for bug #39844.
sql/sql_select.cc:
Bug #39844: Query Crash Mysql Server 5.0.67
The only_eq_ref_tables function has been modified
to traverse regular table bits only like the
update_depend_map function (resetting of the
OUTER_REF_TABLE_BIT there is enough, but
resetting of the whole set of PSEUDO_TABLE_BITS
is used there for sure).
The problem is that the offset argument of the limit clause
might be truncated on a 32-bits server built without big
tables support. The truncation was happening because the
original 64-bits long argument was being cast to a 32-bits
(ha_rows) offset counter.
The solution is to check if the conversing resulted in value
truncation and if so, the offset is set to the maximum possible
value that can fit on the type.
mysql-test/r/limit.result:
Add test case result for Bug#37075
mysql-test/t/limit.test:
Add test case for Bug#37075
sql/sql_lex.cc:
Check for truncation of the offset value. If value was
truncated, set to the maximum possible value.
If delayed insert fails to upgrade the lock it was not
freeing the temporary memory storage used to keep
newly constructed blob values in memory.
Fixed by iterating over the remaining rows in the delayed
insert rowset and freeing the blob storage for each row.
No test suite because it involves concurrent delayed inserts
on a table and cannot easily be made deterministic.
Added a correct valgrind suppression for Fedora 9.
mysql-test/valgrind.supp:
Added a vagrind suppression for Fedora 9
sql/sql_insert.cc:
Bug #38693: free the blobs temp storage on error.
The problem is that field names constructed due to wild-card
expansion done inside a stored procedure could point to freed
memory if the expansion was performed after the first call to
the stored procedure.
The problem was solved by patch for Bug#38691. The solution
was to allocate the database, table and field names in the
in the statement memory instead of table memory.
mysql-test/r/sp.result:
Add test case result for Bug#38823
mysql-test/t/sp.test:
Add test case for Bug#38823
sql/item.cc:
Remark that this also impacts wildcard expansion inside SPs.
- The problem was that we didn't inform the handler that we are going to close tables that are locked and may have (at least in Maria) be part of an active transaction.
Fix for Bug#39227 Maria: crash with ALTER TABLE PARTITION
Fix for Bug #39987 main.partition_not_windows fails under debug build
Fixed some compiler errors & warnings found by pushbuild
include/my_base.h:
Added HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for signaling the handler that the file will be forced closed
include/my_global.h:
Removed 'register' from 'swap_variables' as this gives a warnings when the variables are structs. Compilers should also now be smart enough to figure out this themselves
mysql-test/r/subselect_debug.result:
Reset value of the debug variable; Without setting this the subselect_innodb test will fail when run after this one
mysql-test/suite/maria/r/maria.result:
Merged test with myisam.test
Added tests for new fixed bugs
mysql-test/suite/maria/t/maria.test:
Merged test with myisam.test
Added tests for new fixed bugs
mysql-test/t/subselect_debug.test:
Reset value of the debug variable; Without setting this the subselect_innodb test will fail when run after this one
mysys/my_uuid.c:
Fixed compiler error on windows
sql/ha_partition.cc:
Added support for the new extra flag: HA_EXTRA_PREPARE_FOR_FORCED_CLOSE (Bug #39226)
Ensure that we call extra() for HA_EXTRA_PREPARE_FOR_DROP (Bug#39227)
sql/mysqld.cc:
Fix for Bug #39987 main.partition_not_windows fails under debug build
The problem was that when compiling for purify/valgrind realpath() is not used, which causes test_if_data_home_dir to fail when it shouldn't
sql/sql_base.cc:
Call HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for tables that are locked but we are going to force close without doing a commit
sql/sql_parse.cc:
More DBUG_PRINT. Fixed comments
storage/maria/ma_extra.c:
If HA_EXTRA_PREPARE_FOR_FORCED_CLOSE is called and the table is part of a transaction, remove the table from beeing part of a transaction.
This is safe as this is only used as part of flush tables or when the table is not part of a transaction
storage/myisam/mi_open.c:
Indentation fix
unittest/mysys/waiting_threads-t.c:
Remove not needed 'volatile' to get rid of compiler warnings on windows
Fixed also some failing tests after merge. The files that was touched outside of the merge has a more explicit comment
include/my_global.h:
Remove 'register' from 'swap_variables' as this gives a warnings when the variables are structs. Compilers should also now be smart enough to figure out this themselves
mysql-test/t/subselect_debug.test:
Reset value of the debug variable; Without setting this the subselect_innodb test will fail when run after this one
sql/mysqld.cc:
Fix for Bug #39987 main.partition_not_windows fails under debug build
The problem was that when compiling for purify/valgrind realpath() is not used, which causes test_if_data_home_dir to fail when it shouldn't
unittest/mysys/waiting_threads-t.c:
Remove not needed 'volatile' to get rid of compiler warnings on windows
on non-partitioned table
Problem was that partitioning specific commands was accepted
for non partitioned tables and treated like
ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE, after bug-20129 was fixed,
which changed the code path from mysql_alter_table to
mysql_admin_table.
Solution was to check if the table was partitioned before
trying to execute the admin command
mysql-test/r/partition_mgm_err.result:
Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
on non-partitioned table
Updated test result
mysql-test/t/partition_mgm_err.test:
Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
on non-partitioned table
Updated test case
sql/ha_partition.cc:
Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
on non-partitioned table
Simplified the code by using ALTER_ADMIN_PARTITION for all
commands that go through mysql_admin_tables and is set
for partitioning specific commands that.
sql/ha_partition.h:
Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
on non-partitioned table
Simplified the code by using ALTER_ADMIN_PARTITION for all
commands that go through mysql_admin_tables and is set
for partitioning specific commands that.
sql/sql_lex.h:
Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
on non-partitioned table
Simplified the code by using ALTER_ADMIN_PARTITION for all
commands that go through mysql_admin_tables and is set
for partitioning specific commands that.
Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
added ALTER_ADMIN_PARTITION instead.
sql/sql_partition.cc:
Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
on non-partitioned table
Simplified the code by using ALTER_ADMIN_PARTITION for all
commands that go through mysql_admin_tables and is set
for partitioning specific commands that.
Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
added ALTER_ADMIN_PARTITION instead.
sql/sql_table.cc:
Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
on non-partitioned table
Give error and return if trying partitioning admin command
on non partitioned table.
Simplified the code by using ALTER_ADMIN_PARTITION for all
commands that go through mysql_admin_tables and is set
for partitioning specific commands that.
Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
added ALTER_ADMIN_PARTITION instead.
sql/sql_yacc.yy:
Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
on non-partitioned table
Simplified the code by using ALTER_ADMIN_PARTITION for all
commands that go through mysql_admin_tables and is set
for partitioning specific commands that.
Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
added ALTER_ADMIN_PARTITION instead.
The problem was that we didn't inform the handler that we are going to close tables that are locked and may have (at least in Maria) be part of an active transaction.
Fix for Bug#39227 Maria: crash with ALTER TABLE PARTITION
include/my_base.h:
Added HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for signaling the handler that the file will be forced closed
mysql-test/r/maria.result:
Test cases for bugs fixed
mysql-test/t/maria.test:
Test cases for bugs fixed
sql/ha_partition.cc:
Added support for the new extra flag: HA_EXTRA_PREPARE_FOR_FORCED_CLOSE (Bug #39226)
Ensure that we call extra() for HA_EXTRA_PREPARE_FOR_DROP (Bug#39227)
sql/sql_base.cc:
Call HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for tables that are locked but we are going to force close without doing a commit
storage/maria/ma_extra.c:
If HA_EXTRA_PREPARE_FOR_FORCED_CLOSE is called and the table is part of a transaction, remove the table from beeing part of a transaction. This is safe as this is only used as part of flush tables or when the table is not part of a transaction
Debug builds of MySQL 5.1, 6.0 with Sun Studio 12 broke because of
use of gcc specific feature.
The fix is to replace __FUNCTION__ with the corresponding character
string
Select with a "NULL NOT IN" condition containing complex
subselect from the same table as in the outer select failed
with an assertion.
The failure was caused by a concatenation of circumstances:
1) an inner select was optimized by make_join_statistics to use
the QUICK_RANGE_SELECT access method (that implies an index
scan of the table);
2) a subselect was independent (constant) from the outer select;
3) a condition was pushed down into inner select.
During the evaluation of a constant IN expression an optimizer
temporary changed the access method from index scan to table
scan, but an engine handler was already initialized for index
access by make_join_statistics. That caused an assertion.
Unnecessary index initialization has been removed from
the QUICK_RANGE_SELECT::init method (QUICK_RANGE_SELECT::reset
reinvokes this initialization).
mysql-test/r/subselect3.result:
Added test case for bug #37894.
mysql-test/t/subselect3.test:
Added test case for bug #37894.
sql/opt_range.cc:
Bug #37894: Assertion in init_read_record_seq in handler.h line 1444
Unnecessary index initialization has been removed from
the QUICK_RANGE_SELECT::init method (QUICK_RANGE_SELECT::reset
reinvokes this initialization).
with COALESCE and JOIN
The server returned to a client the VARBINARY column type
instead of the DATE type for a result of the COALESCE,
IFNULL, IF, CASE, GREATEST or LEAST functions if that result
was filesorted in an anonymous temporary table during
the query execution.
For example:
SELECT COALESCE(t1.date1, t2.date2) AS result
FROM t1 JOIN t2 ON t1.id = t2.id ORDER BY result;
To create a column of various date/time types in a
temporary table the create_tmp_field_from_item() function
uses the Item::tmp_table_field_from_field_type() method
call. However, fields of the MYSQL_TYPE_NEWDATE type were
missed there, and the VARBINARY columns were created
by default.
Necessary condition has been added.
mysql-test/r/metadata.result:
Added test case for bug #39283.
mysql-test/t/metadata.test:
Added test case for bug #39283.
sql/sql_select.cc:
Bug #39283: Date returned as VARBINARY to client for queries
with COALESCE and JOIN
To create a column of various date/time types in a
temporary table the create_tmp_field_from_item() function
uses the Item::tmp_table_field_from_field_type() method
call. However, fields of the MYSQL_TYPE_NEWDATE type were
missed there, and the VARBINARY columns were created
by default.
Necessary condition has been added.
index column
There was actually two problems
1) when clustered pk, order by non pk index should also
compare with pk as last resort to differ keys from each
other
2) bug in the index search handling in ha_partition (was
found when extending the test case
Solution to 1 was to include the pk in key compare if
clustered pk and search on other index.
Solution for 2 was to remove the optimization from
ordered scan to unordered scan if clustered pk.
mysql-test/r/partition_innodb.result:
Bug#37721: ORDER BY when WHERE contains non-partitioned
index column
updated test result.
mysql-test/t/partition_innodb.test:
Bug#37721: ORDER BY when WHERE contains non-partitioned
index column
Added test case for bug verification.
sql/ha_partition.cc:
Bug#37721: ORDER BY when WHERE contains non-partitioned
index column
using m_curr_key_info with both given index and PK
if clustered PK.
Also including PK in read_set.
Added debug prints for easier verification.
sql/ha_partition.h:
Bug#37721: ORDER BY when WHERE contains non-partitioned
index column
Changed m_curr_key_info to a null terminated array
with max 2 keys and a terminating null.
For use with key_rec_cmp with both given index and PK.
sql/key.cc:
Bug#37721: ORDER BY when WHERE contains non-partitioned
index column
added handling of a null terminated array of keys for
use in compare.
derived table cause crash
When a multi-UPDATE command fails to lock some table, and
subsequently succeeds, the tables need to be reopened if
they were altered. But the reopening procedure failed for
derived tables.
Extra cleanup has been added.
mysql-test/r/lock_multi.result:
Added test case for bug #38499.
mysql-test/t/lock_multi.test:
Added test case for bug #38499.
sql/sql_union.cc:
Bug#38499: flush tables and multitable table update with
derived table cause crash
Obsolete assertion has been removed.
sql/sql_update.cc:
Bug#38499: flush tables and multitable table update with
derived table cause crash
Extra cleanup for derived tables has been added:
1) unit.cleanup(),
2) unit->reinit_exec_mechanism().
Fixed the handling of system variable retrieval
in prepared statements : added a cleanup method
that clears up the cache and restores the
original scope of the variable (which is overwritten
at fix_fields()).
sql/item_func.cc:
ug #32124:
- preserve the requested variable scope
- clean up the cache and restore the variable
scope for prepared statements.
sql/item_func.h:
Bug #32124: preserve the requested variable scope
TRIGGERS.SQL_MODE, EVENTS.SQL_MODE, TRIGGERS.DEFINER:
field type is changed to VARCHAR.
mysql-test/r/information_schema.result:
result fix
mysql-test/r/show_check.result:
result fix
mysql-test/suite/funcs_1/r/is_columns_is.result:
result fix
mysql-test/suite/funcs_1/r/is_events.result:
result fix
mysql-test/suite/funcs_1/r/is_triggers.result:
result fix
sql/sql_show.cc:
TRIGGERS.SQL_MODE, EVENTS.SQL_MODE, TRIGGERS.DEFINER:
field type is changed to VARCHAR.
The problem was that PACK_KEYS and MAX_ROWS clause in ALTER TABLE did not trigger
table reconstruction.
The fix is to rebuild a table if PACK_KEYS or MAX_ROWS are specified.
mysql-test/r/alter_table.result:
test result
mysql-test/t/alter_table.test:
test case
sql/sql_table.cc:
The problem was that PACK_KEYS and MAX_ROWS clause in ALTER TABLE did not trigger
table reconstruction.
The fix is to rebuild a table if PACK_KEYS or MAX_ROWS are specified.
Hide "Table doesn't exist" errors if the table belongs to a merge table.
mysql-test/r/merge.result:
result fix
mysql-test/t/merge.test:
test case
sql/sql_base.cc:
Hide "Table doesn't exist" errors if the table belongs to a merge table.
The problem: table_open_method is not calculated properly if '*' is used in 'select'
The fix: added table_open_method calculation for such case
mysql-test/r/information_schema.result:
test result
mysql-test/t/information_schema.test:
test case
sql/sql_show.cc:
The problem: table_open_method is not calculated properly if '*' is used in 'select'
The fix: added table_open_method calculation for such case
When running Stored Routines the Status Variable "Questions" was wrongly
incremented. According to the manual it should contain the "number of
statements that clients have sent to the server"
Introduced a new status variable 'questions' to replace the query_id
variable which currently corresponds badly with the number of statements
sent by the client.
The new behavior is ment to be backward compatible with 4.0 and at the
same time work with new features in a similar way.
This is a backport from 6.0
mysql-test/r/status2.result:
Added test case
mysql-test/t/status2.test:
Added test case
sql/mysqld.cc:
Introduced a new status variable 'questions' to replace the query_id
variable which currently corresponds badly with the number of statements
sent by the client.
sql/sql_class.h:
Introduced a new status variable 'questions' to replace the query_id
variable which currently corresponds badly with the number of statements
sent by the client.
sql/sql_parse.cc:
To be backward compatible with 4.0 and at the same time extend the
interpretation of the Question variable, it should be increased on
all COM-commands but COM_STATISTICS, COM_PING, COM_STMT_PREPARE,
COM_STMT_CLOSE and COM_STMT_RESET.
Since COM_QUERY can process multiple statements, there has to be an
extra increase there as well.
sql/sql_show.cc:
Removed deprecated SHOW_QUESTION status code.
sql/structs.h:
Removed deprecated SHOW_QUESTION status code.
upgrade from <=5.0.46 to >=5.0.48
Problem: 'check table .. for upgrade' doesn't detect
incompatible collation changes made in 5.0.48.
Fix: check for incompatible collation changes.
sql/handler.cc:
Fix for bug#39585: innodb and myisam corruption after binary
upgrade from <=5.0.46 to >=5.0.48
- check for incompatible collation changes made in 5.0.48:
bug #29461
latin7_general_ci
latin7_general_cs
latin7_estonian_cs
latin2_hungarian_ci
koi8u_general_ci
cp1251_ukrainian_ci
cp1250_general_ci
bug #29499, bug #27562
ascii_general_ci
The code to get read the value of a system variable was extracting its value
on PREPARE stage and was substituting the value (as a constant) into the parse tree.
Note that this must be a reversible transformation, i.e. it must be reversed before
each re-execution.
Unfortunately this cannot be reliably done using the current code, because there are
other non-reversible source tree transformations that can interfere with this
reversible transformation.
Fixed by not resolving the value at PREPARE, but at EXECUTE (as the rest of the
functions operate). Added a cache of the value (so that it's constant throughout
the execution of the query). Note that the cache also caches NULL values.
Updated an obsolete related test suite (variables-big) and the code to test the
result type of system variables (as per bug 74).
mysql-test/extra/rpl_tests/rpl_insert_id.test:
Bug #32124: removed ambiguous testcase
mysql-test/r/innodb_data_home_dir_basic.result:
Bug #32124: fixed wrong test case
mysql-test/r/innodb_flush_method_basic.result:
Bug #32124: fixed wrong test case
mysql-test/r/ps_11bugs.result:
Bug #32124: test case
mysql-test/r/ssl_capath_basic.result:
Bug #32124: fixed wrong test case
mysql-test/r/ssl_cipher_basic.result:
Bug #32124: fixed wrong test case
mysql-test/r/variables.result:
Bug #32124: system vars are shown as such in EXPLAIN EXTENDED, not as constants.
mysql-test/suite/rpl/r/rpl_insert_id.result:
Bug #32124: removed ambiguous testcase
mysql-test/t/ps_11bugs.test:
Bug #32124: test case
sql/item.cc:
Bug #32124: placed the code to convert string to longlong or double
to a function (so that it can be reused)
sql/item.h:
Bug #32124: placed the code to convert string to longlong or double
to a function (so that it can be reused)
sql/item_func.cc:
Bug #32124: moved the evaluation of system variables at runtime (val_xxx).
sql/item_func.h:
Bug #32124: moved the evaluation of system variables at runtime (val_xxx).
sql/set_var.cc:
Bug #32124: removed the code that calculated the system variable's value
at PREPARE
sql/set_var.h:
Bug #32124: removed the code that calculated the system variable's value
at PREPARE
tests/mysql_client_test.c:
Bug #32124 : removed the reading of the system variable, because its max
length is depended on the system charset and client charset and can't be
easily calculated.
The failure was caused by executing a CREATE-SELECT statement that creates a
table in another database than the current one. In row-based logging, the
CREATE statement was written to the binary log without the database, hence
creating the table in the wrong database, causing the following inserts to
fail since the table didn't exist in the given database.
Fixed the bug by adding a parameter to store_create_info() that will make
the function print the database name before the table name and used that
in the calls that write the CREATE statement to the binary log. The database
name is only printed if it is different than the currently selected database.
The output of SHOW CREATE TABLE has not changed and is still printed without
the database name.
mysql-test/suite/rpl/t/rpl_row_create_table.test:
Added test to check that CREATE-SELECT into another database than the
current one replicates.
sql/sql_insert.cc:
Adding parameter to calls to store_create_info().
sql/sql_show.cc:
Adding parameter to calls to store_create_info().
Extending store_create_info() with parameter 'show_database' that will cause
the database to be written before the table name.
sql/sql_show.h:
Adding parameter to call to store_create_info() to tell if the database should be shown or not.
sql/sql_table.cc:
Adding parameter to calls to store_create_info().
InnoDB Plugin locks table
This is a pre fix update that does the change to the handler api.
This is done since there are already changes in this version,
so the real fix does not need to change the api.
sql/handler.h:
Bug#37453: Dropping/creating index on partitioned table with
InnoDB Plugin locks table
The check for which alter table flags a handler have is done through the
handlerton, which will not work correctly for any partitioned table.
It must be through the handler interface.
To be able to fix this I have to add a virtual function to the handler class.
``FLUSH TABLES WITH READ LOCK''
Concurrent execution of 1) multitable update with a
NATURAL/USING join and 2) a such query as "FLUSH TABLES
WITH READ LOCK" or "ALTER TABLE" of updating table led
to a server crash.
The mysql_multi_update_prepare() function call is optimized
to lock updating tables only, so it postpones locking to
the last, and if locking fails, it does cleanup of modified
syntax structures and repeats a query analysis. However,
that cleanup procedure was incomplete for NATURAL/USING join
syntax data: 1) some Field_item items pointed into freed
table structures, and 2) the TABLE_LIST::join_columns fields
was not reset.
Major change:
short-living Field *Natural_join_column::table_field has
been replaced with long-living Item*.
mysql-test/r/lock_multi.result:
Added test case for bug #38691.
mysql-test/t/lock_multi.test:
Added test case for bug #38691.
sql/item.cc:
Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
``FLUSH TABLES WITH READ LOCK''
The Item_field constructor has been modified to allocate
and copy original database/table/field names always (not
during PS preparation/1st execution only), because
an initialization of Item_field items with a pointer to
short-living Field structures is a common practice.
sql/sql_base.cc:
Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
``FLUSH TABLES WITH READ LOCK''
1) Type adjustment for Natural_join_column::table_field
(Field to Item_field);
2) The setup_natural_join_row_types function has been
updated to take into account new
first_natural_join_processing flag to skip unnecessary
reinitialization of Natural_join_column::join_columns
during table reopening after lock_tables() failure
(like the 'first_execution' flag for PS).
sql/sql_lex.cc:
Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
``FLUSH TABLES WITH READ LOCK''
Initialization of the new
st_select_lex::first_natural_join_processing flag has
been added.
sql/sql_lex.h:
Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
``FLUSH TABLES WITH READ LOCK''
The st_select_lex::first_natural_join_processing flag
has been added to skip unnecessary rebuilding of
NATURAL/USING JOIN structures during table reopening
after lock_tables failure.
sql/sql_update.cc:
Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
``FLUSH TABLES WITH READ LOCK''
Extra cleanup calls have been added to reset
Natural_join_column::table_field items.
sql/table.cc:
Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
``FLUSH TABLES WITH READ LOCK''
Type adjustment for Natural_join_column::table_field
(Field to Item_field).
sql/table.h:
Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
``FLUSH TABLES WITH READ LOCK''
Type of the Natural_join_column::table_field field has
been changed from Field that points into short-living
TABLE memory to long-living Item_field that can be
linked to (fixed) reopened table.
The event scheduler logged start-, stop-execution messages in the error log
on lowest log-warning level which would lead to very large log files in
a short time.
This patch changes this behavior so that no start-/stop-messages are logged.
Log messages stating successful execution are also removed.
sql/event_scheduler.cc:
* Removed logging for start-/stop-events.
* Removed log-messages stating successful execution of events.
ha_statistic_increment for rpl_temporary
Problem: in some cases master send a special event to reconnecting
slave to keep slave's temporary tables (see #17284) and they still
have references to the "old" SQL slave thread and use them to access
thread's data.
Fix: set temporary tables thread references to the actual SQL slave
thread in such cases.
mysql-test/suite/rpl/t/disabled.def:
Fix for bug#38269: pushbuild gives valgrind error in
ha_statistic_increment for rpl_temporary
- rpl_temporary test enabled.
sql/log_event.cc:
Fix for bug#38269: pushbuild gives valgrind error in
ha_statistic_increment for rpl_temporary
- if we keep slave's temporary tables after reconnect,
set their thread pointers (->in_use) to the current SQL thread.
Concurrent inserts produce valgrind error messages.
The reason is that the query cache is invalidated after the target table object
is closed.
Since the delayed insert thread already takes care of invalidating the query
cache there is no need to try to synchronize an extra cache invalidation call.
The fix is to remove the query_cache_invalidate3 call altogether.
sql/sql_insert.cc:
When end_delayed_insert is called, the table_list items will be invalidated
by the concurrent insert thread. Further more there is no need to call
query_cache_invalidate here since the delayed insert thread takes care of
this already.
warnings)
Before this fix, several places in the code would raise a warning with an
error code 0, making it impossible for a stored procedure, a connector,
or a client application to trigger logic to handle the warning.
Also, the warning text was hard coded, and therefore not translated.
With this fix, new errors numbers have been created to represent these
warnings, and the warning text is coded in the errmsg.txt file.
Adds --general-log-file, --slow-query-log-file command-
line options to match system variables of the same names.
Deprecates --log, --log-slow-queries command-line option
and log, log_slow_queries system-variables for v7.0; they
are superseded by general_log/general_log_file and
slow_query_log/slow_query_log_file, respectively.
mysql-test/r/log_basic.result:
Change deprecated system variable "log" to
general log.
mysql-test/r/log_bin_trust_routine_creators_basic.result:
Change deprecation warning so it's more obvious we're referring
to a variable.
mysql-test/r/log_state.result:
Show that all log-related server variables that
should throw deprecation warnings do, and the
others don't.
mysql-test/r/warnings.result:
Change deprecation warning so it's more obvious we're referring
to a variable.
mysql-test/suite/rpl/r/rpl_sp.result:
Change deprecation warning so it's more obvious we're referring
to a variable.
mysql-test/t/log_basic.test:
Change deprecated system variable "log" to
general log.
mysql-test/t/log_state.test:
Show that all log-related server variables that
should throw deprecation warnings do, and the
others don't.
sql/mysqld.cc:
Add command-line options --general-log-file and
--slow-query-log-file to match server options of
the same name.
Deprecated --log and --log-slow-queries command-line
options; they are superseded by --general-log/
--general-log-file and --slow-query-log/--slow-query-log-file,
respectively
sql/set_var.cc:
Deprecate system-variables log in favour of general_log,
log_slow_queries in favour of slow_query_log for 7.0,
both for value- and DEFAULT-setting.
crashes server
When creating temporary table that contains aggregate functions a
non-reversible source transformation was performed to redirect aggregate
function arguments towards temporary table columns.
This caused EXPLAIN EXTENDED to fail because it was trying to resolve
references to the (freed) temporary table.
Fixed by preserving the original aggregate function arguments and
using them (instead of the transformed ones) for EXPLAIN EXTENDED.
mysql-test/r/explain.result:
Bug#34773: test case
mysql-test/t/explain.test:
Bug#34773: test case
sql/item.cc:
Bug#34773: use accessor functions instead of public members
sql/item_sum.cc:
Bug#34773:
- Encapsulate the arguments into Item_sum and
provide accessor and mutator methods
- print the orginal arguments (if present)
in EXPLAIN EXTENDED
- preserve the original arguments list.
sql/item_sum.h:
Bug#34773:
- Encapsulate the arguments into Item_sum and
provide accessor and mutator methods
- print the orginal arguments (if present)
in EXPLAIN EXTENDED
- preserve the original arguments list.
sql/opt_range.cc:
Bug#34773: use accessor functions instead of public members
sql/opt_sum.cc:
Bug#34773: use accessor functions instead of public members
sql/sql_select.cc:
Bug#34773: use accessor functions instead of public members
"Trigger fired multiple times leads to gaps in auto_increment sequence".
The bug was that if a trigger fired multiple times inside a top
statement (for example top-statement is a multi-row INSERT,
and trigger is ON INSERT), and that trigger inserted into an auto_increment
column, then gaps could be observed in the auto_increment sequence,
even if there were no other users of the database (no concurrency).
It was wrong usage of THD::auto_inc_intervals_in_cur_stmt_for_binlog.
Note that the fix changes "class handler", I'll tell the Storage Engine API team.
mysql-test/r/trigger-trans.result:
result; before the bugfix, the sequence was 1,2,4,6,8,10,12...
mysql-test/t/trigger-trans.test:
test for BUG#31612
sql/handler.cc:
See revision comment of handler.h.
As THD::auto_inc_intervals_in_cur_stmt_for_binlog is cumulative
over all trigger invokations by the top statement, the
second invokation of the trigger arrived in handler::update_auto_increment()
with already one interval in
THD::auto_inc_intervals_in_cur_stmt_for_binlog. The method thus
believed it had already reserved one interval for that invokation,
thus reserved a twice larger interval (heuristic when we don't know
how large the interval should be: we grow by powers of two). InnoDB
thus increased its internal per-table auto_increment counter by 2
while only one row was to be inserted. Hence a gap in the sequence.
The fix is to use the new handler::auto_inc_intervals_count.
Note that the trigger's statement knows how many rows it is going
to insert, but provides estimation_rows_to_insert == 0 (see comments
in sql_insert.cc why triggers don't call handler::ha_start_bulk_insert()).
* removing white space at end of line
* we don't need to maintain THD::auto_inc_intervals_in_cur_stmt_for_binlog
if no binlogging or if row-based binlogging. Using auto_inc_intervals_count in
the heuristic makes the heuristic independent of binary logging, which is good.
sql/handler.h:
THD::auto_inc_intervals_in_cur_stmt_for_binlog served
- for binlogging
- as a heuristic when we have no estimation of how many records the
statement will insert.
But the first goal needs to be cumulative over all statements which
form a binlog event, while the second one needs to be attached to each
statement. THD::auto_inc_intervals_in_cur_stmt_for_binlog is cumulative,
leading to BUG#31612. So we introduce handler::auto_inc_intervals_count
for the second goal. See the revision comment of handler.cc.
A smaller issue was that, even when the binlog event was only one
statement (no triggers, no stored functions),
THD::auto_inc_intervals_in_cur_stmt.nb_elements() could be lower than
the number of reserved intervals (fooling the heuristic), because its
append() method collapses two contiguous intervals in one.
Note that as auto_inc_intervals_count is in class 'handler' and not
in class 'THD', it does not need to be handled in
THD::reset|restore_sub_statement_state().
sql/log.cc:
Comment is wrong: if auto_increment is second, in handler::update_auto_increment()
'append' is false and so auto_inc_intervals_in_cur_stmt_for_binlog
is empty, we do not come here.
sql/sql_class.h:
comment
MyISAM blocks index usage for bulk insert into zero-records tables.
See ha_myisam::start_bulk_insert() lines from
...
if (file->state->records == 0 ...
...
That causes problems for partition engine when some partitions have records some not
as the engine uses same access method for all partitions.
Now partition engine doesn't call index_first/index_last
for empty tables.
per-file comments:
mysql-test/r/partition.result
Bug#38005 Partitions: error with insert select.
test result
mysql-test/t/partition.test
Bug#38005 Partitions: error with insert select.
test case
sql/ha_partition.cc
Bug#38005 Partitions: error with insert select.
ha_engine::index_first and
ha_engine::index_last not called for empty tables.
Adds --general_log_file, --slow_query_log_file command-
line options to match system variables of the same names.
Deprecates --log, --log-slow-queries command-line options
and log, log_slow_queries system-variables for v7.0; they
are superseded by general_log/general_log_file and
slow_query_log/slow_query_log_file, respectively.
mysql-test/r/log_basic.result:
Change deprecated system variable "log" to
general log.
mysql-test/r/log_state.result:
Show that all log-related server variables that
should throw deprecation warnings do, and the
others don't.
mysql-test/t/log_basic.test:
Change deprecated system variable "log" to
general log.
mysql-test/t/log_state.test:
Show that all log-related server variables that
should throw deprecation warnings do, and the
others don't.
sql/mysqld.cc:
Add command-line options --general_log_file and
--slow_query_log_file to match server options of
the same name.
Deprecated --log and --log-slow-queries command-line
options; they are superseded by --general-log/
--general-log-file and --slow-query-log/--slow-query-log-file,
respectively
sql/set_var.cc:
Deprecate system-variables log in favour of general_log,
log_slow_queries in favour of slow_query_log for 7.0,
both for value- and DEFAULT-setting.
problems are located in the sql_partition.cc where functions calculation
partition_id don't expect error returned from item->val_int().
Fixed by adding checks to these functions.
Note - it tries to fix more problems than just the reported bug.
per-file comments:
modified:
mysql-test/r/partition.result
Bug#38083 Error-causing row inserted into partitioned table despite error
test result
mysql-test/t/partition.test
Bug#38083 Error-causing row inserted into partitioned table despite error
test case
sql/opt_range.cc
Bug#38083 Error-causing row inserted into partitioned table despite error
get_part_id() call fixed
sql/partition_info.h
Bug#38083 Error-causing row inserted into partitioned table despite error
get_subpart_id_func interface changed.
sql/sql_partition.cc
Bug#38083 Error-causing row inserted into partitioned table despite error
various functions calculationg partition_id and subpart_id didn't expect
an error returned from item->val_int(). Error checks added.
InnoDB Plugin locks table
The fast/on-line add/drop index handler calls was not implemented
whithin the partitioning.
This implements it in the partitioning handler.
Since this is only used by the not included InnoDB plugin, there
is no test case. (Have tested it manually with the plugin, and
it does not allow unique indexes not including partitioning
function, or removal of pk, which in innodb generates a new pk,
which is not in the partitioning function.)
NOTE: This introduces a new handler method, and because of that
changes the storage engine api. (One cannot use a handlerton to
see the capabilities of a table's handler if it is partitioned.
So I added a wrapper function in the handler that defaults to
the handlerton function, which the partitioning handler overrides.
sql/ha_partition.cc:
Bug#37453: Dropping/creating index on partitioned table with
InnoDB Plugin locks table
Added support for fast/on-line add/drop index.
Implemented alter_table_flags as bit-or of the partitioned
hton and the first partitions alter_table_flags.
It is only to forward the calls for the other functions:
check_if_incompatible_data
add_index
prepare_drop_index
final_drop_index
to all parts handler
sql/ha_partition.h:
Bug#37453: Dropping/creating index on partitioned table with
InnoDB Plugin locks table
Added support for fast/on-line add/drop index.
sql/handler.h:
Bug#37453: Dropping/creating index on partitioned table with
InnoDB Plugin locks table
Added the function on handler level, defaulting to use
the handlerton function, but a handler can override it.
Needed for partitioned tables.
NOTE: Change of storage engine api.
sql/sql_partition.cc:
Bug#37453: Dropping/creating index on partitioned table with
InnoDB Plugin locks table
Using the new handler function, instead of the handlerton
function. This works better with the partitioning handler.
sql/sql_table.cc:
Bug#37453: Dropping/creating index on partitioned table with
InnoDB Plugin locks table
Using the new handler function, instead of the handlerton
function. This works better with the partitioning handler.
Also using new process info for 'manage keys' (kind of fix
for bug-37550).
Make STMT replication default for 5.1.
Add a default of MIXED into the config files
Fix the tests that needed MIXED replication mode.
mysql-test/include/mix1.inc:
Bug #39812: Fix the tests that needed MIXED replication mode.
mysql-test/r/innodb-semi-consistent.result:
Bug #39812: Fix the tests that needed MIXED replication mode.
mysql-test/r/innodb.result:
Bug #39812: Fix the tests that needed MIXED replication mode.
mysql-test/r/innodb_mysql.result:
Bug #39812: Fix the tests that needed MIXED replication mode.
mysql-test/r/tx_isolation_func.result:
Bug #39812: Fix the tests that needed MIXED replication mode.
mysql-test/t/innodb-semi-consistent.test:
Bug #39812: Fix the tests that needed MIXED replication mode.
mysql-test/t/innodb.test:
Bug #39812: Fix the tests that needed MIXED replication mode.
mysql-test/t/tx_isolation_func.test:
Bug #39812: Fix the tests that needed MIXED replication mode.
sql/mysqld.cc:
Bug #39812: Make STMT replication default for 5.1.
support-files/my-huge.cnf.sh:
Bug #39812: Add a default of MIXED into the config files
support-files/my-innodb-heavy-4G.cnf.sh:
Bug #39812: Add a default of MIXED into the config files
support-files/my-large.cnf.sh:
Bug #39812: Add a default of MIXED into the config files
support-files/my-medium.cnf.sh:
Bug #39812: Add a default of MIXED into the config files
support-files/my-small.cnf.sh:
Bug #39812: Add a default of MIXED into the config files
The problem was caused by a wrong merge. Fixed by enabling the correct ndb variables
initialization.
mysql-test/suite/ndb/t/disabled.def:
Bug #38370: remove disabled test case
sql/mysqld.cc:
Bug #38370: corrected a wrong merge to have all the NDB variables intiialized
correctly
Removes the regression bug#38751.
sql/ha_partition.cc:
post push fix for bug#38804 (back port of bug#33479)
Removes the regression bug#38751.
archive relies on a ha_archive::info call to flush data before
the copy takes place in alter table.
This ensures that all partitions gets a info call, without having
to always forward info(HA_STATUS_AUTO) to all partitions.
DBUG_EXECUTE_IF macro. The usage of the former caused breakage in other
trees as it got removed from the dbug library.
sql/sql_base.cc:
Rework code to remove unreliable usage of _db_script_keyword_.
The optimizer pulls up aggregate functions which should be aggregated in
an outer select. At some point it may substitute such a function for a field
in the temporary table. The setup_copy_fields function doesn't take this
into account and may overrun the copy_field buffer.
Fixed by filtering out the fields referenced through the specialized
reference for aggregates (Item_aggregate_ref).
Added an assertion to make sure bugs that cause similar discrepancy
don't go undetected.
mysql-test/r/func_group.result:
Bug #37348: test case
mysql-test/t/func_group.test:
Bug #37348: test case
sql/item.cc:
Bug #37348: Added a way to distinguish Item_aggregate_ref from the other types of refs
sql/item.h:
Bug #37348: Added a way to distinguish Item_aggregate_ref from the other types of refs
sql/sql_select.cc:
Bug #37348:
- Don't consider copying field references
seen through Item_aggregate_ref
- check for discrepancies between the number of expected
fields that need copying and the actual fields copied.
The '@' symbol can not be used in the host name according to rfc952.
The fix:
added function check_host_name(LEX_STRING *str)
which checks that all symbols in host name string are valid and
host name length is not more than max host name length
(just moved check_string_length() function from the parser into check_host_name()).
mysql-test/r/create.result:
test result
mysql-test/t/create.test:
test case
sql/mysql_priv.h:
added function check_host_name(LEX_STRING *str)
sql/sql_parse.cc:
added function check_host_name(LEX_STRING *str)
which checks that all symbols in host name string are valid and
host name length is not more than max host name length(HOSTNAME_LENGTH).
sql/sql_yacc.yy:
using newly added function check_host_name()
The problem:
I_S views table does not check the presence of SHOW_VIEW_ACL|SELECT_ACL
privileges for a view. It leads to discrepancy between SHOW CREATE VIEW
and I_S.VIEWS.
The fix:
added appropriate check.
mysql-test/r/information_schema_db.result:
test result
mysql-test/t/information_schema_db.test:
test case
sql/sql_show.cc:
The problem:
I_S views table does not check the presence of SHOW_VIEW_ACL|SELECT_ACL
privileges for a view. It leads to discrepancy between SHOW CREATE VIEW
and I_S.VIEWS.
The fix:
added appropriate check.
The Blackhole engine did not support row-based replication
since the delete_row(), update_row(), and the index and range
searching functions were not implemented.
This patch adds row-based replication support for the
Blackhole engine by implementing the two functions mentioned
above, and making the engine pretend that it has found the
correct row to delete or update when executed from the slave
SQL thread by implementing index and range searching functions.
It is necessary to only pretend this for the SQL thread, since
a SELECT executed on the Blackhole engine will otherwise never
return EOF, causing a livelock.
mysql-test/extra/binlog_tests/blackhole.test:
Blackhole now handles row-based replication.
mysql-test/extra/rpl_tests/rpl_blackhole.test:
Test helper file for testing that blackhole actually
writes something to the binary log on the slave.
mysql-test/suite/binlog/t/binlog_multi_engine.test:
Replication now handles row-based replcation.
mysql-test/suite/rpl/t/rpl_blackhole.test:
Test that Blackhole works with primary key, index, or none.
sql/log_event.cc:
Correcting code to only touch filler bits and leave
all other bits alone. It is necessary since there is
no guarantee that the engine will be able to fill in
the bits correctly (e.g., the blackhole engine).
storage/blackhole/ha_blackhole.cc:
Adding definitions for update_row() and delete_row() to return OK
when executed from the slave SQL thread with thd->query == NULL
(indicating that row-based replication events are being processed).
Changing rnd_next(), index_read(), index_read_idx(), and
index_read_last() to return OK when executed from the slave SQL
thread (faking that the row has been found so that processing
proceeds to update/delete the row).
storage/blackhole/ha_blackhole.h:
Enabling row capabilities for engine.
Defining write_row(), update_row(), and delete_row().
Making write_row() private (as it should be).
When analyzing the possible index use cases the server was re-using an internal structure.
This is wrong, as this internal structure gets updated during the analysis.
Fixed by making a copy of the internal structure for every place it needs to be used.
Also stopped the generation of empty SEL_TREE structures that unnecessary
complicate the analysis.
mysql-test/r/index_merge.result:
Bug#37943: test case
mysql-test/t/index_merge.test:
Bug#37943: test case
sql/opt_range.cc:
Bug#37943:
- Make copy constructors for SEL_TREE and sub-structures and use them when OR-ing trees.
- don't generate empty SEL_TREEs. Return NULL instead.
Bug#37536: Thread scheduling causes performance degradation at low thread count
Deprecated --skip-thread-priority startup option as newer versions of
the server won't change the thread priorities by default.
Giving threads different priorities might yield marginal improvements
in some platforms (where it actually works) but on the other hand it
might cause significant degradation depending on the thread count and
number of processors. Meddling with the thread priorities is a not a
safe bet as it is very dependent on the behavior of the cpu scheduler
and system where MySQL is being run.
From MySQL 6.0 and up the default behavior is that of not modifying
the threads priorities.
sql/mysqld.cc:
Deprecate --skip-thread-priority
This patch contains fixes for two problems:
1. As originally reported, the server crashed on Mac OS X when trying to access
an EXAMPLE table after the EXAMPLE plugin was installed.
It turned out that the dynamically loaded EXAMPLE plugin called the
function hash_earch() from a Mac OS X system library, instead of
hash_earch() from MySQL's mysys library. Makefile.am in storage/example
does not include libmysys. So the Mac OS X linker arranged the hash_search()
function to be linked to the system library when the shared object is
loaded.
One possible solution would be to include libmysys into the linkage of
dynamic plugins. But then we must have a libmysys.so, which must be
used by the server too. This could have a minimal performance impact,
but foremost the change seems to bee too risky at the current state of
MySQL 5.1.
The selected solution is to rename MySQL's hash_search() to my_hash_search()
like it has been done before with hash_insert() and hash_reset().
Since this is the third time, we need to rename a hash_*() function,
I did renamed all hash_*() functions to my_hash_*().
To avoid changing a zillion calls to these functions, and announcing
this to hundreds of developers, I added defines that map the old names
to the new names.
This change is in hash.h and hash.c.
2. The other problem was improper implementation of the handlerton-to-plugin
mapping. We use a fixed-size array to hold a plugin reference for each
handlerton. On every install of a handler plugin, we allocated a new slot
of the array. On uninstall we did not free it. After some uninstall/install
cycles the array overflowed. We did not check for overflow.
One fix is to check for overflow to stop the crashes.
Another fix is to free the array slot at uninstall and search for a free slot
at plugin install.
This change is in handler.cc.
include/hash.h:
Bug#37958 - test main.plugin crash on Mac OS X when selecting from EXAMPLE engine.
Renamed hash_*() functions to my_hash_*().
Added defines that map old names to new names.
mysys/hash.c:
Bug#37958 - test main.plugin crash on Mac OS X when selecting from EXAMPLE engine.
Renamed hash_*() functions to my_hash_*().
sql/handler.cc:
Bug#37958 - test main.plugin crash on Mac OS X when selecting from EXAMPLE engine.
Protect against a failing ha_initialize_handlerton() in ha_finalize_handlerton().
Free hton2plugin slot on uninstall of a handler plugin.
Reuse freed slost of the hton2plugin array.
Protect against array overrun.
from stored procedure.
Problem: we replace all references to local variables in stored procedures
with NAME_CONST(name, value) logging to the binary log. However, if the
value's collation differs we might get an 'illegal mix of collation'
error as we don't pass the collation to the function.
Fix: pass the value's collation to NAME_CONST().
Note: actually we should pass to NAME_CONST() the value's derivation as well.
It's impossible without the parser modifying. Now we always set the
derivation to DERIVATION_IMPLICIT, the same as local variables have.
mysql-test/r/binlog.result:
Fix for bug#39182: Binary log producing incompatible character set query
from stored procedure.
- test result.
mysql-test/r/ctype_cp932_binlog.result:
Fix for bug#39182: Binary log producing incompatible character set query
from stored procedure.
- results adjusted.
mysql-test/r/rpl_sp.result:
Fix for bug#39182: Binary log producing incompatible character set query
from stored procedure.
- results adjusted.
mysql-test/t/binlog.test:
Fix for bug#39182: Binary log producing incompatible character set query
from stored procedure.
- test case.
sql/item.cc:
Fix for bug#39182: Binary log producing incompatible character set query
from stored procedure.
- allow NAME_CONST() to get _charset'foo' COLLATE 'bar' strings
(see Item_func_set_collation).
sql/sp_head.cc:
Fix for bug#39182: Binary log producing incompatible character set query
from stored procedure.
- pass the value's collation to NAME_CONST().
Post-merge bug fix: lock_type is a enumeration type and not a bit mask.
sql/sql_cache.cc:
Check for lock type explicitly. Also err on the safe side and
invalidate the query cache for any write lock.
Server created "arc" directories inside database directories and
maintained there useless copies of .frm files.
Creation and renaming procedures of those copies as well as
creation of "arc" directories has been discontinued.
Removal procedure has been kept untouched to be able to
cleanup existent database directories by the DROP DATABASE
query. Also view renaming procedure has been updated to remove
these directories.
sql/parse_file.cc:
Fixed bug #17823: 'arc' directories inside database directories.
View/table creation and renaming procedures maintained
backup copies of .frm files. Those copies are unused yet,
so this feature was incomplete and unnecessary.
1. Unwanted code has been hidden by FRM_ARCHIVE ifdefs
(the FRM_ARCHIVE macro is not defined).
2. Renaming procedure has been modified to remove obsolete
"arc" directories.
sql/parse_file.h:
Fixed bug #17823: 'arc' directories inside database directories.
The "thd" parameter has been added to the rename_in_schema_file()
function.
sql/sql_db.cc:
Fixed bug #17823: 'arc' directories inside database directories.
Scope of the mysql_rm_arc_files() function has been changed to
global for use from the parse_file.cc file.
sql/sql_view.cc:
Fixed bug #17823: 'arc' directories inside database directories.
Added the "thd" argument to rename_in_schema_file() calls.
JOIN for the subselect wasn't cleaned if we came upon an error
during sub_select() execution. That leads to the assertion failure
in close_thread_tables()
part of the 6.0 code backported
per-file comments:
mysql-test/r/sp-error.result
Bug#37949 Crash if argument to SP is a subquery that returns more than one row
test result
mysql-test/t/sp-error.test
Bug#37949 Crash if argument to SP is a subquery that returns more than one row
test case
sql/sp_head.cc
Bug#37949 Crash if argument to SP is a subquery that returns more than one row
lex->unit.cleanup() call added if not substatement
The problem is that when statement-based replication was enabled,
statements such as INSERT INTO .. SELECT FROM .. and CREATE TABLE
.. SELECT FROM need to grab a read lock on the source table that
does not permit concurrent inserts, which would in turn be denied
if the source table is a log table because log tables can't be
locked exclusively.
The solution is to not take such a lock when the source table is
a log table as it is unsafe to replicate log tables under statement
based replication. Furthermore, the read lock that does not permits
concurrent inserts is now only taken if statement-based replication
is enabled and if the source table is not a log table.
include/thr_lock.h:
Introduce yet another lock type that my get upgraded depending
on the binary log format. This is not a optimal solution but
can be easily improved later.
mysql-test/r/log_tables.result:
Add test case result for Bug#34306
mysql-test/suite/binlog/r/binlog_stm_row.result:
Add test case result for Bug#34306
mysql-test/suite/binlog/t/binlog_stm_row.test:
Add test case for Bug#34306
mysql-test/t/log_tables.test:
Add test case for Bug#34306
sql/lock.cc:
Assert that TL_READ_DEFAULT is not a real lock type.
sql/mysql_priv.h:
Export new function.
sql/mysqld.cc:
Remove using_update_log.
sql/sql_base.cc:
Introduce function that returns the appropriate read lock type
depending on how the statement is going to be replicated. It will
only take a TL_READ_NO_INSERT log if the binary is enabled and the
binary log format is statement-based and the table is not a log table.
sql/sql_parse.cc:
Remove using_update_log.
sql/sql_update.cc:
Use new function to choose read lock type.
sql/sql_yacc.yy:
The lock type is now decided at open_tables time. This old behavior was
actually misleading as the binary log format can be dynamically switched
and this would not change for statements that have already been parsed
when the binary log format is changed (ie: prepared statements).
Rotate event is automatically generated and written when rotating binary
log or relay log. Rotate events for relay logs are usually ignored by slave
SQL thread becuase they have the same server id as that of the slave.
However, if --replicate-same-server-id is enabled, rotate event
for relay log would be treated as if it's a rotate event from master, and
would be executed by slave to update the rli->group_master_log_name and
rli->group_master_log_pos to a wrong value and cause the MASTER_POS_WAIT
function to fail and return NULL.
This patch fixed this problem by setting a flag bit (LOG_EVENT_RELAY_LOG_F)
in the event to tell the SQL thread to ignore these Rotate events generated
for relay logs.
This patch also added another binlog event flag bit (LOG_EVENT_ARTIFICIAL_F)
to distinquish faked events, the method used before this was by checking if
log_pos was zero.
sql/log.h:
Add a member to MYSQL_BIN_LOG to distinguish binary log from relay log.
sql/log_event.cc:
Change artificial_event member to LOG_EVENT_ARTIFICIAL_F flag
If LOG_EVENT_RELAY_LOG_F is set in the event flags for a rotate event, ignore it when updating position
Refactored the code in Rotate_log_event::do_update_pos
sql/log_event.h:
Add LOG_EVENT_RELAY_LOG_F flag to Log_event flags
Add RELAY_LOG flag to Rotate_log_event flags
sql/sql_repl.cc:
Set LOG_EVENT_ARTIFICIAL_F for fake rotate events
The bug was that prepared statements didn't downgrade TL_WRITE_CONCURRENT properly
mysql-test/r/maria.result:
Added test case
mysql-test/t/maria.test:
Added test case
sql/mysql_priv.h:
Make upgrade_lock_type() global
sql/sql_base.cc:
Fixed indentation
sql/sql_insert.cc:
Make upgrade_lock_type() global
sql/sql_prepare.cc:
Call upgrade_lock_type_for_insert() to get right lock to use
sql/sql_view.cc:
Indentation fix
In order to improve the performance when replicating to partitioned
myisam tables with row-based format, the number of rows of current
rows log event is estimated and used to setup storage engine for bulk
inserts.
A stored procedure involving substrings could crash the server on certain
platforms because of invalid memory reads.
During storing the new blob-field value, the cached value's address range
overlapped that of the new field value. This caused problems when the
cached value storage was reallocated to provide access for a new
characater set representation. The patch checks the address ranges, and if
they overlap, the new field value is copied to a new storage before it is
converted to the new character set.
mysql-test/r/sp.result:
Added result set
mysql-test/t/sp.test:
Added test case
sql/field.cc:
The source and destination address ranges of a character conversion must not overlap or the 'from' address will be invalidated as the temporary value-
object is re-allocated to fit the new character set.
sql/field.h:
Added comments
and
Bug#33555: Group By Query does not correctly aggregate partitions
Backport of bug-33257 which is the same bug.
read_range_*() calls was not passed to the partition handlers,
but was translated to index_read/next family calls.
Resulting in duplicates rows and wrong aggregations.
mysql-test/r/partition_range.result:
Bug#30573: Ordered range scan over partitioned tables returns some rows twice
Updated result file
mysql-test/t/partition_range.test:
Bug#30573: Ordered range scan over partitioned tables returns some rows twice
Re-enabled the test
sql/ha_partition.cc:
Bug#30573: Ordered range scan over partitioned tables returns some rows twice
backport of bug-33257, correct handling of read_range_* calls,
without converting them to index_read/next calls
sql/ha_partition.h:
Bug#30573: Ordered range scan over partitioned tables returns some rows twice
backport of bug-33257, correct handling of read_range_* calls,
without converting them to index_read/next calls
The fix for bug 31887 was incomplete : it assumes that all the
field types returned by the IS_NUM macro are descendants of
Item_num and tries to zero-fill the values before doing constant
substitution with such fields when they are compared to constant string
values.
The only exception to this is Field_timestamp : it's in the IS_NUM
macro, but is not a descendant of Field_num.
Fixed by excluding timestamp fields (Field_timestamp) when zero-filling
when converting the constant to compare with to a string.
Note that this will not exclude the timestamp columns from const
propagation.
mysql-test/r/compare.result:
Bug #39353: test case
mysql-test/t/compare.test:
Bug #39353: test case
sql/item.cc:
Bug #39353: don't zero-fill timestamp fields when const propagating
to a string : they'll be converted to a string in a date/time format
and not as an integer.
columns data types
The "SELECT @lastId, @lastId := Id FROM t" query returns
different result sets depending on the type of the Id column
(INT or BIGINT).
Note: this fix doesn't cover the case when a select query
references an user variable and stored function that
updates a value of that variable, in this case a result
is indeterminate.
The server uses incorrect assumption about a constantness of
an user variable value as a select list item:
The server caches a last query number where that variable
was changed and compares this number with a current query
number. If these numbers are different, the server guesses,
that the variable is not updating in the current query, so
a respective select list item is a constant. However, in some
common cases the server updates cached query number too late.
The server has been modified to memorize user variable
assignments during the parse phase to take them into account
on the next (query preparation) phase independently of the
order of user variable references/assignments in a select
item list.
mysql-test/r/user_var.result:
Added test case for bug #26020.
mysql-test/t/user_var.test:
Added test case for bug #26020.
sql/item_func.cc:
An update of entry and update_query_id variables has been
moved from Item_func_set_user_var::fix_fields() to a separate
method, Item_func_set_user_var::set_entry().
sql/item_func.h:
1. The Item_func_set_user_var::set_entry() method has been
added to update Item_func_set_user_var::entry.
2. The Item_func_set_user_var::entry_thd field has beend
added to update Item_func_set_user_var::entry only when
needed.
sql/sql_base.cc:
Fix: setup_fiedls() calls Item_func_set_user_var::set_entry()
for all items from the thd->lex->set_var_list before the first
call of ::fix_fields().
sql/sql_lex.cc:
The lex_start function has been modified to reset
the st_lex::set_var_list list.
sql/sql_lex.h:
New st_lex::set_var_list field has been added to
memorize all user variable assignments in the current
select query.
sql/sql_yacc.yy:
The variable_aux rule has been modified to memorize
in-query user variable assignments in the
st_lex::set_var_list list.