become negative
- merged the fix to 5.1
- extended to cover I_S.PROCESSLIST.TIME
- Changed the column type of I_S.PROCESSLIST.TIME from LOGNLONG
UNSIGNED
to LONG (to match the SHOW PROCESSLIST type)
- Added a test case
select where .. (col=col and col=col) or ... (false expression)
Problem: optimizer didn't take into account a singular case
when we eliminated all the predicates at the AND level of WHERE.
That may lead to wrong results.
Fix: replace (a=a AND a=a...) with TRUE if we eliminated all the
predicates.
mysql-test/r/select.result:
Fix for bug #42957: no results from
select where .. (col=col and col=col) or ... (false expression)
- test result.
mysql-test/t/select.test:
Fix for bug #42957: no results from
select where .. (col=col and col=col) or ... (false expression)
- test case.
sql/sql_select.cc:
Fix for bug #42957: no results from
select where .. (col=col and col=col) or ... (false expression)
- replacing equality predicates by multiple equality items check
if we eliminate all the predicates at the AND level and
replace them with TRUE if so.
seems to become negative
THD::start_time has a dual meaning : it's either the time since the process
entered a given state or is the transaction time returned by e.g. NOW().
This causes problems, as sometimes THD::start_time may be set to a value
that is correct and needed when used as a base for NOW(), but these times
may be arbitrary (SET @@timestamp) or non-local (coming from the master
through the replication feed).
If one such non-local time is set there's no way to return a correct value
for e.g. SHOW PROCESSLIST or SELECT ... FROM INFORMATION_SCHEMA.PROCESSLIST.
Fixed by making the Time column in SHOW PROCESSLIST SIGNED LONG instead of
UNSIGNED LONG and doing the correct conversions.
Note that no reliable test suite can be constructed, since it would require
knowing the local time and can't be achieved by the means of the current test
suite.
sql/sql_show.cc:
Bug #22047: make the Time in SHOW PROCESSLIST LONG from
LONG UNSIGNED
normalize error-messages
mysql-test/r/variables.result:
show that warning uses underscore
(sysvar-name), not hyphens (option-name)
mysql-test/t/variables.test:
show that warning uses underscore
(sysvar-name), not hyphens (option-name)
sql/set_var.cc:
normalize error-messages
The problem is that creating a event could fail if the value of
the variable server_id didn't fit in the originator column of
the event system table. The cause is two-fold: it was possible
to set server_id to a value outside the documented range (from
0 to 2^32-1) and the originator column of the event table didn't
have enough room for values in this range.
The log tables (general_log and slow_log) also don't have a proper
column type to store the server_id and having a large server_id
value could prevent queries from being logged.
The solution is to ensure that all system tables that store the
server_id value have a proper column type (int unsigned) and that
the variable can't be set to a value that is not within the range.
mysql-test/r/events_bugs.result:
Add test case result for Bug#36540
mysql-test/r/log_tables.result:
Update column type.
mysql-test/r/system_mysql_db.result:
Update column type.
mysql-test/r/variables.result:
Add test case result for server_id value range.
mysql-test/suite/sys_vars/r/server_id_basic_64.result:
Update test case results.
mysql-test/t/events_bugs.test:
Add test case for Bug#36540
mysql-test/t/log_tables.test:
Fix column type.
mysql-test/t/variables.test:
Add test case for server_id value range.
scripts/mysql_system_tables.sql:
Columns that store the server_id value must be of type INT UNSIGNED,
fix event (originator), general_log and slow_log (server_id) tables
in accordance.
scripts/mysql_system_tables_fix.sql:
Columns that store the server_id value must be of type INT UNSIGNED,
fix event (originator), general_log and slow_log (server_id) tables
in accordance.
sql/mysqld.cc:
Set min and max values for the server_id variable.
Unfortunately we can't easily change server_id variable type
from ulong to uint32 because of the sys_var classes.
The copy of the original arguments of a aggregate function was not
initialized until after fix_fields().
Sometimes (e.g. when there's an error processing the statement)
the print() can be called with no corresponding fix_fields() call.
Fixed by adding a check if the Item is fixed before using the arguments
copy.
mysql-test/r/explain.result:
Bug #43354: test case
mysql-test/t/explain.test:
Bug #43354: test case
sql/item_sum.cc:
Bug #43354: use the argument list copy only if it's initialized
Took the Xfree implementation (based on the same rewrite as the NDB one)
and added it instead of the current implementation.
Added a macro to make the calls to MD5 more streamlined.
client/mysqlmanager-pwgen.c:
Bug #42434: changed to call the macro
include/my_md5.h:
Bug #42434: use the Xfree implementation
mysys/md5.c:
Bug #42434: use the Xfree implementation
sql/item_strfunc.cc:
Bug #42434: changed to call the macro
sql/table.cc:
Bug #42434: changed to call the macro
tools/mysqlmanager.c:
Bug #42434: changed to call the macro
Some changes that make things more elegant in 6.0,
backported so the code is mostly the same in 5.1,
for easier maintainence.
sql/set_var.cc:
Backporting some changes to 5.1 so the code is
mostly the same in both versions. Less to learn!
This is a back port from 5.1 to 5.0.
Fix for BUG 20023: mysql_change_user() resets the value
of SQL_BIG_SELECTS.
The bug was that SQL_BIG_SELECTS was not properly set
in COM_CHANGE_USER.
The fix is to update SQL_BIG_SELECTS properly.
sql/sql_class.cc:
Update THD::options with the respect to SQL_BIG_SELECTS
in COM_CHANGE_USER.
tests/mysql_client_test.c:
Add a test case BUG#20023.
The problem was that the server was trying to use the unknown
error format string (ER_UNKNOWN_ERROR) to print messages about
comments being too long, but the said format string does not
accept arguments and will always default to "Unknown error".
The solution is to introduce new error messages which are
specific to the error conditions so that server wants to
signal -- this also means that it's possible to translate
those messages.
mysql-test/r/strict.result:
Update test case result.
mysql-test/t/strict.test:
Update test case with new errors.
sql/share/errmsg.txt:
Introduce new errors for long comments.
sql/unireg.cc:
Use new errors.
When using mixed mode the record values stored inside the storage
engine differed from the ones computed from the row event. This
happened because the prepare_record function was calling
empty_record macro causing some don't care bits to be left set.
Replacing the empty_record plus explicitly setting defaults with
restore_record to restore the record default values fixes this.
An unnecessarily restrictive lock were taken on sub-SELECTs during DELETE.
During parsing, a global structure is reused for sub-SELECTs and the attribute
keeping track of lock options were not reset properly.
This patch introduces a new attribute to keep track on the syntactical lock
option elements found in a sub-SELECT and then sets the lock options accordingly.
Now the sub-SELECTs will try to acquire a READ lock if possible
instead of a WRITE lock as inherited from the outer DELETE statement.
mysql-test/r/lock.result:
Added test case for bug39843
mysql-test/t/lock.test:
Added test case for bug39843
sql/sql_lex.cc:
* Reset member variable lock_option on each new query.
sql/sql_lex.h:
* Introduced new member variable 'lock_option' which is keeping track
of the syntactical lock option of a (sub-)select query.
sql/sql_parse.cc:
* Wrote comments to functions.
sql/sql_yacc.yy:
* Introduced an attribute to keep track of syntactical lock options
in sub-selects.
* Made sure that the default value TL_READ_DEFAULT is at the begining
of each subselect-rule.
When binlog_format is STATEMENT and the statement is unsafe before,
the unsafe warning/error message was issued without checking
whether the SQL_LOG_BIN was turned on or not.
Fixed with adding a sql_log_bin_toplevel flag in THD to check
whether SQL_LOG_BIN is ON in current session whatever the current is in sp or not.
mysql-test/suite/binlog/r/binlog_unsafe.result:
Test case result for unsafe warning/error message
mysql-test/suite/binlog/t/binlog_unsafe.test:
Test case for unsafe message warning/error
sql/set_var.cc:
Adding a function set_option_log_bin_bit() which specailly handles to
the change of SQL_LOG_BIN bit in order to set sql_log_bin_toplevel
according to SQL_LOG_BIN current value at the same time.
sql/sql_class.cc:
Initialize the flag sql_log_bin_toplevel in THD::init(),
and add the condition to check whether unsafe ror message was issued.
sql/sql_class.h:
Add a sql_log_bin_toplevel flag in THD to indicate whether the toplevel SQL_LOG_BIN is
set user variable max length on
fix_length_and_dec() stage
using real value length.
mysql-test/r/variables.result:
test result
mysql-test/t/variables.test:
test case
sql/item_func.cc:
set user variable max length on
fix_length_and_dec() stage
using real value length.
The query cache module did not check for the SQL_NO_CACHE keyword before
attempting to query the hash lookup table. This had a small performance impact.
By introducing a check on the query string before obtaining the hash mutex
we can gain some performance if the SQL_NO_CACHE directive is used often.
sql/sql_cache.cc:
* Introduced new helper function, has_no_cache_directive, for checking the
existance of a SQL_NO_CACHE directive before actual parsing of the query.
The problem here seem to be that when mysql
is redirecting stderr to a file, stderr becomes
buffered, whereas it is unbuffered by definition.
The solution is to unbuffer it by setting buffer
to null.
sql/log.cc:
use setbuf(stderr, NULL) to set the buffer to null.
sql/mysqld.cc:
use setbuf(stderr, NULL) to set the buffer to null.
Bug #18828: If InnoDB runs out of undo slots, it returns misleading 'table is full'
This is a backport of code already in 5.1+. The error message change referred
to in the detailed revision comments is still pending.
Detailed revision comments:
r3937 | calvin | 2009-01-15 03:11:56 +0200 (Thu, 15 Jan 2009) | 17 lines
branches/5.0:
Backport the fix for Bug#18828. Return DB_TOO_MANY_CONCURRENT_TRXS
when we run out of UNDO slots in the rollback segment. The backport
is requested by MySQL under bug#41529 - Safe handling of InnoDB running
out of undo log slots.
This is a partial fix since the MySQL error code requested to properly
report the error condition back to the client has not yet materialized.
Currently we have #ifdef'd the error code translation in ha_innodb.cc.
This will have to be changed as and when MySQl add the new requested
code or an equivalent code that we can then use.
Given the above, currently we will get the old behavior, not the
"fixed" and intended behavior.
Approved by: Heikki (on IM)
Set wrong sql_mode when creating a procedure.
So that the sql_mode can't be writen into binary log correctly.
Restore the current session sql_mode right before generating the binlog event
when creating a procedure.
mysql-test/suite/binlog/r/binlog_sql_mode.result:
Test result
mysql-test/suite/binlog/t/binlog_sql_mode.test:
Test file for sql_mode testing
sql/sp.cc:
Restore the current session sql_mode right before generating the binlog event.
return no rows
The algorithm of determining the best key for loose index scan is doing a loop
over the available indexes and selects the one that has the best cost.
It retrieves the parameters of the current index into a set of variables.
If the cost of using the current index is lower than the best cost so far it
copies these variables into another set of variables that contain the
information for the best index so far.
After having checked all the indexes it uses these variables (outside of the
index loop) to create the table read plan object instance.
The was a single omission : the key_infix/key_infix_len variables were used
outside of the loop without being preserved in the loop for the best index
so far.
This causes these variables to get overwritten by the next index(es) checked.
Fixed by adding variables to hold the data for the current index, passing
the new variables to the function that assigns values to them and copying
the new variables into the existing ones when selecting a new current best
index.
To avoid further such problems moved the declarations of the variables used
to keep information about the current index inside the loop's compound
statement.
mysql-test/r/group_min_max.result:
Bug #41610: test case
mysql-test/t/group_min_max.test:
Bug #41610: test case
sql/opt_range.cc:
Bug #41610: copy the infix data for the current best index
In STRICT mode, out-of-bounds values caused an error message
to be queued (rather than just a warning), without any further
error-like processing happening. (The error is queued during
update, at which time it's too late. For it to be processed
properly, it would need to be queued during check-stage.)
The assertion rightfully complains that we're trying to send
an OK while having an error queued.
Changeset breaks a lot of tests out into check-stage. This also
allows us to send more correct warnings/error messages.
sql/set_var.cc:
cleanup: fold get_unsigned() and fix_unsigned() into one,
as well as all the semi-common code from the ::check
functions.
of a view are selected by * wildcard
Backported a part of the fix for 36086 to 5.0
mysql-test/r/view_grant.result:
Bug #41354: test case
mysql-test/t/view_grant.test:
Bug #41354: test case
sql/sql_acl.cc:
Bug #41354: return table error when no access and *
sql/sql_base.cc:
Bug #41354: backported the check in bug 36086 to 5.0