When there is an error executing EXISTS predicates they return NULL as their string
or decimal value but don't set the NULL value flag.
Fixed by returning 0 (as a decimal or a string) on error exectuting the subquery.
Note that we can't return NULL as EXISTS is not supposed to return NULL.
mysql-test/r/subselect.result:
Bug#37627: test case
mysql-test/t/subselect.test:
Bug#37627: test case
sql/item_subselect.cc:
Bug#37627: return decimal (or string) 0 isntead of a NULL pointer on
error calculating an EXISTS predicate.
Bug#12093 "SP not found on second PS execution if another thread
drops other SP in between" and
Bug#21294 "executing a prepared statement that executes a stored
function which was recreat"
Stored functions are resolved at prepared statement prepare only.
If someone flushes the stored functions cache between prepare and
execute, execution fails.
The fix is to detect the situation of the cache flush and automatically
reprepare the prepared statement after it.
mysql-test/r/ps_ddl.result:
Update results (Bug#12093 and Bug#21294, the test cases are already
in the source tree).
mysql-test/r/ps_ddl1.result:
Update results (Bug#12093 and Bug#21294, the test cases are already
in the source tree).
mysql-test/r/sp-error.result:
Update results (Bug#12093 and Bug#21294, the test cases are already
in the source tree).
mysql-test/t/ps_ddl.test:
Modify the test to not expect an error where there is no error
any more (Bug#12093, Bug#21294).
mysql-test/t/ps_ddl1.test:
Modify the test to not expect an error where there is no error
any more (Bug#12093, Bug#21294).
mysql-test/t/sp-error.test:
Modify the test to not expect an error where there is no error
any more (Bug#12093, Bug#21294).
sql/sp_cache.cc:
Implement sp_cache_version() -- returns the current version of
a stored routines cache.
sql/sp_cache.h:
Declare sp_cache_version().
sql/sql_prepare.cc:
Keep track of stored functions cache version, and invalidate
the statement if it changed between prepared statement
prepare and execute (and the statement actually uses stored routines).
This bug has been fixed in two slightly different ways in
6.0-rpl and {5.1,6.0}-bugteam. To avoid future merge
problems, I'm now copying the 6.0-rpl fix to 5.1-bugteam.
The previous fix for the bug was incomplete. The test failed
because t2 did not exist on the slave (since the slave was
lagging) when the
wait_condition was executed. Fixed by inserting
sync_slave_with_master just after t2 was created.
Test was failing due to the addition of a '\x05' character in result sets
Latest builds of the server have shown this problem to have disappeared.
Removing code within the test that disables the test on Mac OS X.
Recommit due to tree error on earlier, approved patch.
REORGANIZE TEST parts WHERE ENGINE='NDB' ;)
Updated tests for better matching NDB's limitations.
Removed some duplicate tests.
mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc:
Bug#36732: many disabled ndb tests in test suite parts
Added variable for NDB (since it does not support
DROP PARTITION)
mysql-test/suite/parts/inc/partition_alter_11.inc:
Bug#36732: many disabled ndb tests in test suite parts
Assigning directly to variable without going
through the server.
mysql-test/suite/parts/inc/partition_bigint.inc:
Bug#36732: many disabled ndb tests in test suite parts
Added --sorted_result for consistency
lowered number of partitions for use with NDB
(NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/inc/partition_int.inc:
Bug#36732: many disabled ndb tests in test suite parts
Added --sorted_result for consistency
lowered number of partitions for use with NDB
(NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/inc/partition_mediumint.inc:
Bug#36732: many disabled ndb tests in test suite parts
Added --sorted_result for consistency
lowered number of partitions for use with NDB
(NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/inc/partition_smallint.inc:
Bug#36732: many disabled ndb tests in test suite parts
Added --sorted_result for consistency
lowered number of partitions for use with NDB
(NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc:
Bug#36732: many disabled ndb tests in test suite parts
Made it work better with NDB
mysql-test/suite/parts/inc/partition_tinyint.inc:
Bug#36732: many disabled ndb tests in test suite parts
Added --sorted_result for consistency
lowered number of partitions for use with NDB
(NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/r/ndb_blob_partition.result:
Bug#36732: many disabled ndb tests in test suite parts
Removing this duplicate test since it already
exists (and updated) in suite/ndb
mysql-test/suite/parts/r/ndb_dd_backuprestore.result:
Bug#36732: many disabled ndb tests in test suite parts
Updated result file
mysql-test/suite/parts/r/ndb_partition_error.result:
Bug#36732: many disabled ndb tests in test suite parts
Removing this duplicate test since it already
exists (and updated) in suite/ndb
mysql-test/suite/parts/r/ndb_partition_key.result:
Bug#36732: many disabled ndb tests in test suite parts
Removing this duplicate test since it already
exists (and updated) in suite/ndb
mysql-test/suite/parts/r/ndb_partition_list.result:
Bug#36732: many disabled ndb tests in test suite parts
Removing this duplicate test since it already
exists (and updated) in suite/ndb
mysql-test/suite/parts/r/ndb_partition_range.result:
Bug#36732: many disabled ndb tests in test suite parts
Removing this duplicate test since it already
exists (and updated) in suite/ndb
mysql-test/suite/parts/r/part_supported_sql_func_ndb.result:
Bug#36732: many disabled ndb tests in test suite parts
Updated result file
mysql-test/suite/parts/r/partition_alter1_1_innodb.result:
Bug#36732: many disabled ndb tests in test suite parts
Updated result file
mysql-test/suite/parts/r/partition_alter1_1_myisam.result:
Bug#36732: many disabled ndb tests in test suite parts
Updated result file
mysql-test/suite/parts/r/partition_alter1_2_innodb.result:
Bug#36732: many disabled ndb tests in test suite parts
Updated result file.
Diff bigger than necessary, due to bzr diff bug.
mysql-test/suite/parts/r/partition_alter1_2_myisam.result:
Bug#36732: many disabled ndb tests in test suite parts
Updated result file
mysql-test/suite/parts/r/partition_alter2_innodb.result:
Bug#36732: many disabled ndb tests in test suite parts
Updated result file
mysql-test/suite/parts/r/partition_alter2_myisam.result:
Bug#36732: many disabled ndb tests in test suite parts
Updated result file
mysql-test/suite/parts/r/partition_engine_ndb.result:
Bug#36732: many disabled ndb tests in test suite parts
Updated result file
mysql-test/suite/parts/r/partition_int_innodb.result:
Bug#36732: many disabled ndb tests in test suite parts
Updated result file
mysql-test/suite/parts/r/partition_int_myisam.result:
Bug#36732: many disabled ndb tests in test suite parts
Updated result file
mysql-test/suite/parts/r/partition_int_ndb.result:
Bug#36732: many disabled ndb tests in test suite parts
Updated result file
mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result:
Bug#36732: many disabled ndb tests in test suite parts
Removing this duplicate test since it already
exists (and updated) in suite/rpl_ndb
mysql-test/suite/parts/t/disabled.def:
Bug#36732: many disabled ndb tests in test suite parts
Removed some duplicate tests, fixed some tests.
Removed the 'runs too long on PB' test from
disabled.def and made them to require 'big-test'.
mysql-test/suite/parts/t/ndb_blob_partition.test:
Bug#36732: many disabled ndb tests in test suite parts
Removing this duplicate test since it already
exists (and updated) in suite/ndb
mysql-test/suite/parts/t/ndb_dd_backuprestore.test:
Bug#36732: many disabled ndb tests in test suite parts
Added new=on for allowing test of
hash/range and list partitioning.
mysql-test/suite/parts/t/ndb_partition_error.test:
Bug#36732: many disabled ndb tests in test suite parts
Removing this duplicate test since it already
exists (and updated) in suite/ndb
mysql-test/suite/parts/t/ndb_partition_key.test:
Bug#36732: many disabled ndb tests in test suite parts
Removing this duplicate test since it already
exists (and updated) in suite/ndb
mysql-test/suite/parts/t/ndb_partition_list.test:
Bug#36732: many disabled ndb tests in test suite parts
Removing this duplicate test since it already
exists (and updated) in suite/ndb
mysql-test/suite/parts/t/ndb_partition_range.test:
Bug#36732: many disabled ndb tests in test suite parts
Removing this duplicate test since it already
exists (and updated) in suite/ndb
mysql-test/suite/parts/t/part_supported_sql_func_ndb.test:
Bug#36732: many disabled ndb tests in test suite parts
Added new=on for allowing test of
hash/range and list partitioning.
Added ndb restriction variables.
mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test:
Bug#36732: many disabled ndb tests in test suite parts
requiring big-test instead of disable it.
mysql-test/suite/parts/t/partition_alter1_1_ndb.test:
Bug#36732: many disabled ndb tests in test suite parts
requiring big-test instead of disable it.
mysql-test/suite/parts/t/partition_alter1_2_ndb.test:
Bug#36732: many disabled ndb tests in test suite parts
requiring big-test instead of disable it.
mysql-test/suite/parts/t/partition_alter2_ndb.test:
Bug#36732: many disabled ndb tests in test suite parts
Added new=on for allowing test of
hash/range and list partitioning.
mysql-test/suite/parts/t/partition_basic_ndb.test:
Bug#36732: many disabled ndb tests in test suite parts
Added new=on for allowing test of
hash/range and list partitioning.
mysql-test/suite/parts/t/partition_bit_ndb.test:
Bug#36732: many disabled ndb tests in test suite parts
Added new=on for allowing test of
hash/range and list partitioning.
mysql-test/suite/parts/t/partition_engine_ndb.test:
Bug#36732: many disabled ndb tests in test suite parts
Added new=on for allowing test of
hash/range and list partitioning.
mysql-test/suite/parts/t/partition_int_ndb.test:
Bug#36732: many disabled ndb tests in test suite parts
Added new=on for allowing test of
hash/range and list partitioning.
mysql-test/suite/parts/t/partition_syntax_ndb.test:
Bug#36732: many disabled ndb tests in test suite parts
Added new=on for allowing test of
hash/range and list partitioning.
mysql-test/suite/parts/t/partition_value_ndb.test:
Bug#36732: many disabled ndb tests in test suite parts
Added new=on for allowing test of
hash/range and list partitioning.
mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test:
Bug#36732: many disabled ndb tests in test suite parts
Removing this duplicate test since it already
exists (and updated) in suite/rpl_ndb
Bug#36787 Test funcs_1.charset_collation_1 failing
Details:
1. Skip charset_collation_1 if charset "ucs2_bin" is
missing (property which distincts "vanilla" builds
from the others)
2. Let builds with version_comment LIKE "%Advanced%"
(found them for 5.1) execute charset_collation_3.
3. Update comments charset_collation.inc so that they
reflect the current experiences.
In order to handle CHAR() fields, 8 bits were reserved for
the size of the CHAR field. However, instead of denoting the
number of characters in the field, field_length was used which
denotes the number of bytes in the field.
Since UTF-8 fields can have three bytes per character (and
has been extended to have four bytes per character in 6.0),
an extra two bits have been encoded in the field metadata
work for fields of type Field_string (i.e., CHAR fields).
Since the metadata word is filled, the extra bits have been
encoded in the upper 4 bits of the real type (the most
significant byte of the metadata word) by computing the
bitwise xor of the extra two bits. Since the upper 4 bits
of the real type always is 1111 for Field_string, this
means that for fields of length <256, the encoding is
identical to the encoding used in pre-5.1.26 servers, but
for lengths of 256 or more, an unrecognized type is formed,
causing an old slave (that does not handle lengths of 256
or more) to stop.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Adding test cases for replicating UTF-8 fields of lengths
of 256 or more (bytes).
mysql-test/suite/binlog/r/binlog_base64_flag.result:
Result file change.
mysql-test/suite/binlog/t/binlog_base64_flag.test:
Adding tests to trigger check that an error is generated when replicating from a
5.1.25 server for tables with a CHAR(128) but not when replicating a table with a
CHAR(63). Although the bug indicates that the limit is 83, we elected to use CHAR(63)
since 6.0 uses 4-byte UTF-8, and anything exceeding 63 would then cause the test to fail
when the patch is merged to 6.0.
mysql-test/suite/bugs/combinations:
Adding combinations file to run all bug reports in all binlog modes (where
applicable).
mysql-test/suite/bugs/r/rpl_bug37426.result:
Result file change.
mysql-test/suite/bugs/t/rpl_bug37426.test:
Added test for reported bug.
mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result:
Result file change.
mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result:
Result file change.
sql/field.cc:
Encoding an extra two bits in the most significant nibble (4 bits)
of the metadata word. Adding assertions to ensure that no attempt
is made to use lengths longer than supported.
Extending compatible_field_size() function with an extra parameter
holding a Relay_log_instace for error reporting.
Field_string::compatible_field_size() now reports an error if field
size for a CHAR is >255.
sql/field.h:
Field length is now computed from most significant 4 bits
of metadata word, or is equal to the row pack length if
there is no metadata.
Extending compatible_field_size() function with an extra parameter
holding a Relay_log_instace for error reporting.
sql/rpl_utility.cc:
Adding relay log parameter to compatible_field_size().
Minor refactoring to eliminate duplicate code.
sql/slave.cc:
Extending rpl_master_has_bug() with a single-argument predicate function and
a parameter to the predicate function. The predicate function can be used to
test for extra conditions for the bug before writing an error message.
sql/slave.h:
Extending rpl_master_has_bug() with a single-argument predicate function and
a parameter to the predicate function. The predicate function can be used to
test for extra conditions for the bug before writing an error message.
Also removing gratuitous default argument.
sql/sql_insert.cc:
Changing calls to rpl_master_has_bug() to adapt to changed signature.
Problem: rpl_switch_stm_row_mixed did not wait until row events generated by
INSERT DELAYED were written to the master binlog before it synchronized slave
with master. This caused sporadic errors where these rows were missing on
slave.
Fix: wait until all rows appear on the slave.
This is a backport, applying the same to 5.1-bugteam as was previously
applied to 6.0-rpl
InnoDB table, where all selected columns
belong to the same unique index key, returns
incorrect results
Server executes some queries via QUICK_GROUP_MIN_MAX_SELECT
(MIN/MAX optimization for queries with GROUP BY or DISTINCT
clause) and that optimization implies loose index scan, so all
grouping is done by the QUICK_GROUP_MIN_MAX_SELECT::get_next
method.
The server does not set the precomputed_group_by flag for some
QUICK_GROUP_MIN_MAX_SELECT queries and duplicates grouping by
call to the end_send_group function.
Fix: when the test_if_skip_sort_order function selects loose
index scan as a best way to satisfy an ORDER BY/GROUP BY type
of query, the precomputed_group_by flag has been set to use
end_send/end_write functions instead of end_send_group/
end_write_group functions.
mysql-test/r/group_min_max_innodb.result:
Fixed bug #36632: SELECT DISTINCT from a simple view on an
InnoDB table, where all selected columns
belong to the same unique index key, returns
incorrect results
mysql-test/t/group_min_max_innodb.test:
Fixed bug #36632: SELECT DISTINCT from a simple view on an
InnoDB table, where all selected columns
belong to the same unique index key, returns
incorrect results
sql/sql_select.cc:
Fixed bug #36632: SELECT DISTINCT from a simple view on an
InnoDB table, where all selected columns
belong to the same unique index key, returns
incorrect results
Bug#35658 (An empty binary value leads to mysqld crash)
Before this fix, the following token
b''
caused the parser to crash when reading the binary value from the empty string.
The crash was caused by:
ptr+= max_length - 1;
because max_length is unsigned and was 0, causing an overflow.
With this fix, an empty binary literal b'' is parsed as a binary value 0,
in Item_bin_string.
mysql-test/r/varbinary.result:
Bug#35658 (An empty binary value leads to mysqld crash)
mysql-test/t/varbinary.test:
Bug#35658 (An empty binary value leads to mysqld crash)
sql/item.cc:
Bug#35658 (An empty binary value leads to mysqld crash)
Bug#35658 (An empty binary value leads to mysqld crash)
Before this fix, the following token
b''
caused the parser to crash when reading the binary value from the empty string.
The crash was caused by:
ptr+= max_length - 1;
because max_length is unsigned and was 0, causing an overflow.
With this fix, an empty binary literal b'' is parsed as a binary value 0,
in Item_bin_string.
mysql-test/r/varbinary.result:
Bug#35658 (An empty binary value leads to mysqld crash)
mysql-test/t/varbinary.test:
Bug#35658 (An empty binary value leads to mysqld crash)
sql/item.cc:
Bug#35658 (An empty binary value leads to mysqld crash)
Bug#35658 (An empty binary value leads to mysqld crash)
Before this fix, the following token
b''
caused the parser to crash when reading the binary value from the empty string.
The crash was caused by:
ptr+= max_length - 1;
because max_length is unsigned and was 0, causing an overflow.
With this fix, an empty binary literal b'' is parsed as a binary value 0,
in Item_bin_string.
mysql-test/r/varbinary.result:
Bug#35658 (An empty binary value leads to mysqld crash)
mysql-test/t/varbinary.test:
Bug#35658 (An empty binary value leads to mysqld crash)
sql/item.cc:
Bug#35658 (An empty binary value leads to mysqld crash)
Normalize directory names before adding them to default_directories.
mysys/default.c:
Normalize directory names with unpack_dirname() before adding them
to default_directories. This way, /etc/ and /etc will not count as
duplicates.
Because this entails allocating memory to store the normalized names,
add error handling and ensure that it doesn't leak memory in case
both my_print_defaults() and load_defaults() are called.
Clean up the Windows code that finds the exe's parent directory, and
pull it out into a separate function.
Reorganize the code into a single init_default_directories() function,
with internal #ifdefs, instead of init_default_directories_<system>()
functions which were accessed via a function pointer. This is more in
line with normal MySQL coding style, and easier to read for some.
Bug#33812: mysql client incorrectly parsing DELIMITER
Remove unnecessary and incorrect code that tried
to pull delimiter commands out of the middle of
statements.
as a commentary
mysql client has been modified to interpret EOL after
standalone -- commentary strings like whitespace
character (according to
http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-comments.html)
mysql-test/t/mysql_delimiter.sql:
Added test case for bug #36244.
Remove unnecessary and incorrect code that tried
to pull delimiter commands out of the middle of
statements.
client/mysql.cc:
Remove unnecessary and incorrect code that tried
to pull delimiter commands out of the middle of
statements.
mysql-test/r/mysql.result:
show we no longer parse DELIMITER when
we shouldn't.
mysql-test/t/mysql_delimiter.sql:
show we no longer parse DELIMITER when
we shouldn't.