The subst_spvars function is used to create query string with SP variables
substituted with their values. This string is used later for the binary log
and for the query cache. The problem is that the
query_cache_send_result_to_client function requires some additional space
after the query to store database name and query cache flags. This
space wasn't reserved by the subst_spvars function which led to a memory
corruption and crash.
Now the subst_spvars function reserves additional space for the query cache.
mysql-test/t/query_cache.test:
Added a test case for the bug#29856: Insufficient buffer space led to a server crash.
mysql-test/r/query_cache.result:
Added a test case for the bug#29856: Insufficient buffer space led to a server crash.
sql/sp_head.cc:
Bug#29856: Insufficient buffer space led to a server crash.
Now the subst_spvars function reserves additional space for the query cache.
When a table was explicitly locked with LOCK TABLES no associated
tables from any related trigger on the subject table were locked.
As a result of this the user could experience unexpected locking
behavior and statement failures similar to "failed: 1100: Table'xx'
was not locked with LOCK TABLES".
This patch fixes this problem by making sure triggers are
pre-loaded on any statement if the subject table was explicitly
locked with LOCK TABLES.
mysql-test/r/sp-prelocking.result:
Added test case
mysql-test/t/sp-prelocking.test:
Added test case
sql/sql_lex.cc:
- Moved some conditional logic out of the table iteration.
- Added event map values for LOCK TABLE command.
sql/table.cc:
- Refactored set_trg_event_tpye into the two simpler functions set_trg_event_map
and set_trg_event_map as methods for manipulating the table event map.
The original function was only called from st_lex::set_trg_event_type_for_tables
so it was possible to move the event map creation logic to this function as
a loop optimization.
sql/table.h:
- Refactored set_trg_event_tpye into the two simpler functions set_trg_event_map
and set_trg_event_map as methods for manipulating the table event map.
The original function was only called from st_lex::set_trg_event_type_for_tables
so it was possible to move the event map creation logic to this function as
a loop optimization.
Item_func_user doesn't calculate anything in it's val_str() method,
just returns saved str_value.
Though Item::save_in_field method can destroy str_value, relying on
val_str() return. As a result we get the garbage stored in field.
We cannot use Item::save_in_field implementation for Item_func_user,
reimplement it in simpler way.
mysql-test/r/rpl_session_var.result:
Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
test result
mysql-test/t/rpl_session_var.test:
Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
test case
sql/item.cc:
Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
duplicating code moved to Item::save_str_in_field
sql/item.h:
Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
duplicating code moved to Item::save_str_in_field
sql/item_strfunc.h:
Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
Item_func_user::save_in_field implemented as simple storing str_value
between perm and temp tables. Review fixes.
The original bug report complains that if we locked a temporary table
with LOCK TABLES statement, we would not leave LOCK TABLES mode
when this temporary table is dropped.
Additionally, the bug was escalated when it was discovered than
when a temporary transactional table that was previously
locked with LOCK TABLES statement was dropped, futher actions with
this table, such as UNLOCK TABLES, would lead to a crash.
The problem originates from incomplete support of transactional temporary
tables. When we added calls to handler::store_lock()/handler::external_lock()
to operations that work with such tables, we only covered the normal
server code flow and did not cover LOCK TABLES mode.
In LOCK TABLES mode, ::external_lock(LOCK) would sometimes be called without
matching ::external_lock(UNLOCK), e.g. when a transactional temporary table
was dropped. Additionally, this table would be left in the list of LOCKed
TABLES.
The patch aims to address this inadequacy. Now, whenever an instance
of 'handler' is destroyed, we assert that it was priorly
external_lock(UNLOCK)-ed. All the places that violate this assert
were fixed.
This patch introduces no changes in behavior -- the discrepancy in
behavior will be fixed when we start calling ::store_lock()/::external_lock()
for all tables, regardless whether they are transactional or not,
temporary or not.
mysql-test/r/innodb_mysql.result:
Update test results (Bug#24918)
mysql-test/t/innodb_mysql.test:
Add a test case for Bug#24918
sql/handler.h:
Make handler::external_lock() a protected method. Backport from 5.1 its
public wrapper handler::ha_external_lock().
Assert that the handler is not closed if it is still locked.
sql/lock.cc:
In mysql_lock_tables only call lock_external() for the list of tables that
we called store_lock() for.
E.g. get_lock_data() does not add non-transactional temporary tables to the
lock list, so lock_external() should not be called for them.
Use handler::ha_external_lock() instead of handler::external_lock().
Add comments for mysql_lock_remove(), parameterize one strange
side effect that it has. At least in one place where mysql_lock_remove
is used, this side effect is not desired (DROP TABLE). The parameter
will be dropped in 5.1, along with the side effect.
sql/mysql_priv.h:
Update declaration of mysql_lock_remove().
sql/opt_range.cc:
Deploy handler::ha_external_lock() instead of handler::external_lock()
sql/sql_base.cc:
When closing a temporary table, remove the table from the list of LOCKed
TABLES of this thread, in case it's there.
It's there if it is a transactional temporary table.
Use a new declaration of mysql_lock_remove().
sql/sql_class.h:
Extend the comment for THD::temporary_tables.
sql/sql_table.cc:
Deploy handler::ha_external_lock() instead of handler::external_lock()
INSERT/DELETE/UPDATE followed by ALTER TABLE within LOCK TABLES
may cause table corruption on Windows.
That happens because ALTER TABLE writes outdated shared state
info into index file.
Fixed by removing obsolete workaround.
Affects MyISAM tables on Windows only.
myisam/mi_extra.c:
On windows when mi_extra(HA_EXTRA_PREPARE_FOR_DELETE) is called,
we release external lock and close index file. If we're in LOCK
TABLES, MyISAM state info doesn't get updated until UNLOCK TABLES.
That means when we release external lock and we're in LOCK TABLES,
we may write outdated state info.
As SQL layer closes all table instances, we do not need this
workaround anymore.
mysql-test/r/alter_table.result:
A test case for BUG#29957.
mysql-test/t/alter_table.test:
A test case for BUG#29957.
Reduce case and formalise into something we should be
able to use in mysql-test-run.
Index: ndb-work/mysql-test/t/ndb_bug26793.test
===================================================================
mysql-test/r/ndb_bug26793.result:
BUG#26793 test: mysqld crashes in NDB on I_S query
mysql-test/t/ndb_bug26793.test:
BUG#26793 test: mysqld crashes in NDB on I_S query
the master but on the slave
MySQL can decide to "downgrade" a INSERT DELAYED statement
to normal insert in certain situations.
One such situation is when the slave is replaying a
replication feed.
However INSERT DELAYED is logged even if there're no updates
whereas the NORMAL INSERT is not logged in such cases.
Fixed by always logging a "downgraded" INSERT DELAYED: even
if there were no updates.
mysql-test/r/rpl_insert_delayed.result:
Bug #29571: test case
mysql-test/t/rpl_insert_delayed.test:
Bug #29571: test case
sql/sql_insert.cc:
Bug #29571: log INSERT DELAYED even if it was
"downgraded" to INSERT (and there were no updates)
into gleb.loc:/home/uchum/work/bk/5.0-opt
mysql-test/t/create.test:
Auto merged
sql/field.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/table.cc:
Auto merged
mysql-test/r/create.result:
Merge with 5.0 (main).
"Federated Denial of Service"
Federated storage engine used to attempt to open connections within
the ::create() and ::open() methods which are invoked while LOCK_open
mutex is being held by mysqld. As a result, no other client sessions
can open tables while Federated is attempting to open a connection.
Long DNS lookup times would stall mysqld's operation and a rogue
connection string which connects to a remote server which simply
stalls during handshake can stall mysqld for a much longer period of
time.
This patch moves the opening of the connection much later, when the
federated actually issues queries, by which time the LOCK_open mutex is
no longer being held.
mysql-test/r/federated.result:
change of test/results due to patch for bug25679
mysql-test/t/federated.test:
change of test/results due to patch for bug25679
sql/ha_federated.cc:
bug25679
remove function check_foreign_fata_source()
ha_federated::open() no longer opens the federated connection.
ha_federated::create() no longer opens and tests connection.
ha_federated::real_connect() opens connection and tests presence of table.
ha_federated::real_query() sends query, calling real_connect() if neccessary.
sql/ha_federated.h:
bug25679
new methods real_query() and real_connect()
binary SHOW CREATE TABLE or SELECT FROM I_S.
The problem is that mysqldump generates incorrect dump for a table
with non-ASCII column name if the mysqldump's character set is
ASCII.
The fix is to:
1. Switch character_set_client for the mysqldump's connection
to binary before issuing SHOW CREATE TABLE statement in order
to avoid conversion.
2. Dump switch character_set_client statements to UTF8 and back
for CREATE TABLE statement.
client/mysqldump.c:
1. Switch character_set_client for the mysqldump's connection
to binary before issuing SHOW CREATE TABLE statement in order
to avoid conversion.
2. Dump switch character_set_client statements to UTF8 and back
for CREATE TABLE statement.
mysql-test/r/mysqldump-max.result:
Update result file.
mysql-test/r/mysqldump.result:
Update result file.
mysql-test/r/openssl_1.result:
Update result file.
mysql-test/r/show_check.result:
Update result file.
mysql-test/t/show_check.test:
Test case:
- create a table with non-ASCII column name;
- dump the database by mysqldump using ASCII character set;
- drop the database;
- load the dump;
- check that the table has been re-created properly.
When the SQL_BIG_RESULT flag is specified SELECT should store items from the
select list in the filesort data and use them when sending to a client.
The get_addon_fields function is responsible for creating necessary structures
for that. But this function was allowed to do so only for SELECT and
INSERT .. SELECT queries. This makes the SQL_BIG_RESULT useless for
the CREATE .. SELECT queries.
Now the get_addon_fields allows storing select list items in the filesort
data for the CREATE .. SELECT queries.
mysql-test/t/create.test:
Added a test case for the bug#15130: CREATE .. SELECT was denied to use
advantages of the SQL_BIG_RESULT.
mysql-test/r/create.result:
Added a test case for the bug#15130: CREATE .. SELECT was denied to use
advantages of the SQL_BIG_RESULT.
sql/filesort.cc:
Bug#15130: CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT.
Now the get_addon_fields allows storing select list items in the filesort
data for the CREATE .. SELECT queries.
"getGeneratedKeys() does not work with FEDERATED table"
mysql_insert() expected the storage engine to update the row data
during the write_row() operation with the value of the new auto-
increment field. The field must be updated when only one row has
been inserted as mysql_insert() would ignore the thd->last_insert.
This patch implements HA_STATUS_AUTO support in ha_federated::info()
and ensures that ha_federated::write_row() does update the row's
auto-increment value.
The test case was written in C as the protocol's 'id' value is
accessible through libmysqlclient and not via SQL statements.
mysql-test-run.pl was extended to enable running the test binary.
mysql-test/mysql-test-run.pl:
bug25714
implement support to run C test for bug25714
sql/ha_federated.cc:
bug25714
The storage engine instance property auto_increment_value was not
being set.
mysql_insert() requires that the storage engine updates the row with
the auto-increment value, especially when only inserting one row.
Implement support for ha_federated::info(HA_STATUS_AUTO)
tests/Makefile.am:
bug25714
build C test for bug
mysql-test/include/have_bug25714.inc:
New BitKeeper file ``mysql-test/include/have_bug25714.inc''
mysql-test/r/federated_bug_25714.result:
New BitKeeper file ``mysql-test/r/federated_bug_25714.result''
mysql-test/r/have_bug25714.require:
New BitKeeper file ``mysql-test/r/have_bug25714.require''
mysql-test/t/federated_bug_25714.test:
New BitKeeper file ``mysql-test/t/federated_bug_25714.test''
tests/bug25714.c:
New BitKeeper file ``tests/bug25714.c''
into magare.gmz:/home/kgeorge/mysql/autopush/B29644-5.0-opt
sql/ha_innodb.cc:
Auto merged
sql/sql_base.cc:
Auto merged
mysql-test/r/innodb_mysql.result:
5.0-opt merge
mysql-test/t/innodb_mysql.test:
5.0-opt merge
If a primary key is defined over column c of enum type then
the EXPLAIN command for a look-up query of the form
SELECT * FROM t WHERE c=0
said that the query was with an impossible where condition though the
query correctly returned non-empty result set when the table indeed
contained rows with error empty strings for column c.
This kind of misbehavior was due to a bug in the function
Field_enum::store(longlong,bool) that erroneously returned 1 if
the the value to be stored was equal to 0.
Note that the method
Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
correctly returned 0 if a value of the error empty string
was stored.
mysql-test/r/type_enum.result:
Added a test case for bug #29661.
mysql-test/t/type_enum.test:
Added a test case for bug #29661.
sql/field.cc:
Fixed bug #29611.
If a primary key was defined over column c of enum type then
the EXPLAIN command for a look-up query of the form
SELECT * FROM t WHERE c=0
said that the query was with an impossible where condition though the
query correctly returned non-empty result set when the table indeed
contained rows with error empty strings for column c.
This kind of misbehavior was due to a bug in the function
Field_enum::store(longlong,bool) that erroneously returned 1 if
the the value to be stored was equal to 0.
Note that the method
Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
correctly returned 0 if a value of the error empty string
was stored.
into magare.gmz:/home/kgeorge/mysql/autopush/B28951-5.0-opt
mysql-test/t/innodb_mysql.test:
Auto merged
sql/sql_select.cc:
Auto merged
sql/table.cc:
Auto merged
mysql-test/r/innodb_mysql.result:
merge of 5.0-opt
Additional test case fix for bug #29338.
mysql-test/t/sp.test:
Additional test case fix for bug #29338.
mysql-test/r/sp.result:
Additional test case fix for bug #29338.
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug29911
mysql-test/t/having.test:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/having.result:
SCCS merged
into bodhi.(none):/opt/local/work/mysql-5.0-runtime
mysql-test/r/create.result:
Auto merged
mysql-test/t/create.test:
Auto merged
sql/sql_class.h:
Auto merged
This bug manifested itself for join queries with GROUP BY and HAVING clauses
whose SELECT lists contained DISTINCT. It occurred when the optimizer could
deduce that the result set would have not more than one row.
The bug could lead to wrong result sets for queries of this type because
HAVING conditions were erroneously ignored in some cases in the function
remove_duplicates.
mysql-test/r/having.result:
Added a test case for bug #29911.
mysql-test/t/having.test:
Added a test case for bug #29911.
After dumping triggers mysqldump copied
the value of the OLD_SQL_MODE variable to the SQL_MODE
variable. If the --compact option of the mysqldump was
not set the OLD_SQL_MODE variable had the value
of the uninitialized SQL_MODE variable. So
usually the NO_AUTO_VALUE_ON_ZERO option of the
SQL_MODE variable was discarded.
This fix is for non-"--compact" mode of the mysqldump,
because mysqldump --compact never set SQL_MODE to the
value of NO_AUTO_VALUE_ON_ZERO.
The dump_triggers_for_table function has been modified
to restore previous value of the SQL_MODE variable after
dumping triggers using the SAVE_SQL_MODE temporary
variable.
client/mysqldump.c:
Fixed bug #29788.
The dump_triggers_for_table function has been modified
to restore previous value of the SQL_MODE variable after
dumping triggers using the SAVE_SQL_MODE temporary
variable.
mysql-test/r/mysqldump.result:
Updated test case for bug #29788.
mysql-test/t/mysqldump.test:
Updated test case for bug #29788.
ORDER BY primary_key on InnoDB table
Queries that use an InnoDB secondary index to retrieve
data don't need to sort in case of ORDER BY primary key
if the secondary index is compared to constant(s).
They can also skip sorting if ORDER BY contains both the
the secondary key parts and the primary key parts (in
that order).
This is because InnoDB returns the rows in order of the
primary key for rows with the same values of the secondary
key columns.
Fixed by preventing temp table sort for the qualifying
queries.
mysql-test/r/innodb_mysql.result:
Bug #28591: test case
mysql-test/t/innodb_mysql.test:
Bug #28591: test case
sql/sql_select.cc:
Bug #28591: Use the primary key as suffix when testing
if the key can be used for ORDER BY on supporting engines.
sql/table.cc:
Bug #28591: can use the primary key
as a suffix for the secondary keys
by long running transaction
On Windows opened files can't be deleted. There was a special
upgraded lock mode (TL_WRITE instead of TL_WRITE_ALLOW_READ)
in ALTER TABLE to make sure nobody has the table opened
when deleting the old table in ALTER TABLE. This special mode
was causing ALTER TABLE to hang waiting on a lock inside InnoDB.
This special lock is no longer necessary as the server is
closing the tables it needs to delete in ALTER TABLE.
Fixed by removing the special lock.
Note that this also reverses the fix for bug 17264 that deals with
another consequence of this special lock mode being used.
mysql-test/r/innodb_mysql.result:
Bug #29644: test case
mysql-test/t/innodb_mysql.test:
Bug #29644: test case
sql/ha_innodb.cc:
Bug #29644: reverse the (now excessive) fix
for bug 17264 (but leave the test case).
sql/sql_base.cc:
Bug #29644: don't need a special lock mode for Win32 anymore:
the table is closed before the drop.
The Item_date_typecast::val_int function doesn't reset null_value flag.
This makes all values that follows the first null value to be treated as nulls
and led to a wrong result.
Now the Item_date_typecast::val_int function correctly sets the null_value flag
for both null and non-null values.
mysql-test/t/cast.test:
Added a test case for the bug#29898: Item_date_typecast::val_int doesn't reset
the null_value flag.
mysql-test/r/cast.result:
Added a test case for the bug#29898: Item_date_typecast::val_int doesn't reset
the null_value flag.
sql/item_timefunc.cc:
Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
Now the Item_date_typecast::val_int function correctly sets the null_value flag
for both null and non-null values.
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
mysql-test/t/federated.test:
Auto merged
sql/ha_federated.h:
Auto merged
mysql-test/r/federated.result:
Manual merge.
a temporary table.
The result string of the Item_func_group_concat wasn't initialized in the
copying constructor of the Item_func_group_concat class. This led to a
wrong charset of GROUP_CONCAT result when the select employs a temporary
table.
The copying constructor of the Item_func_group_concat class now correctly
initializes the charset of the result string.
mysql-test/t/func_gconcat.test:
Added a test case for the bug#29850: Wrong charset of the GROUP_CONCAT result
when the select employs a temporary table.
mysql-test/r/func_gconcat.result:
Added a test case for the bug#29850: Wrong charset of the GROUP_CONCAT result
when the select employs a temporary table.
sql/item_sum.cc:
Bug#29850: Wrong charset of GROUP_CONCAT result when the select employs
a temporary table.
The copying constructor of the Item_func_group_concat class now correctly
initializes the charset of the result string.
Optimization of queries with DETERMINISTIC functions in the
WHERE clause was not effective: sequential scan was always
used.
Now a SF with the DETERMINISTIC flags is treated as constant
when it's arguments are constants (or a SF doesn't has arguments).
sql/item_func.h:
Fixed bug #29338.
The Item_func_sp::used_tables has been removed
(virtual Item_func::used_tables function is enough).
The virtual Item_func_sp::update_used_tables function
has been added.
sql/item_func.cc:
Fixed bug #29338.
The Item_func_sp::update_used_tables and the
Item_func_sp::fix_field functions have been modified
to take into account the DETERMINISTIC flag of SF definition.
mysql-test/r/sp.result:
Updated test case for bug #29338.
mysql-test/t/sp.test:
Updated test case for bug #29338.
to CHECK TABLE
CHECK/REPAIR TABLE reports "File not found" error when issued
against temporary table.
Fixed by disabling a brunch of code (in case it gets temporary table)
that is responsible for updating frm version as it is not needed
for temporary tables.
mysql-test/r/check.result:
A test case for BUG#26325.
mysql-test/t/check.test:
A test case for BUG#26325.
sql/handler.cc:
No need to update frm version in case table was created or checked
by server with the same version. This also ensures that we do not
update frm version for temporary tables as this code doesn't support
temporary tables.
when creating table
Federated tables had an artificially low maximum of key length,
because the handler failed to implement a method to return it and
the default value is taked from the prototype handler.
Now, implement that method and return the maximum possible key
length, which is that of InnoDB.
mysql-test/r/federated.result:
Verify that unique keys may be longer than 255 characters.
mysql-test/t/federated.test:
Verify that unique keys may be longer than 255 characters.
sql/ha_federated.h:
Implement the virtual method that tells the max size of parts to
make a key.
Backport the length defined in 5.1.
For each view the mysqldump utility creates a temporary table
with the same name and the same columns as the view
in order to satisfy views that depend on this view.
After the creation of all tables, mysqldump drops all
temporary tables and creates actual views.
However, --skip-add-drop-table and --compact flags disable
DROP TABLE statements for those temporary tables. Thus, it was
impossible to create the views because of existence of the
temporary tables with the same names.
client/mysqldump.c:
Fixed bug #28524.
The mysqldump utility has been modified to unconditionally drop
temporary tables before the creation of views.
mysql-test/t/mysqldump.test:
Updated test case for bug #28524 and updated result of previous tests.
mysql-test/r/mysqldump.result:
Updated test case for bug #28524 and updated result of previous tests.
function results in inconsistent behavior.
The bug itself was fixed by the patch for bug 20662.
mysql-test/r/sp-prelocking.result:
Update results (Bug#22427)
mysql-test/t/sp-prelocking.test:
Add a test case for Bug#22427 create table if not exists + stored
function results in inconsistent behavior
Fix the typo in the constructor. Cover a semantic check that previously
never worked with a test.
mysql-test/r/create.result:
Update results (Bug#26104)
mysql-test/r/innodb.result:
Update results.
mysql-test/t/create.test:
Add a test case for Bug#26104 Bug on foreign key class constructor
mysql-test/t/innodb.test:
Return a new error number (MySQL error instead of internal InnoDB error).
sql/sql_class.h:
A fix for Bug#26104 Bug on foreign key class constructor -- fix
the typo in the constructor
table.
The bug itself is yet another manifestation of Bug 26141.
mysql-test/r/trigger.result:
Update results.
mysql-test/t/trigger.test:
Add a test case for Bug#27248 Triggers: error if insert affects temporary
table
Problem: we may break a multibyte char sequence using a key
reduced to maximum allowed length for a storage engine
(that leads to failed assertion in the innodb code,
see also #17530).
Fix: align truncated key length to multibyte char boundary.
mysql-test/r/innodb_mysql.result:
Fix for bug #28125: ERROR 2013 when adding index.
- test result.
mysql-test/t/innodb_mysql.test:
Fix for bug #28125: ERROR 2013 when adding index.
- test case.
sql/sql_table.cc:
Fix for bug #28125: ERROR 2013 when adding index.
- align truncated key length to multibyte char boundary.
- display real key length in bytes raising warnings.
Fixed the yassl base64 decoding to correctly allocate a maximum decoded buffer size.
mysql-test/std_data/server8k-cert.pem:
BitKeeper file /Users/dkatz/50/mysql-test/std_data/server8k-cert.pem
mysql-test/std_data/server8k-key.pem:
BitKeeper file /Users/dkatz/50/mysql-test/std_data/server8k-key.pem
extra/yassl/taocrypt/src/coding.cpp:
Fixed buffer allocation to compute the proper maximum decoded size: (EncodedLength * 3/4) + 3
mysql-test/r/ssl_8k_key.result:
New BitKeeper file ``mysql-test/r/ssl_8k_key.result''
Test connection to server using large SSL key.
mysql-test/t/ssl_8k_key.test:
New BitKeeper file ``mysql-test/t/ssl_8k_key.test''
Test connection to server using large SSL key.
into bodhi.(none):/opt/local/work/mysql-5.0-runtime
mysql-test/t/sp.test:
Auto merged
sql/item.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/innodb_mysql.result:
Manual merge.
mysql-test/t/innodb_mysql.test:
Manual merge.
The get_time_value function is added. It is used to obtain TIME values both
from items the can return time as an integer and from items that can return
time only as a string.
The Arg_comparator::compare_datetime function now uses pointer to a getter
function to obtain values to compare. Now this function is also used for
comparison of TIME values.
The get_value_func variable is added to the Arg_comparator class.
It points to a getter function for the DATE/DATETIME/TIME comparator.
mysql-test/t/type_time.test:
Extended test case for the bug#29555.
mysql-test/r/type_time.result:
Extended test case for the bug#29555.
sql/item_cmpfunc.cc:
Extended fix for the bug#29555.
The get_time_value function is added. It is used to obtain TIME values both
from items the can return time as an integer and from items that can return
time only as a string.
The Arg_comparator::compare_datetime function now uses pointer to a getter
function to obtain values to compare. Now this function is also used for
comparison of TIME values.
sql/item_cmpfunc.h:
Extended fix for the bug#29555.
The get_value_func variable is added to the Arg_comparator class.
It points to a getter function for the DATE/DATETIME/TIME comparator.
Linux Debug build (possible deadlock)"
The bug is not repeatable any more.
mysql-test/r/innodb_mysql.result:
Update test results (Bug#27296)
mysql-test/t/innodb_mysql.test:
Add a teste case for Bug#27296 "Assertion in ALTER TABLE SET DEFAULT in
Linux Debug build (possible deadlock)"
The Field_newdate::store when storing a DATETIME value was returning the
'value was cut' error even if the thd->count_cuted_fields flag is set to
CHECK_FIELD_IGNORE. This made range optimizr think that there is no
appropriate data in the table and thus to return an empty set.
Now the Field_newdate::store function returns conversion error only if the
thd->count_cuted_fields flag isn't set to CHECK_FIELD_IGNORE.
mysql-test/t/type_time.test:
Added a test case for the bug#29729: Wrong conversion error led to an empty result set.
mysql-test/r/type_time.result:
Added a test case for the bug#29729: Wrong conversion error led to an empty result set.
sql/field.cc:
Bug#29729: Wrong conversion error led to an empty result set.
- return HA_KEY_SCAN_NOT_ROR flag for HASH indexes;
- Fix ha_heap::cmp_ref() to work with BTREE index scans.
mysql-test/r/index_merge.result:
BUG#29740: testcase
mysql-test/t/index_merge.test:
BUG#29740: testcase
sql/ha_heap.h:
BUG#29740: Wrong query results for index_merge/union over HEAP table.
- make HEAP table engine return HA_KEY_SCAN_NOT_ROR flag for HASH
indexes,as HASH index does not guarantee any ordering for rows
within the hash bucket.
- Fix BTREE indexes: make ha_heap::cmp_ref() compare the rowids in the
same way as ha_key_cmp() does.
sql/opt_range.cc:
BUG#29740: Fix comment about ROR scans.
BitKeeper/deleted/.del-ssl_big.test:
Delete: mysql-test/t/ssl_big.test
extra/yassl/include/yassl_int.hpp:
added comment
extra/yassl/src/yassl_int.cpp:
Changed init order to fix a compiler warning.
mysql-test/r/mysqltest.result:
There is no limit to connections anymore.
mysql-test/t/mysqltest.test:
There is no limit to connections anymore.
Added an option to yassl to allow "quiet shutdown" like openssl does. This option causes the SSL libs to NOT perform the close_notify handshake during shutdown. This fixes a hang we experience because we hold a lock during socket shutdown.
mysql-test/t/ssl_big.test:
BitKeeper file /Users/dkatz/50/mysql-test/t/ssl_big.test
mysql-test/r/ssl-big.result:
BitKeeper file /Users/dkatz/50/mysql-test/r/ssl-big.result
client/mysqltest.c:
Added new command to mysqltest to send a quit command to the server, but to not close the actual socket on our end.
Also changed code to reuse connection slots, so that the tests can open and close sockets in a loop.
extra/yassl/include/openssl/ssl.h:
Added C accessors to the quietShutdown option.
extra/yassl/include/yassl_int.hpp:
Added quietShutdown_ member and accessor methods to the SSL class.
extra/yassl/src/ssl.cpp:
Added accessors to get/set the quietShutdown option and to not perform the shutdown handshake if quietShutdown is set.
extra/yassl/src/yassl_int.cpp:
Added quietShutdown_ member and accessor methods to the SSL class.
vio/viossl.c:
Added line to set the quiet_shutdown option before shutting down the socket.
mysql-test/t/ssl-big.test:
Added a test that causes an unpatched server to hang during SSL socket shutdown.
Time values were compared by the BETWEEN function as strings. This led to a
wrong result in cases when some of arguments are less than 100 hours and other
are greater.
Now if all 3 arguments of the BETWEEN function are of the TIME type then
they are compared as integers.
mysql-test/t/type_time.test:
Added a tes tcase for the bug#29739: Incorrect time comparison in BETWEEN.
mysql-test/r/type_time.result:
Added a tes tcase for the bug#29739: Incorrect time comparison in BETWEEN.
sql/item_cmpfunc.cc:
Bug#29739: Incorrect time comparison in BETWEEN.
Now if all 3 arguments of the BETWEEN function are of the TIME type then
they are compared as integers.
causes full table lock on innodb table.
Also fixes Bug#28502 Triggers that update another innodb table
will block on X lock unnecessarily (duplciate).
Code review fixes.
Both bugs' synopses are misleading: InnoDB table is
not X locked. The statements, however, cannot proceed concurrently,
but this happens due to lock conflicts for tables used in triggers,
not for the InnoDB table.
If a user had an InnoDB table, and two triggers, AFTER UPDATE and
AFTER INSERT, competing for different resources (e.g. two distinct
MyISAM tables), then these two triggers would not be able to execute
concurrently. Moreover, INSERTS/UPDATES of the InnoDB table would
not be able to run concurrently.
The problem had other side-effects (see respective bug reports).
This behavior was a consequence of a shortcoming of the pre-locking
algorithm, which would not distinguish between different DML operations
(e.g. INSERT and DELETE) and pre-lock all the tables
that are used by any trigger defined on the subject table.
The idea of the fix is to extend the pre-locking algorithm to keep track,
for each table, what DML operation it is used for and not
load triggers that are known to never be fired.
mysql-test/r/trigger-trans.result:
Update results (Bug#26141)
mysql-test/r/trigger.result:
Update results (Bug#28502)
mysql-test/t/trigger-trans.test:
Add a test case for Bug#26141 mixing table types in trigger causes
full table lock on innodb table.
mysql-test/t/trigger.test:
Add a test case for Bug#28502 Triggers that update another innodb
table will block echo on X lock unnecessarily. Add more test
coverage for triggers.
sql/item.h:
enum trg_event_type is needed in table.h
sql/sp.cc:
Take into account table_list->trg_event_map when determining
what tables to pre-lock.
After this change, if we attempt to fire a
trigger for which we had not pre-locked any tables, error
'Table was not locked with LOCK TABLES' will be printed.
This, however, should never happen, provided the pre-locking
algorithm has no programming bugs.
Previously a trigger key in the sroutines hash was based on the name
of the table the trigger belongs to. This was possible because we would
always add to the pre-locking list all the triggers defined for a table when
handling this table.
Now the key is based on the name of the trigger, owing
to the fact that a trigger name must be unique in the database it
belongs to.
sql/sp_head.cc:
Generate sroutines hash key in init_spname(). This is a convenient
place since there we have all the necessary information and can
avoid an extra alloc.
Maintain and merge trg_event_map when adding and merging elements
of the pre-locking list.
sql/sp_head.h:
Add ,m_sroutines_key member, used when inserting the sphead for a
trigger into the cache of routines used by a statement.
Previously the key was based on the table name the trigger belonged
to, since for a given table we would add to the sroutines list
all the triggers defined on it.
sql/sql_lex.cc:
Introduce a new lex step: set_trg_event_type_for_tables().
It is called when we have finished parsing but before opening
and locking tables. Now this step is used to evaluate for each
TABLE_LIST instance which INSERT/UPDATE/DELETE operation, if any,
it is used in.
In future this method could be extended to aggregate other information
that is hard to aggregate during parsing.
sql/sql_lex.h:
Add declaration for set_trg_event_type_for_tables().
sql/sql_parse.cc:
Call set_trg_event_type_for_tables() after MYSQLparse(). Remove tabs.
sql/sql_prepare.cc:
Call set_trg_event_type_for_tables() after MYSQLparse().
sql/sql_trigger.cc:
Call set_trg_event_type_for_tables() after MYSQLparse().
sql/sql_trigger.h:
Remove an obsolete member.
sql/sql_view.cc:
Call set_trg_event_type_for_tables() after MYSQLparse().
sql/sql_yacc.yy:
Move assignment of sp_head::m_type before calling sp_head::init_spname(),
one is now used inside another.
sql/table.cc:
Implement TABLE_LIST::set_trg_event_map() - a method that calculates
wh triggers may be fired on this table when executing a statement.
sql/table.h:
Add missing declarations.
Move declaration of trg_event_type from item.h (it will be needed for
trg_event_map bitmap when we start using Bitmap template instead
of uint8).
into adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
mysql-test/t/query_cache.test:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/handler.h:
Auto merged
mysql-test/r/query_cache.result:
SCCS merged
A race condition in the integration between MyISAM and the query cache code
caused the query cache to fail to invalidate itself on concurrently inserted
data.
This patch fix this problem by using the existing handler interface which, upon
each statement cache attempt, compare the size of the table as viewed from the
cache writing thread and with any snap shot of the global table state. If the
two sizes are different the global table size is unknown and the current
statement can't be cached.
mysql-test/r/query_cache.result:
Added test case
mysql-test/t/query_cache.test:
Added test case
sql/ha_myisam.cc:
- Implemented handler interface for ha_myisam class to dermine if the table
belonging to the currently processed statement can be cached or not.
sql/ha_myisam.h:
- Implemented handler interface for ha_myisam class to dermine if the table
belonging to the currently processed statement can be cached or not.
sql/handler.h:
- Documented register_query_cache_table method in the handler interface.
A bug in the restore_prev_nj_state function allowed interleaving
inner tables of outer join operations with outer tables. With the
current implementation of the nested loops algorithm it could lead
to wrong result sets for queries with nested outer joins.
Another bug in this procedure effectively blocked evaluation of some
valid execution plans for queries with nested outer joins.
mysql-test/r/join_nested.result:
Added a test case for bug #29604.
mysql-test/t/join_nested.test:
Added a test case for bug #29604.
Fix the parser to make the database options not optional.
mysql-test/r/information_schema.result:
Update results (Bug#25859)
mysql-test/t/information_schema.test:
Add a test case for Bug#25859 "ALTER DATABASE works w/o parameters"
sql/sql_yacc.yy:
Fix Bug#25859 ALTER DATABASE works w/o parameters - require
parameters in the parser.
Time values were compared as strings. This led to a wrong comparison
result when comparing values one of which is under 100 hours and another is
over 100 hours.
Now when the Arg_comparator::set_cmp_func function sees that both items to
compare are of the TIME type it sets the comparator to the
Arg_comparator::compare_e_int or the Arg_comparator::compare_int_unsigned
functions.
sql/item_cmpfunc.cc:
Bug#29555: Comparing time values as strings may lead to a wrong result.
Now when the Arg_comparator::set_cmp_func function sees that both items to
compare are of the TIME type it sets the comparator to the
Arg_comparator::compare_e_int or the Arg_comparator::compare_int_unsigned
functions.
mysql-test/r/type_time.result:
Added a test case for the bug#29555: Comparing time values as strings may
lead to a wrong result.
mysql-test/t/type_time.test:
Added a test case for the bug#29555: Comparing time values as strings may
lead to a wrong result.
The special `zero' enum value was coerced to the normal
empty string enum value during a field-to-field copy.
This bug affected CREATE ... SELECT statements and
SELECT aggregate GROUP BY enum field statements.
Also this bug made unnecessary warnings during
the execution of CREATE ... SELECT statements:
Warning 1265 Data truncated for column...
sql/field_conv.cc:
Fixed bug #29360.
The field_conv function has been modified to properly convert
the special `zero' enum value between enum fields.
mysql-test/t/type_enum.test:
Updated test case for bug #29360.
mysql-test/r/type_enum.result:
Updated test case for bug #29360.
mysql-test/r/type_ranges.result:
Updated test case for bug #29360.
By default MyISAM overwrites .MYD and .MYI files no
DATA DIRECTORY option is used. This can lead to two tables
using the same .MYD and .MYI files (that can't be dropped).
To prevent CREATE TABLE from overwriting a file a new option
is introduced : keep_files_on_create
When this is on the CREATE TABLE throws an error if either
the .MYD or .MYI exists for a MyISAM table.
The option is off by default (resulting in compatible behavior).
include/my_base.h:
Bug #29325: introduce keep_files_on_create
myisam/mi_create.c:
Bug #29325: introduce keep_files_on_create
mysql-test/r/create.result:
Bug #29325: test case
mysql-test/t/create.test:
Bug #29325: test case
sql/ha_myisam.cc:
Bug #29325: introduce keep_files_on_create
sql/set_var.cc:
Bug #29325: introduce keep_files_on_create
sql/sql_class.h:
Bug #29325: introduce keep_files_on_create
sql/sql_table.cc:
Bug #29325: introduce keep_files_on_create
sql/unireg.cc:
Bug #29325: introduce keep_files_on_create
Backport from 5.1 a fix to make this test deterministic
mysql-test/r/rpl_misc_functions.result:
Backport from 5.1 a fix to make this test deterministic
mysql-test/t/rpl_misc_functions.test:
Backport from 5.1 a fix to make this test deterministic
1. Threat MBR for a key as double[] and convert it only
when about to store it on disk.
2. Remove the redundant function get_double().
myisam/sp_key.c:
Bug #29070:
1. threat MBR for a key as double[] and convert it only
when about to store it on disk.
2. remove the redundant function get_double()
mysql-test/r/gis-rtree.result:
Bug #29070: test case
mysql-test/t/gis-rtree.test:
Bug #29070: test case
dollin' it up for Guilhem ;) -- test streamlined,
better comments, faster code, add'l assert.
mysql-test/r/binlog.result:
Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
streamlined test
mysql-test/t/binlog.test:
Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
streamlined test
sql/log.cc:
Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
comment clarified
with the space character.
When the my_strnncollsp_simple function compares two strings and one is a prefix
of another then this function compares characters in the rest of longer key
with the space character to find whether the longer key is greater or less.
But the sort order of the collation isn't used in this comparison. This may
lead to a wrong comparison result, wrongly created index or wrong order of the
result set of a query with the ORDER BY clause.
Now the my_strnncollsp_simple function uses collation sort order to compare
the characters in the rest of longer key with the space character.
mysql-test/t/ctype_collate.test:
Added a test case for the bug#29461: Sort order of the collation wasn't used when
comparing characters with the space character.
mysql-test/r/ctype_collate.result:
Added a test case for the bug#29461: Sort order of the collation wasn't used when
comparing characters with the space character.
strings/ctype-simple.c:
Bug#29461: Sort order of the collation wasn't used when comparing characters
with the space character.Now the my_strnncollsp_simple function uses collation sort order to compare
the characters in the rest of longer key with the space character.
An assertion abort could occur for some grouping queries that employed
decimal user variables with assignments to them.
The problem appeared the constructors of the class Field_new_decimal
because the function my_decimal_length_to_precision did not guarantee
returning decimal precision not greater than DECIMAL_MAX_PRECISION.
mysql-test/r/type_newdecimal.result:
Added a test case for bug #29417.
mysql-test/t/type_newdecimal.test:
Added a test case for bug #29417.
sql/field.cc:
Fixed bug #29417.
An assertion abort could occur for some grouping queries that employed
decimal user variables with assignments to them.
The problem appeared the constructors of the class Field_new_decimal
because the function my_decimal_length_to_precision did not guarantee
returning decimal precision not greater than DECIMAL_MAX_PRECISION.
Now if the precision returned by calls to my_decimal_length_to_precision
in the constructors of the class Field_new_decimal is greater than
DECIMAL_MAX_PRECISION the precision is set to this value.
The cast operation ignored the cases when the precision and/or the scale exceeded
the limits, 65 and 30 respectively. No errors were reported in these cases.
For some queries this may lead to an assertion abort.
Fixed by throwing errors for such cases.
mysql-test/r/type_newdecimal.result:
Added a test case for bug #29415.
mysql-test/t/type_newdecimal.test:
Added a test case for bug #29415.
into labbari.dsl.inet.fi:/home/my/bk/mysql-5.0-marvel
libmysql/libmysql.c:
Auto merged
mysql-test/r/innodb_mysql.result:
Manual merge from main 5.1 to 5.1-marvel.
mysql-test/t/innodb_mysql.test:
Manual merge from main 5.1 to 5.1-marvel.
The SELECT INTO OUTFILE FIELDS ENCLOSED BY digit or minus sign,
followed by the same LOAD DATA INFILE statement, used wrond encoding
of non-string fields contained the enclosed character in their text
representation.
Example:
SELECT 15, 9 INTO OUTFILE 'text' FIELDS ENCLOSED BY '5';
Old encoded result in the text file:
5155 595
^ was decoded as the 1st enclosing character of the 2nd field;
^ was skipped as garbage;
^ ^ was decoded as a pair of englosing characters of the 1st field;
^ was decoded as traling space of the first field;
^^ was decoded as a doubled enclosed character.
New encoded result in the text file:
51\55 595
^ ^ pair of enclosing characters of the 1st field;
^^ escaped enclosed character.
sql/sql_class.h:
Fixed bug #29442.
The NUMERIC_CHARS macro constant has been defined to enumerate
all possible characters of a numeric value text representation.
The select_export::is_unsafe_field_sep boolean flag has been added
to apply the encoding algorithm to non-string values when it is
necessary.
sql/sql_class.cc:
Fixed bug #29442.
The select_export::send_data method has been modified to encode text
representation of fields of all data types like string fields.
mysql-test/t/loaddata.test:
Updated test case for bug #29442.
mysql-test/r/loaddata.result:
Updated test case for bug #29442.
AsText() needs to know the maximum number of
characters a IEEE double precision value can
occupy to make sure there's enough buffer space.
The number was too small to hold all possible
values and this caused buffer overruns.
Fixed by correcting the calculation of the
maximum digits in a string representation of an
IEEE double precision value as printed by
String::qs_append(double).
mysql-test/r/gis.result:
Bug #29166: test case
mysql-test/t/gis.test:
Bug #29166: test case
sql/spatial.cc:
Bug #29166: correct calculation of the maximum digits in
a string representation of a double
Problem: logging queries not using indexes we check a special flag which
is set only at the server startup and is not changing with a corresponding
server variable together.
Fix: check the variable value instead of the flag.
mysql-test/r/show_check.result:
Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
- test result.
mysql-test/t/show_check.test:
Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
- test case.
sql/mysqld.cc:
Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
- SPECIAL_LOG_QUERIES_NOT_USING_INDEXES is not used anymore.
sql/sql_parse.cc:
Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
- check opt_log_queries_not_using_indexes instead of
SPECIAL_LOG_QUERIES_NOT_USING_INDEXES flag.
sql/unireg.h:
Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
- SPECIAL_LOG_QUERIES_NOT_USING_INDEXES is not used anymore.
Problem: in case of failed 'show binlog events...' we don't inform that
the log is not in use anymore. That may confuse following 'purge logs...'
command as it takes into account logs in use.
Fix: always notify that the log is not in use anymore.
mysql-test/r/rpl_rotate_logs.result:
Fix for bug #29420: crash with show and purge binlogs
- test result.
mysql-test/t/rpl_rotate_logs.test:
Fix for bug #29420: crash with show and purge binlogs
- test case.
sql/sql_repl.cc:
Fix for bug #29420: crash with show and purge binlogs
- always zero thd->current_linfo at the end of the mysql_show_binlog_events().
fails if a database is not selected prior.
The problem manifested itself when a user tried to
create a routine that had non-fully-qualified identifiers in its bodies
and there was no current database selected.
This is a regression introduced by the fix for Bug 19022:
The patch for Bug 19022 changes the code to always produce a warning
if we can't resolve the current database in the parser.
In this case this was not necessary, since even though the produced
parsed tree was incorrect, we never re-use sphead
that was obtained at first parsing of CREATE PROCEDURE.
The sphead that is anyhow used is always obtained through db_load_routine,
and there we change the current database to sphead->m_db before
calling yyparse.
The idea of the fix is to resolve the current database directly using
lex->sphead->m_db member when parsing a stored routine body, when
such is present.
This patch removes the need to reset the current database
when loading a trigger or routine definition into SP cache.
The redundant code will be removed in 5.1.
mysql-test/r/sp.result:
Update test results (Bug#29050)
mysql-test/r/trigger.result:
Update results.
mysql-test/t/sp.test:
Add a test case for Bug#29050
mysql-test/t/trigger.test:
Fix wrong behavior covered with tests.
sql/sql_lex.cc:
Implement st_lex::copy_db_to().
sql/sql_lex.h:
Declare st_lex::copy_db_to().
sql/sql_parse.cc:
Use st_lex::copy_db_to() in add_table_to_list, rather than
THD::copy_db_to(). The former will use the database of the sphead,
if we're parsing a stored routine, not the default database in
THD. The default database is needed to initialize tables->db
when the database part was not explicitly specified in the identifier.
sql/sql_yacc.yy:
Use st_lex::copy_db_to() in the parser, rather than
THD::copy_db_to(). The former will use the database of the sphead,
if we're parsing a stored routine, not the default database in
THD.
This bug may manifest itself for select queries over a multi-table view
that includes an ORDER BY clause in its definition. If the select list of
the query contains references to the same view column with different
aliases the names of the columns in the result output will be nevertheless
the same, coinciding with one of the alias.
The bug happened because the method Item_ref::get_tmp_table_item that
was inherited by the class Item_direct_view_ref ignored the fact that
the name of the view column reference must be inherited by the fields
of the temporary table that was created in order to get the result rows
sorted.
mysql-test/r/view.result:
Added a test case for bug #29392.
mysql-test/t/view.test:
Added a test case for bug #29392.
sql/item.h:
Fixed bug #29392.
This bug may manifest itself for select queries over a multi-table view
that includes an ORDER BY clause in its definition. If the select list of
the query contains references to the same view column with different
aliases the names of the columns in the result output will be nevertheless
the same, coinciding with one of the alias.
The bug happened because the method Item_ref::get_tmp_table_item that
was inherited by the class Item_direct_view_ref ignored the fact that
the name of the view column reference must be inherited by the fields
of the temporary table that was created in order to get the result rows
sorted.
Fixed by providing a proper implementation of the get_tmp_table_item
method for the Item_direct_view_ref class.
'No database selected' is reported when calling stored procedures
Remove the offending warning introduced by the fix for Bug
25082
This minimal patch relies on the intrinsic knowledge of the fact that
mysql_change_db is never called with 'force_switch' set to TRUE
when such a warning may be needed:
* every stored routine belongs to a database (unlike, e.g., a
user defined function, which does not), so if we're activating the
database of a stored routine, it can never be NULL.
Therefore, this branch is never called for activation.
* if we're restoring the 'old' current database after routine
execution is complete, we should not issue a warning, since it's OK to
call a routine without having previously selected the current database.
TODO: 'force_switch' is an ambiguous flag, since we do not actually
have to 'force' the switch in case of stored routines at all.
When we activate the routine's database, we should perform
all the checks as in case of 'use db', and so we already do (in this
case 'force_switch' is unused).
When we load a routine into cache, we should not use mysql_change_db
at all, since there it's enough to call thd->reset_db(). We
do it this way for triggers, but code for routines is different (wrongly).
TODO: bugs are lurking in replication, since it bypasses mysql_change_db
and calls thd->[re_]set_db to set the current database.
The latter does not change thd->db_charset, thd->sctx->db_access
and thd->variables.collation_database (and this may have nasty side
effects).
These todo items are to be addressed in a separate patch, if at all.
mysql-test/r/sp.result:
Update results (Bug#28551)
mysql-test/t/sp.test:
Add a test case (Bug#28551)
sql/sp.cc:
Remove an obsolete comment.
Replace a check with an assert.
sql/sql_db.cc:
Remove the offending warning introduced by the fix for Bug
25082
This minimal patch relies on the intrinsic knowledge of the fact that
mysql_change_db is never called with 'force_switch' set to TRUE
when such a warning may be needed.
Problem: wrong comparison with trailing space.
This problem was fixed for all other character sets under terms of
bug 7788 ""Table is full" occurs during a multitable update".
ctype-cp932.c was forgotten.
Fix: applying the same fix for ctype-cp932.c.
(see ctype-sjis.c as an example of a previously correctly fixed file)
mysql-test/r/ctype_cp932.result:
Adding test
mysql-test/t/ctype_cp932.test:
Adding test
strings/ctype-cp932.c:
Applying the same fix which was done for all other
character sets under terms of bug 7788.
strings/ctype-utf8.c:
Fixing the same problem for utf8_general_cs,
which was forgotten in bug 7788 as well.
Problem: "mysqldump" doesn exists when running "mysql-test-run --embedded-server".
Fix: changing test to use "SELECT INTO OUTFILE" instead of "mysqldump -T".
mysql-test/r/ctype_big5.result:
Fixing tests to use "SELECT INTO OUTFILE" instead of "mysqldump -T"
mysql-test/t/ctype_big5.test:
Fixing tests to use "SELECT INTO OUTFILE" instead of "mysqldump -T"
Updated test case for bug #29294.
mysql-test/t/loaddata.test:
Updated test case for bug #29294.
mysql-test/r/loaddata.result:
Updated test case for bug #29294.
into gleb.loc:/home/uchum/work/bk/5.0-opt
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_load.cc:
Auto merged
mysql-test/r/loaddata.result:
Merge with 4.1-opt.
mysql-test/t/loaddata.test:
Merge with 4.1-opt.
Test case update for bug #29294.
mysql-test/t/loaddata.test:
Test case update for bug #29294.
mysql-test/r/loaddata.result:
Test case update for bug #29294.
The `SELECT 'r' INTO OUTFILE ... FIELDS ENCLOSED BY 'r' ' statement
encoded the 'r' string to a 4 byte string of value x'725c7272'
(sequence of 4 characters: r\rr).
The LOAD DATA statement decoded this string to a 1 byte string of
value x'0d' (ASCII Carriage Return character) instead of the original
'r' character.
The same error also happened with the FIELDS ENCLOSED BY clause
followed by special characters: 'n', 't', 'r', 'b', '0', 'Z' and 'N'.
NOTE 1: This is a result of the undocumented feature: the LOAD DATA INFILE
recognises 2-byte input sequences like \n, \t, \r and \Z in addition
to documented 2-byte sequences: \0 and \N. This feature should be
documented (here backspace character is a default ESCAPED BY character,
in the real-life example it may be any ESCAPED BY character).
NOTE 2, changed behaviour:
Now the `SELECT INTO OUTFILE' statement with the `FIELDS ENCLOSED BY'
clause followed by one of: 'n', 't', 'r', 'b', '0', 'Z' or 'N' characters
encodes this special character itself by doubling it ('r' --> 'rr'),
not by prepending it with an escape character.
sql/sql_class.h:
Fixed bug #29294.
The ESCAPE_CHARS macro constant is defined to enumerate
symbolic names of espace-sequences like '\n', '\t' etc.
The select_export::is_ambiguous_field_sep field has been added
to distinguish special values of the field_sep field from
another values (see ESCAPE_CHARS).
sql/sql_class.cc:
Fixed bug #29294.
The select_export::send_data method has been modified to
encode special values of the field_sep field by
doubling of those values instead of prepending them with a
value of the escape_char field.
Example: The SELECT 'r' INTO OUTFILE FIELDS ENCLOSED BY 'r'
now produces the 'rr' output string instead of x'5c72'
(i.e. instead of sequence of 2 bytes: \ and r).
sql/sql_load.cc:
Fixed bug #29294.
Added commentary for the READ_INFO::unescape method.
mysql-test/t/loaddata.test:
Updated test case for bug #29294.
mysql-test/r/loaddata.result:
Updated test case for bug #29294.
- Testcase fixup.
mysql-test/t/windows_shm.test:
Bug#24924 shared-memory-base-name that is too long causes buffer overflow
- Pass user, port and host to mysqladmin.
minor fixes to appease pushbuild.
mysql-test/r/binlog.result:
Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
make test portable so it will work on servers with
funny names.
mysql-test/t/binlog.test:
Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
make test portable so it will work on servers with
funny names.
sql/log.cc:
Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
change type to uchar * so it's the same as in 5.1.
This bug may manifest itself not only with the queries for which
the index-merge access method is chosen. It also may display
itself for queries with DISTINCT.
The bug was in how the Unique::get method used the merge_buffers
function. To compare elements in the the queue employed by
merge_buffers() it must use the buffpek_compare function rather
than the function for binary comparison.
mysql-test/r/innodb_mysql.result:
Added a test case for bug #25798.
mysql-test/t/innodb_mysql.test:
Added a test case for bug #25798.
sql/filesort.cc:
Fixed bug #25798.
The function merge_buffers() when called from the Uniques::get method
must use function buffpek_compare to compare elements in the queue it
employs. The pointer to buffpek_compare and the info for the function
that compares sorted records are passed to merge_buffers through certain
designated fields of the SORTPARAM structure.
sql/sql_sort.h:
Fixed bug #25798.
Added fields to the SORTPARAM structure to be used in the function
merge_buffers when called by the Uniques::get method.
sql/uniques.cc:
Fixed bug 25798.
The function merge_buffers() when called from the Uniques::get method
must use function buffpek_compare to compare elements in the queue it
employes.
into olga.mysql.com:/home/igor/mysql-5.0-opt
mysql-test/r/type_enum.result:
Auto merged
mysql-test/t/type_enum.test:
Auto merged
sql/field_conv.cc:
SCCS merged
previous correction didn't. make sure "tail" is fixed up
when filling cache several times; rework formulae.
mysql-test/r/binlog.result:
Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
show that fix for absolute end_log_pos in binlog also
works when cache is read several times and headers are
split across that boundary
mysql-test/t/binlog.test:
Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
show that fix for absolute end_log_pos in binlog also
works when cache is read several times and headers are
split across that boundary
When a UNION statement forced conversion of an UTF8
charset value to a binary charset value, the byte
length of the result values was truncated to the
CHAR_LENGTH of the original UTF8 value.
sql/item.cc:
Fixed bug #29205.
The calculation of data length was modified in
the Item_type_holder::join_types method to take into
account possible conversion of a multibyte charset
value to a binary charset value, when each
multibyte character is converted into a sequence
of bytes (not to a single byte of binary charset).
mysql-test/t/ctype_utf8.test:
Updated test case for bug #29205.
mysql-test/r/ctype_utf8.result:
Updated test case for bug #29205.
spaces.
When the my_strnncollsp_simple function compares two strings and one is a prefix
of another then this function compares characters in the rest of longer key
with the space character to find whether the longer key is greater or less.
But the sort order of the collation isn't used in this comparison. This may
lead to a wrong comparison result, wrongly created index or wrong order of the
result set of a query with the ORDER BY clause.
Now the my_strnncollsp_simple function uses collation sort order to compare
the characters in the rest of longer key with the space character.
mysql-test/t/ctype_collate.test:
Added a test case for the bug#29261: Sort order of the collation wasn't used
when comparing trailing spaces.
mysql-test/r/ctype_collate.result:
Added a test case for the bug#29261: Sort order of the collation wasn't used
when comparing trailing spaces.
strings/ctype-simple.c:
Bug#29261: Sort order of the collation wasn't used when comparing trailing
spaces.
Now the my_strnncollsp_simple function uses collation sort order to compare
the characters in the rest of longer key with the space character.
- Use SQL for diffing master and slave
mysql-test/r/rpl_misc_functions.result:
Dump t1 on slave and load it back into temporary table on master
to allow comapre with SQL
mysql-test/t/rpl_misc_functions.test:
Dump t1 on slave and load it back into temporary table on master
to allow comapre with SQL
query / no aggregate of subquery
The optimizer counts the aggregate functions that
appear as top level expressions (in all_fields) in
the current subquery. Later it makes a list of these
that it uses to actually execute the aggregates in
end_send_group().
That count is used in several places as a flag whether
there are aggregates functions.
While collecting the above info it must not consider
aggregates that are not aggregated in the current
context. It must treat them as normal expressions
instead. Not doing that leads to incorrect data about
the query, e.g. running a query that actually has no
aggregate functions as if it has some (and hence is
expected to return only one row).
Fixed by ignoring the aggregates that are not aggregated
in the current context.
One other smaller omission discovered and fixed in the
process : the place of aggregation was not calculated for
user defined functions. Fixed by calling
Item_sum::init_sum_func_check() and
Item_sum::check_sum_func() as it's done for the rest of
the aggregate functions.
mysql-test/r/subselect.result:
Bug #27333: test case
mysql-test/t/subselect.test:
Bug #27333: test case
sql/item_subselect.cc:
Bug#27333: need select_lex to filter out
aggregates that are not aggregated in
the current select.
sql/item_sum.cc:
Bug#27333: need select_lex to filter out
aggregates that are not aggregated in
the current select.
sql/item_sum.h:
Bug#27333: calculate the place of
aggregation for user defined functions.
sql/sql_select.cc:
Bug#27333: When counting the aggregated functions
and collecting a list of them we must not consider
the aggregates that are not aggregated in the local
context as "local" : i.e. we must treat them as
normal functions and not add them to the aggregate
functions list.
sql/sql_select.h:
Bug#27333: need select_lex to filter out
aggregates that are not aggregated in
the current select.
"Federared Transactions Failure"
Bug occurs when the user performs an operation which inserts more than
one row into the federated table and the federated table references a
remote table stored within a transactional storage engine. When the
insert operation for any one row in the statement fails due to
constraint violation, the federated engine is unable to perform
statement rollback and so the remote table contains a partial commit.
The user would expect a statement to perform the same so a statement
rollback is expected.
This bug was fixed by implementing bulk-insert handling into the
federated storage engine. This will relieve the bug for most common
situations by enabling the generation of a multi-row insert into the
remote table and thus permitting the remote table to perform
statement rollback when neccessary.
The multi-row insert is limited to the maximum packet size between
servers and should the size overflow, more than one insert statement
will be sent and this bug will reappear. Multi-row insert is disabled
when an "INSERT...ON DUPLICATE KEY UPDATE" is being performed.
The bulk-insert handling will offer a significant performance boost
when inserting a large number of small rows.
This patch builds on Bug29019 and Bug25511
sql/ha_federated.cc:
bug25513
new member methods:
start_bulk_insert() - initializes memory for bulk insert
end_bulk_insert() - sends any remaining bulk insert and frees memory
append_stmt_insert() - create the INSERT statement
sql/ha_federated.h:
bug25513
new member value:
bulk_insert
new member methods:
start_bulk_insert(), end_bulk_insert(), append_stmt_insert()
make member methods private:
read_next(), index_read_idx_with_result_set()
mysql-test/r/federated_innodb.result:
New BitKeeper file ``mysql-test/r/federated_innodb.result''
mysql-test/t/federated_innodb-slave.opt:
New BitKeeper file ``mysql-test/t/federated_innodb-slave.opt''
mysql-test/t/federated_innodb.test:
New BitKeeper file ``mysql-test/t/federated_innodb.test''
"Federated INSERT failures"
Federated does not correctly handle "INSERT...ON DUPLICATE KEY UPDATE"
However, implementing such support is not reasonably possible without
increasing complexity of the storage engine: checking that constraints
on remote server match local server and parsing error messages.
This patch causes 'ON DUPLICATE KEY' to fail with ER_DUP_KEY message
if a conflict occurs and not to fail silently.
include/my_base.h:
bug25511
new storage engine hint: HA_EXTRA_INSERT_WITH_UPDATE
mysql-test/r/federated.result:
test for bug25511
mysql-test/t/federated.test:
test for bug25511
sql/ha_federated.cc:
bug25511
implement support for handling HA_EXTRA_INSERT_WITH_UPDATE hint
sql/ha_federated.h:
bug25511
new property: insert_dup_update
sql/sql_insert.cc:
bug25511
implement support for HA_EXTRA_INSERT_WITH_UPDATE
When checking duplicates flag, if it is DUP_UPDATE, send hint
to the storage engine.
SHOW CREATE TABLE or SELECT FROM I_S.
Actually, the bug discovers two problems:
- the original query is not preserved properly. This is the problem
of BUG#16291;
- the resultset of SHOW CREATE TABLE statement is binary.
This patch fixes the second problem for the 5.0.
Both problems will be fixed in 5.1.
mysql-test/r/show_check.result:
Update result file.
mysql-test/t/show_check.test:
Provide test case for BUG#10491.
sql/item.h:
Use utf8_general_ci instead of binary collation by default,
because for views and base tables utf8 is the character set
in which their definition is stored. For system constants
it's the default character set, and for other objects
(routines, triggers), no character set is stored, and
therefore no character set is known, so returning utf8
is just as good as any non-binary character set.
This latter problem is fixed in 5.1 by 16291. In 5.1
we will return the "real" character set.
Problem: like_range() returned wrong ranges for contractions (like 'ch' in Czech').
Fix: adding a special code to handle tricky cases:
- contraction head followed by a wild character
- full contraction
- contraction part followed by another contraction part,
but they are not a contraction together.
mysql-test/r/ctype_uca.result:
Adding test case
mysql-test/t/ctype_uca.test:
Adding test case
strings/ctype-mb.c:
Adding test case
strings/ctype-uca.c:
Allocate additional 256 bytes for flags "is contraction part".
strings/ctype-ucs2.c:
Adding test case
"REPLACE/INSERT IGNORE/UPDATE IGNORE doesn't work"
Federated does not record neccessary HA_EXTRA flags in order to
support REPLACE/INSERT IGNORE/UPDATE IGNORE.
Implement ::extra() to capture flags neccessary for functionality.
New function append_ident() to better escape identifiers consistantly.
mysql-test/r/federated.result:
test for bug29019
mysql-test/t/federated.test:
test for bug29019
sql/ha_federated.cc:
Bug29019
Federated does not record neccessary HA_EXTRA flags in order to
support REPLACE/INSERT IGNORE/UPDATE IGNORE.
Implement ::extra() to capture flags neccessary for functionality.
New function append_ident() to better escape identifiers consistantly.
sql/ha_federated.h:
bug29019
add 2 member values to ha_federated class
ignore_duplicates and replace_duplicates.
add 1 member method to ha_federated class
extra()
Fulltext index may get corrupt by certain gbk characters.
The problem was that when skipping leading non-true-word-characters,
we assumed that these characters are always 1 byte long. This is not
the case with gbk character set, since non-true-word-characters may
be 2 bytes long.
Affects 5.0 only.
myisam/ft_parser.c:
Leading non-true-word-characters may also be multi-byte (e.g. in
gbk character set).
mysql-test/r/fulltext2.result:
A test case for BUG#29299.
mysql-test/t/fulltext2.test:
A test case for BUG#29299.
show that shm communication still works on windows,
and that we can't overflow the base-name.
mysql-test/t/windows_shm-master.opt:
Bug#24924: shared-memory-base-name that is too long causes buffer overflow
start a server with shm communication if we're on
windows.
mysql-test/t/windows_shm.test:
Bug#24924: shared-memory-base-name that is too long causes buffer overflow
.opt has started a server with shm communication
if we're on windows. now start a client with shm
and connect to that server.
Thanks to Martin Friebe for finding and submitting a fix for this bug!
A table with maximum number of key segments and maximum length key name
would have a corrupted .frm file, due to an incorrect calculation of the
complete key length. Now the key length is computed correctly (I hope) :-)
MyISAM would reject a table with the maximum number of keys and the maximum
number of key segments in all keys. It would allow one less than this total
maximum. Now MyISAM accepts a table defined with the maximum. (This is a
very minor issue.)
myisam/mi_open.c:
Bug #26642: change >= to > in a comparison (i.e., error
only if key_parts_in_table really is greater than
MAX_KEY * MAX_KEY_SEG)
mysql-test/r/create.result:
Bug #26642: test case
mysql-test/t/create.test:
Bug #26642: test case
sql/table.cc:
Bug #26642: In create_frm(), fix formula for key_length;
it was too small by (keys * 2) bytes
CHECK TABLE against ARCHIVE table may falsely report table corruption,
or cause server crash.
Fixed by using proper buffer for CHECK TABLE.
Affects both 5.0 and 5.1.
mysql-test/r/archive.result:
A test case for BUG#28916.
mysql-test/t/archive.test:
A test case for BUG#28916.
sql/ha_archive.cc:
We call Field::get_length() from get_row(). Field::get_length() assumes
that the row was read into table->record[0] buffer, which is not the
case when we check a table. As a result we get wrongly initialized
blob length.
Use table->record[0] as record buffer for check table instead.
Added more sleep time befoe reap to allow query to be executed.
mysql-test/t/status.test:
Added more sleep time befoe reap to allow query to be executed.
Sometimes special 0 ENUM values was ALTERed to normal
empty string ENUM values.
Special 0 ENUM value has the same string representation
as normal ENUM value defined as '' (empty string).
The do_field_string function was used to convert
ENUM data at an ALTER TABLE request, but this
function doesn't care about numerical "indices" of
ENUM values, i.e. do_field_string doesn't distinguish
a special 0 value from an empty string value.
A new copy function called do_field_enum has been added to
copy special 0 ENUM values without conversion to an empty
string.
sql/field_conv.cc:
Fixed bug #29251.
The Copy_field::get_copy_func method has been modified to
return a pointer to the do_field_enum function if a conversion
between two columns of incompatible enum types is required.
The do_field_enum function has been added for the correct
conversion of special 0 enum values.
mysql-test/t/type_enum.test:
Updated test case for bug #29251.
mysql-test/r/type_enum.result:
Updated test case for bug #29251.
a lookup into a BINARY index by a key ended with spaces. It caused
an assertion abort for a debug version and wrong results for non-debug
versions.
The problem occurred because the function _mi_pack_key stripped off
the trailing spaces from binary search keys while the function _mi_make_key
did not do it when keys were inserted into the index.
Now the function _mi_pack_key does not remove the trailing spaces from
search keys if they are of the binary type.
mysql-test/r/binary.result:
Added a test case for bug #29087.
mysql-test/t/binary.test:
Added a test case for bug #29087.
fix binlog-writing so that end_log_pos is given correctly even
within transactions for both SHOW BINLOG and SHOW MASTER STATUS,
that is as absolute values (from log start) rather than relative
values (from transaction's start).
---
Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into sin.intern.azundris.com:/home/tnurnberg/22540/50-22540
mysql-test/r/binlog.result:
Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions.
show that SHOW MASTER STATUS returns correct values while in transactions
(so that mysqldump --master-data will work correctly).
also remove bdb dependency.
---
manual merge
mysql-test/t/binlog.test:
Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions.
show that SHOW MASTER STATUS returns correct values while in transactions
(so that mysqldump --master-data will work correctly).
also remove bdb dependency.
sql/log.cc:
Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
fix output for SHOW BINLOG EVENTS so that end_log_pos is given correctly
even within transactions. do this by rewriting the commit-buffer in place.
LOCK TABLES takes a list of tables to lock. It may lock several
tables successfully and then encounter a tables that it can't lock,
e.g. because it's locked. In such case it needs to undo the locks on
the already locked tables. And it does that. But it has also notified
the relevant table storage engine handlers that they should lock.
The only reliable way to ensure that the table handlers will give up
their locks is to end the transaction. This is what UNLOCK TABLE
does : it ends the transaction if there were locked tables by LOCK
tables.
It is possible to end the transaction when the lock fails in
LOCK TABLES because LOCK TABLES ends the transaction at its start
already.
Fixed by ending (again) the transaction when LOCK TABLES fails to
lock a table.
mysql-test/r/innodb_mysql.result:
Bug #29154: test case
mysql-test/t/innodb_mysql.test:
Bug #29154: test case
sql/sql_parse.cc:
Bug #29154: end the trasaction at a failing
LOCK TABLES so the handler can free its locks.
Max compressed file size was calculated incorretly causing server
crash on INSERT.
With this patch we use proper max file size provided by zlib.
Affects 5.0 only.
sql/ha_archive.cc:
When calculating max compressed file size, use the real offset size
that is provided by zlib, instead of sizeof(z_off_t), which may be
different from actual offset size.
When we're about to write and the data file is almost full flush gzio
buffer to get accurate real file size.
mysql-test/r/archive-big.result:
New BitKeeper file ``mysql-test/r/archive-big.result''
mysql-test/t/archive-big.test:
New BitKeeper file ``mysql-test/t/archive-big.test''
the loose scan optimization for grouping queries was applied returned
a wrong result set when the query was used with the SQL_BIG_RESULT
option.
The SQL_BIG_RESULT option forces to use sorting algorithm for grouping
queries instead of employing a suitable index. The current loose scan
optimization is applied only for one table queries when the suitable
index is covering. It does not make sense to use sort algorithm in this
case. However the create_sort_index function does not take into account
the possible choice of the loose scan to implement the DISTINCT operator
which makes sorting unnecessary. Moreover the current implementation of
the loose scan for queries with distinct assumes that sorting will
never happen. Thus in this case create_sort_index should not call
the function filesort.
mysql-test/r/group_min_max.result:
Added a test case for bug #25602.
mysql-test/t/group_min_max.test:
Added a test case for bug #25602.
INSERT into table from SELECT from the same table
with ORDER BY and LIMIT was inserting other data
than sole SELECT ... ORDER BY ... LIMIT returns.
One part of the patch for bug #9676 improperly pushed
LIMIT to temporary table in the presence of the ORDER BY
clause.
That part has been removed.
sql/sql_select.cc:
Fixed bug #29095.
One part of the patch for bug #9676 improperly pushed
LIMIT to temporary table in the presence of the ORDER BY
clause.
That part has been removed.
mysql-test/t/insert_select.test:
Expanded the test case for bug #9676.
Created a test case for bug #29095.
mysql-test/r/insert_select.result:
Expanded the test case for bug #9676.
Created a test case for bug #29095.
into adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
into mysql.com:/home/bar/mysql-work/mysql-5.0.b28925
sql/sql_yacc.yy:
Auto merged
mysql-test/r/ctype_ucs2_def.result:
After merge fix
mysql-test/t/ctype_ucs2_def.test:
After merge fix
Problem: separator was not converted to the result character set,
so the result was a mixture of two different character sets,
which was especially bad for UCS2.
Fix: convert separator to the result character set.
mysql-test/r/ctype_ucs.result:
Adding test case
mysql-test/r/ctype_ucs2_def.result:
Adding test case
mysql-test/t/ctype_ucs.test:
Adding test case
mysql-test/t/ctype_ucs2_def.test:
Adding test case
sql/item_sum.cc:
Adding conversion of separator to the result character set
sql/sql_yacc.yy:
Fixing GROUPC_CONCAT problems when "mysqld --default-character-set=ucs2".
ALTER VIEW is currently not supported as a prepared statement
and should be disabled as such as they otherwise could cause server crashes.
ALTER VIEW is currently not supported when called from stored
procedures or functions for related reasons and should also be disabled.
This patch disables these DDL statements and adjusts the appropriate test
cases accordingly.
Additional tests has been added to reflect on the fact that we do support
CREATE/ALTER/DROP TABLE for Prepared Statements (PS), Stored Procedures (SP)
and PS within SP.
mysql-test/r/ps_1general.result:
- Updated test to reflect on the new policy to disallow ALTER VIEW within SP.
mysql-test/r/sp-dynamic.result:
- Added PS ALTER TABLE test from within SP-context to demonstrate that CREATE/ALTER/DROP
TABLE statements is working.
- Added PS CREATE/ALTER/DROP VIEW tests from within SP-context to show that
ALTER VIEW is not supported, CREATE VIEW/DROP VIEW are supported.
mysql-test/r/sp-error.result:
- Updated test to reflect on the new policy to disallow VIEW DDL within SP.
mysql-test/t/ps_1general.test:
- Updated test to reflect on the new policy to disallow VIEW DDL within SP.
mysql-test/t/sp-dynamic.test:
- Add PS ALTER TABLE test from within SP to demonstrate that CREATE/ALTER/DROP
TABLE statements are supported.
mysql-test/t/sp-error.test:
- Updated test to reflect on the new policy to disallow ALTER VIEW
within SP-context.
- Changed error code 1314 to the more abstract ER_SP_BADSTATEMENT.
sql/sql_class.h:
- Added comment for clarity
sql/sql_parse.cc:
- Added comment for clarity
sql/sql_prepare.cc:
- Disallow ALTER VIEW as prepared statements until they are
properly supported. Note that SQLCOM_CREATE_VIEW also handles ALTER VIEW
statements.
sql/sql_view.cc:
- converted to doxygen comments
- Added comment for clarity
sql/sql_yacc.yy:
- Disallow ALTER VIEW statements within a SP.
If the parser is operating within the SP context, this is shown
on the sp->sphead pointer. If this flag is set for view DDL operations
we stop parsing with the error 'ER_SP_BAD_STATEMENT'.
The reason the "reap;" succeeds unexpectedly is because the query was completing(almost always) and the network buffer was big enough to store the query result (sometimes) on Windows, meaning the response was completely sent before the server thread could be killed.
Therefore we use a much longer running query that doesn't have a chance to fully complete before the reap happens, testing the kill properly.
mysql-test/r/kill.result:
We use a much longer running query that doesn't have a chance to fully complete before the reap happens.
mysql-test/t/kill.test:
We use a much longer running query that doesn't have a chance to fully complete before the reap happens.
Occasionally mysqlbinlog --hexdump failed with error:
ERROR 1064 (42000) at line ...: You have an error in your
SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near
'Query thread_id=... exec_time=... error_code=...
When the length of hexadecimal dump of binlog header was
divisible by 16, commentary sign '#' after header was lost.
The Log_event::print_header function has been modified to always
finish hexadecimal binlog header with "\n# ".
sql/log_event.cc:
Fixed bug #28293.
The Log_event::print_header function has been modified to always
finish hexadecimal binlog header with "\n# ".
mysql-test/r/mysqlbinlog.result:
Updated test case for bug #28293.
mysql-test/t/mysqlbinlog.test:
Updated test case for bug #28293.
The abort happened when a query contained a conjunctive predicate
of the form 'view column = constant' in the WHERE condition and
the grouping list also contained a reference to a view column yet
a different one.
Removed the failing assertion as invalid in a general case.
Also fixed a bug that prevented applying some optimization for grouping
queries using views. If the WHERE condition of such a query contains
a conjunctive condition of the form 'view column = constant' and
this view column is used in the grouping list then grouping by this
column can be eliminated. The bug blocked performing this elimination.
mysql-test/r/view.result:
Added a test case for bug #29104.
mysql-test/t/view.test:
Added a test case for bug #29104.
sql/item.cc:
Fixed bug #29104: assertion abort for grouping queries using views.
The abort happened when a query contained a conjunctive predicate
of the form 'view column = constant' in the WHERE condition and
the grouping list also contained a reference to a view column yet
a different one.
Removed the failing assertion as invalid in a general case.
Also fixed a bug that prevented applying some optimization for grouping
queries using views. If the WHERE condition of such a query contains
a conjunctive condition of the form 'view column = constant' and
this view column is used in the grouping list then grouping by this
column can be eliminated. The bug blocked performing this elimination.
This bug was in the function Item_field::eq while the failing
assertion was in the function Item_direct_view_ref::eq.
(Part of fix for Bug#25621 Error in my_thread_global_end(): 1 threads didn't exit)
Give correct error message if InnoDB table is not found
(This allows us to drop a an innodb table that is not in the InnoDB registery)
BitKeeper/etc/ignore:
added include/abi_check
libmysql/libmysql.c:
Allow multiple calls to mysql_server_end()
(Part of fix for Bug#25621 Error in my_thread_global_end(): 1 threads didn't exit)
mysql-test/r/innodb_mysql.result:
Test case for drop of table that only has a .frm file
mysql-test/t/innodb_mysql.test:
Test case for drop of table that only has a .frm file
sql/ha_innodb.cc:
Give correct error message if InnoDB table is not found.
(This allows us to drop a an innodb table that is not in the InnoDB registery)
and replicated):
A DROP USER statement with a non-existing user was correctly written to
the binary log (there might be users that were removed, but not all),
but the error code was not set, which caused the slave to stop with an
error.
The error reporting code was moved to before the statement was logged
to ensure that the error information for the thread was correctly set
up. This works since my_error() will set the fields net.last_errno and
net.last_error for the thread that is reporting the error, and this
will then be picked up when the Query_log_event is created and written
to the binary log.
sql/sql_acl.cc:
Moving error reporting code to ensure that thd->net.last_err{or,no} is
set and adding debug printout.
mysql-test/r/rpl_grant.result:
New BitKeeper file ``mysql-test/r/rpl_grant.result''
mysql-test/t/rpl_grant.test:
New BitKeeper file ``mysql-test/t/rpl_grant.test''
Updated test case for bug #28898. Additional cleanup.
mysql-test/t/metadata.test:
Updated test case for bug #28898. Additional cleanup.
mysql-test/r/metadata.result:
Updated test case for bug #28898. Additional cleanup.
slave_sql thread calls thd->clear_error() to force error to be ignored,
though this method didn't clear thd->killed state, what causes
slave_sql thread to stop.
clear thd->killed state if we ignore an error
mysql-test/r/rpl_skip_error.result:
Bug #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists.
test result
mysql-test/t/rpl_skip_error.test:
Bug #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists.
test case
sql/log_event.cc:
Bug #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists.
clear thd->killed state if we ignore the error
For a join query with GROUP BY and/or ORDER BY and a view reference
in the FROM list the metadata erroneously showed empty table aliases
and database names for the view columns.
sql/item.h:
Fixed bug #28898.
Body of Item_ref::get_tmp_table_item method has been moved
to item.cc file.
mysql-test/t/metadata.test:
Updated test case for bug #28898.
sql/item.cc:
Fixed bug #28898.
The Item_ref::get_tmp_table_item method has been modified
to copy pointers to the table alias and database name to the new
Item_field object created for a field stored in the temporary
table.
mysql-test/r/metadata.result:
Updated test case for bug #28898.
sql/sql_select.cc:
Fixed bug #28898.
The change_to_use_tmp_fields function has been modified to
to copy pointers to the table alias and database name from
the Item_ref objects to the new Item_field objects created
for fields stored in the temporary table.
counters from relay
Updated the test to return columns vertically.
mysql-test/r/rpl_change_master.result:
Bug #29116: test updated
mysql-test/t/rpl_change_master.test:
Bug #29116: test updated
- Add test case for this already existing feature
mysql-test/r/mysqltest.result:
Update result file
mysql-test/t/mysqltest.test:
Add test case for this feature
- Move binlog related tests to binlog_innodb.test
- Remove "source include/have_log_bin.inc" from innodb.test
mysql-test/r/innodb.result:
Move binlog related tests to binlog_innodb.test
mysql-test/t/innodb.test:
Move binlog related tests to binlog_innodb.test
mysql-test/r/binlog_innodb.result:
Move binlog related tests to binlog_innodb.test
mysql-test/t/binlog_innodb.test:
Move binlog related tests to binlog_innodb.test
Fixed runtime to no longer allow the caching of queries with UDF calls.
mysql-test/r/udf.result:
Added a test that turns on caching and checks that querys calling UDFs don't get cached.
mysql-test/t/udf.test:
Added a test that turns on caching and checks that querys calling UDFs don't get cached.
sql/sql_yacc.yy:
Fixed code to set safe_to_cache_query=0 regardless if the function call is a UDF or SP. Where it was placed previously -- at the very end of the else testing for UDFs -- it only executed the statement if the function call was a stored procedure call.
Changed code to enforce that SQL_CACHE only in the first SELECT is used to turn on caching(as documented), but any SQL_NO_CACHE will turn off caching (not documented, but a useful behaviour, especially for machine generated queries). Added test cases to explicitly test the documented caching behaviour and test cases for the reported bug.
mysql-test/r/query_cache.result:
Added non-bug specific tests that ensure that only SQL_CACHE in the first SELECT is respected when encountered by the parser. These tests validate what is already documented, that only the outer most SELECTS can use the SQL_CACHE option to turn on caching. Because it would break existing SQL applications, we do not return an error if the SQL_CACHE expression is found in nested SELECTs. Also added test to validate nested SELECT can contain SQL_NO_CACHE and it will always turn off caching for the whole query.
Also added a bug specific test case to validate that the buggy behavior as reported has been fixed.
mysql-test/t/query_cache.test:
Added non-bug specific tests that ensure that only SQL_CACHE in the first SELECT is respected when encountered by the parser. These tests validate what is already documented, that only the outer most SELECTS can use the SQL_CACHE option to turn on caching. Because it would break existing SQL applications, we do not return an error if the SQL_CACHE expression is found in nested SELECTs. Also added test to validate nested SELECT can contain SQL_NO_CACHE and it will always turn off caching for the whole query.
Also added a bug specific test case to validate that the buggy behavior as reported has been fixed.
sql/sql_yacc.yy:
Added an explicit check to make sure "SELECT SQL_CACHE" only works on the first select in a query.
The parser will always hit the outermost SELECT first, and if the SQL_CACHE option is found it sets the safe_to_query flag in the lex. Then, if there are subseqent "uncachable" subqueries or functions, as it parses those elements it sets the safe_to_query to 0. However, this cause problems if nested SELECTs also used the SQL_CACHE option, because then it would set back safe_to_query to 1, even though there are uncacheable expressions previously parsed.
By adding the check to ensure only the first SELECT can turn caching on, it means a subsequent SQL_CACHE option can't turn caching back on after a uncacheable subsequery was already encountered.
The method select_insert::send_error does two things, it rolls back a statement
being executed and outputs an error message. But when a
nonexistent column is referenced, an error message has been published already and
there is no need to publish another.
Fixed by moving all functionality beyond publishing an error message into
select_insert::abort() and calling only that function.
mysql-test/r/errors.result:
Bug#28677: test result
mysql-test/t/errors.test:
Bug#28677: test case
sql/sql_class.h:
Bug#28677: overriding abort()
sql/sql_insert.cc:
Bug#28677:
- moved everything beyond producing an error message out of select_insert::send_error
and into new override select_insert::abort()
- made corresponding move of code from select_create::send_error to select_create::abort
sql/sql_select.cc:
Bug#28677: No need to pusblish an error here
represented by an expression of the type UNSIGNED INT and this
expression was evaluated to 0 then the function erroneously returned
the value of the first argument instead of an empty string.
This problem was introduced by the patch for bug 10963.
The problem has been resolved by a proper modification of the code of
Item_func_substr::val_str.
mysql-test/r/func_str.result:
Added a test case for bug #27130.
mysql-test/t/func_str.test:
Added a test case for bug #27130.
DECIMAL column was used instead of BIGINT for the minimal possible
BIGINT (-9223372036854775808).
The Item_func_neg::fix_length_and_dec has been adjusted to
to inherit the type of the argument in the case when it's an
Item_int object whose value is equal to LONGLONG_MIN.
sql/item_func.cc:
Fixed bug #28625.
The Item_func_neg::fix_length_and_dec has been adjusted to
to inherit the type of the argument in the case when it's an
Item_int object whose value is equal to LONGLONG_MIN.
mysql-test/t/bigint.test:
Added test result for bug #28625.
mysql-test/r/bigint.result:
Added test case for bug #28625.
Post-merge fix: replace xid=* with XID to isolate from number of transactions
mysql-test/r/binlog.result:
Post-merge fix: replace xid=* with XID to isolate from number of transactions
mysql-test/t/binlog.test:
Post-merge fix: replace xid=* with XID to isolate from number of transactions