| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
without FOR UPDATE is causing a lock".
SELECT statements with subqueries referencing InnoDB tables
were acquiring shared locks on rows in these tables when they
were executed in REPEATABLE-READ mode and with statement or
mixed mode binary logging turned on.
This was a regression which were introduced when fixing
bug 39843.
The problem was that for tables belonging to subqueries
parser set TL_READ_DEFAULT as a lock type. In cases when
statement/mixed binary logging at open_tables() time this
type of lock was converted to TL_READ_NO_INSERT lock at
open_tables() time and caused InnoDB engine to acquire
shared locks on reads from these tables. Although in some
cases such behavior was correct (e.g. for subqueries in
DELETE) in case of SELECT it has caused unnecessary locking.
This patch implements minimal version of the fix for the
specific problem described in the bug-report which supposed
to be not too risky for pushing into 5.1 tree.
The 5.5 tree already contains a more appropriate solution
which also addresses other related issues like bug 53921
"Wrong locks for SELECTs used stored functions may lead
to broken SBR".
This patch tries to solve the problem by ensuring that
TL_READ_DEFAULT lock which is set in the parser for
tables participating in subqueries at open_tables()
time is interpreted as TL_READ_NO_INSERT or TL_READ.
TL_READ is used only if we know that this is a SELECT
and that this particular table is not used by a stored
function.
Test coverage is added for both InnoDB and MyISAM.
This patch introduces an "incompatible" change in locking
scheme for subqueries used in SELECT ... FOR UPDATE and
SELECT .. IN SHARE MODE.
In 4.1 (as well as in 5.0 and 5.1 before fix for bug 39843)
the server would use a snapshot InnoDB read for subqueries
in SELECT FOR UPDATE and SELECT .. IN SHARE MODE statements,
regardless of whether the binary log is on or off.
If the user required a different type of read (i.e. locking
read), he/she could request so explicitly by providing FOR
UPDATE/IN SHARE MODE clause for each individual subquery.
The patch for bug 39843 broke this behaviour (which was not
documented or tested), and started to use locking reads for
all subqueries in SELECT ... FOR UPDATE/IN SHARE MODE.
This patch restores 4.1 behaviour.
This patch should be mostly null-merged into 5.5 tree.
mysql-test/include/check_concurrent_insert.inc:
Added auxiliary script which allows to check if statement
reading table allows concurrent inserts in it.
mysql-test/include/check_no_concurrent_insert.inc:
Added auxiliary script which allows to check that statement
reading table doesn't allow concurrent inserts in it.
mysql-test/include/check_no_row_lock.inc:
Added auxiliary script which allows to check if statement
reading table doesn't take locks on its rows.
mysql-test/include/check_shared_row_lock.inc:
Added auxiliary script which allows to check if statement
reading table takes shared locks on some of its rows.
mysql-test/r/bug39022.result:
After bug #46947 'Embedded SELECT without FOR UPDATE is
causing a lock' was fixed test case for bug 39022 has to
be adjusted in order to trigger execution path on which
original problem was encountered.
mysql-test/r/innodb_mysql_lock2.result:
Added coverage for handling of locking in various cases when
we read data from InnoDB tables (includes test case for
bug #46947 'Embedded SELECT without FOR UPDATE is causing a
lock').
mysql-test/r/lock_sync.result:
Added coverage for handling of locking in various cases when
we read data from MyISAM tables.
mysql-test/t/bug39022.test:
After bug #46947 'Embedded SELECT without FOR UPDATE is
causing a lock' was fixed test case for bug 39022 has to
be adjusted in order to trigger execution path on which
original problem was encountered.
mysql-test/t/innodb_mysql_lock2.test:
Added coverage for handling of locking in various cases when
we read data from InnoDB tables (includes test case for
bug #46947 'Embedded SELECT without FOR UPDATE is causing a
lock').
mysql-test/t/lock_sync.test:
Added coverage for handling of locking in various cases when
we read data from MyISAM tables.
sql/mysql_priv.h:
Function read_lock_type_for_table() now takes pointers to
LEX and TABLE_LIST elements as its arguments since to
correctly determine lock type it needs to know what
statement is being performed and whether table element for
which lock type to be determined belongs to prelocking list.
sql/sql_base.cc:
Changed read_lock_type_for_table() to return a weak TL_READ
type of lock in cases when we are executing SELECT (and so
won't update tables directly) and table doesn't belong to
statement's prelocking list and thus can't be used by a
stored function. It is OK to do so since in this case table
won't be used by statement or function call which will be
written to the binary log, so serializability requirements
for it can be relaxed.
One of results from this change is that SELECTs on InnoDB
tables no longer takes shared row locks for tables which
are used in subqueries (i.e. bug #46947 is fixed).
Another result is that for similar SELECTs on MyISAM tables
concurrent inserts are allowed.
In order to implement this change signature of
read_lock_type_for_table() function was changed to
take pointers to LEX and TABLE_LIST objects.
sql/sql_update.cc:
Function read_lock_type_for_table() now takes pointers to
LEX and TABLE_LIST elements as its arguments since to
correctly determine lock type it needs to know what
statement is being performed and whether table element for
which lock type to be determined belongs to prelocking list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
outer joins
There are two problems:
1. In simplify_joins function we calculate table dependencies. If STRAIGHT_JOIN hint
is used for whole SELECT we do not count it and as result some dependendecies
might be lost. It leads to incorrect table order which is returned by
join_tab_cmp_straight() function.
2. make_join_statistics() calculate the transitive closure for relations a particular
JOIN_TAB is 'dependent on'.
We aggregate the dependent table_map of a JOIN_TAB by adding dependencies from other
tables which we depend on. However, this may also cause new dependencies to be
available after we have completed processing a certain JOIN_TAB.
Both these problems affect condition pushdown and as result condition might be pushed
into wrong table which leads to crash or even omitted which leads to wrong result.
The fix:
1. Use modified 'transitive closure' algorithm provided by Ole John Aske
2. Update table dependences in simplify_joins according to
global STRAIGHT_JOIN hint.
Note: the patch also fixes bugs 46091 & 51492
mysql-test/r/join_outer.result:
test case
mysql-test/t/join_outer.test:
test case
sql/sql_select.cc:
1. Use modified 'transitive closure' algorithm provided by Ole John Aske
2. Update table dependences in simplify_joins according to
global STRAIGHT_JOIN hint.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
bitmap_is_set(table->read_set, field_index))
UPDATE on an InnoDB table modifying the same index that is used
to satisfy the WHERE condition could trigger a debug assertion
under some circumstances.
Since for engines with the HA_PRIMARY_KEY_IN_READ_INDEX flag
set results of an index scan on a secondary index are appended
by the primary key value, if a query involves only columns from
the primary key and a secondary index, the latter is considered
to be covering.
That tricks mysql_update() to mark for reading only columns
from the secondary index when it does an index scan to retrieve
rows to update in case a part of that key is also being
updated. However, there may be other columns in WHERE that are
part of the primary key, but not the secondary one.
What we actually want to do in this case is to add index
columns to the existing WHERE columns bitmap rather than
replace it.
mysql-test/r/innodb_mysql.result:
Test case for bug #53830.
mysql-test/t/innodb_mysql.test:
Test case for bug #53830.
sql/sql_update.cc:
Add index columns to the read_set bitmap, don't replace it.
sql/table.cc:
Added a new add_read_columns_used_by_index() function to
st_table.
sql/table.h:
Added a new add_read_columns_used_by_index() function to
st_table.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some of the test cases reference to binlog position and
these position numbers are written into result explicitly.
It is difficult to maintain if log event format changes.
There are a couple of cases explicit position number appears,
we handle them in different ways
A. 'CHANGE MASTER ...' with MASTER_LOG_POS or/and RELAY_LOG_POS options
Use --replace_result to mask them.
B. 'SHOW BINLOG EVENT ...'
Replaced by show_binlog_events.inc or wait_for_binlog_event.inc.
show_binlog_events.inc file's function is enhanced by given
$binlog_file and $binlog_limit.
C. 'SHOW SLAVE STATUS', 'show_slave_status.inc' and 'show_slave_status2.inc'
For the test cases just care a few items in the result of 'SHOW SLAVE STATUS',
only the items related to each test case are showed.
'show_slave_status.inc' is rebuild, only the given items in $status_items
will be showed.
'check_slave_is_running.inc' and 'check_slave_no_error.inc'
and 'check_slave_param.inc' are auxiliary files helping
to show running status and error information easily.
mysql-test/extra/binlog_tests/binlog.test:
It only cares whether current binlog file index is changed, so it is ok
with 'show_master_status.inc' instead of 'show mater status'.
mysql-test/extra/binlog_tests/blackhole.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_deadlock.test:
Use 'check_slave_is_running.inc' instead of 'show_slave_status2.inc'.
mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
Use 'wait_for_slave_sql_error.inc' and 'ait_for_slave_sql_error_and_skip.inc' instead of 'show slave status'.
mysql-test/extra/rpl_tests/rpl_flsh_tbls.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test:
It is need now to give a error number, so use 'wait_for_slave_io_to_stop.inc'
instead of 'wait_for_slave_io_error.inc'.
mysql-test/extra/rpl_tests/rpl_insert_delayed.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_log.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
se 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/extra/rpl_tests/rpl_max_relay_size.test:
se 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/extra/rpl_tests/rpl_reset_slave.test:
Use 'show_slave_status.inc' instead of 'show_slave_status2.inc' statement.
Use 'check_slave_no_error.inc' to simplify the check that there is no error.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Use 'check_slave_is_running.inc' to verify that Slave threads are running well.
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
Use 'show_slave_error_status_and_skip.inc' instead of 'show slave status'.
mysql-test/include/check_slave_is_running.inc:
To make sure both sql and io thread are running well. If not, the test will be aborted.
mysql-test/include/check_slave_no_error.inc:
To make sure both sql and io thread have no error. If not, the test will be aborted.
mysql-test/include/get_relay_log_pos.inc:
According to the position of a log event in master binlog file,
find the peer position of a log event in relay log file.
mysql-test/include/rpl_stmt_seq.inc:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/include/show_binlog_events.inc:
Add two options $binlog_file and $binlog_limit for showing binlog events from different binlog files or/and given different limits on position or row number.
mysql-test/include/show_rpl_debug_info.inc:
Add 'SELECT NOW()' in the debug information.
mysql-test/include/show_slave_status.inc:
It's more clean and tidy Only the given columns of slave status are printed.
mysql-test/include/test_fieldsize.inc:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/include/wait_for_binlog_event.inc:
Use show_rpl_debug_info.inc instead of 'SHOW BINLOG EVENTS'.
mysql-test/include/wait_for_slave_io_error.inc:
Add $slave_io_errno and $show_slave_io_error, it waits only a given error.
mysql-test/include/wait_for_slave_param.inc:
Use die instead of exit.
mysql-test/include/wait_for_slave_sql_error.inc:
Add $slave_sql_errno and $show_slave_sql_error, it waits only a given error.
mysql-test/include/wait_for_status_var.inc:
Use die instead of exit.
mysql-test/r/flush_block_commit_notembedded.result:
It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/r/multi_update.result:
It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/binlog/r/binlog_innodb.result:
It checks whether somethings are binlogged, so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/binlog/r/binlog_row_binlog.result:
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/binlog/r/binlog_stm_binlog.result:
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/binlog/t/binlog_innodb.test:
It checks whether somethings are binlogged, so we use 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/binlog/t/binlog_stm_binlog.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/bugs/r/rpl_bug36391.result:
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/bugs/t/rpl_bug12691.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/bugs/t/rpl_bug36391.test:
'show master status' is replaced by 'show_master_status.inc'.
Position in the result of 'show master status' is replaced by '#'.
mysql-test/suite/engines/funcs/r/rpl_000015.result:
It checks whether somethings are binlogged,
so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/suite/engines/funcs/t/rpl_000015.test:
Use 'check_slave_is_running.inc' to verify that Slave threads are running well.
mysql-test/suite/engines/funcs/t/rpl_REDIRECT.test:
Use 'query_vertical SHOW SLAVE STATUS' instead of 'show slave status'.
There is no status columns in the result file, for no slave exists on master's server.
mysql-test/suite/engines/funcs/t/rpl_change_master.test:
This test just care whether Read_Master_Log_Pos is equal to Exec_Master_Log_Pos after 'CHANGE MASTER ..'. So 'show slave status' is removed and just check the value of Read_Master_Log_Pos and Exec_Master_Log_Pos.
mysql-test/suite/engines/funcs/t/rpl_empty_master_crash.test:
We doesn't really need the statement.
mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test:
Just show Relay_Log_File, running status and error informations.
Use 'check_slave_is_running.inc' to verify that Slave threads are running well.
mysql-test/suite/engines/funcs/t/rpl_loaddata_s.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/engines/funcs/t/rpl_log_pos.test:
Mask the explicit positions in the result file.
Use 'check_slave_no_error.inc' to simplify the check that there is no error.
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/engines/funcs/t/rpl_rbr_to_sbr.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/engines/funcs/t/rpl_row_drop.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/engines/funcs/t/rpl_row_inexist_tbl.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/engines/funcs/t/rpl_row_until.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements.
Mask the explicit binary log positions in the result file.
mysql-test/suite/engines/funcs/t/rpl_server_id1.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
Use 'check_slave_no_error.inc' to simplify the check that there is no error.
mysql-test/suite/engines/funcs/t/rpl_server_id2.test:
It doesn't really need in this test.
mysql-test/suite/engines/funcs/t/rpl_slave_status.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/engines/funcs/t/rpl_switch_stm_row_mixed.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/manual/t/rpl_replication_delay.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/parts/t/rpl_partition.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/include/rpl_mixed_ddl.inc:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/include/rpl_mixed_dml.inc:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_000015.test:
Use 'show_slave_status.inc' instead of 'show_slave_status2.inc'.
mysql-test/suite/rpl/t/rpl_binlog_grant.test:
Use 'wait_for_binlog_event.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_bug33931.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_change_master.test:
This test just care whether Read_Master_Log_Pos is equal to Exec_Master_Log_Pos after 'CHANGE MASTER ..'. So 'show slave status' is removed and just check the value of Read_Master_Log_Pos and Exec_Master_Log_Pos.
mysql-test/suite/rpl/t/rpl_critical_errors.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_dual_pos_advance.test:
Mask the explicit position numbers in result file.
It is restricted running on SBR, for it want to binlog 'set @a=1' statement.
mysql-test/suite/rpl/t/rpl_empty_master_crash.test:
It doesn't need in this test.
mysql-test/suite/rpl/t/rpl_flushlog_loop.test:
UUse 'check_slave_is_running.inc' and 'show_slave_status.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test:
Use 'wait_for_slave_io_error.inc' to wait the given io thread error happening.
mysql-test/suite/rpl/t/rpl_grant.test:
It doesn't need in this test.
mysql-test/suite/rpl/t/rpl_incident.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/t/rpl_known_bugs_detection.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_loaddata_fatal.test:
Use 'wait_for_slave_sql_error_and_skip.inc' to wait the given sql thread error happening and then skip the event. There is no need to print the result of 'show slave stutus'.
mysql-test/suite/rpl/t/rpl_log_pos.test:
Use 'wait_for_slave_io_error.inc' to wait the given io thread error happening.
There is no need to print the result of 'show slave status'.
mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_replicate_do.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/rpl/t/rpl_rotate_logs.test:
Use 'show_slave_status.inc' instead of 'show_slave_status2.inc'.
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_row_create_table.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_row_drop.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_row_until.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements.
mysql-test/suite/rpl/t/rpl_skip_error.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave status'.
mysql-test/suite/rpl/t/rpl_slave_skip.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and mask the explicit position number in the 'CHANGE MASTER' statements.
mysql-test/suite/rpl/t/rpl_sp.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/suite/rpl/t/rpl_ssl.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/rpl/t/rpl_ssl1.test:
Use 'show_slave_status.inc' instead of 'show slave status'.
mysql-test/suite/rpl/t/rpl_stm_until.test:
Use 'check_slave_param.inc' to check whether SQL Thread stop at a right position, and use binlog position variables instead of explicit number in the 'CHANGE MASTER' statements.
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test:
Use 'wait_for_slave_sql_error.inc' to wait the given sql thread error happening.
There is no need to print the result of 'show slave status'.
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test:
Mask master_log_pos and master_log_file
mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test:
Use 'check_slave_is_running.inc' instead of 'show slave status' statement.
mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/alter_table-big.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/create-big.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/ctype_cp932_binlog_stm.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
mysql-test/t/flush_block_commit_notembedded.test:
It checks whether somethings are binlogged,
so we using 'show_binlog_event.inc' instead of 'show master status'.
mysql-test/t/multi_update.test:
It checks whether somethings are binlogged,
so we using 'wait_binlog_event.inc' instead of 'show master status'.
mysql-test/t/sp_trans_log.test:
Use 'show_binlog_events.inc' instead of 'show binlog events' statement.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
data directory name command
The check_db_name function has been modified to validate tails of
#mysql50#-prefixed database names for compliance with MySQL 5.0
database name encoding rules (the check_table_name function call
has been reused).
mysql-test/r/renamedb.result:
Updated test case.
mysql-test/r/upgrade.result:
Test case for bug #53804.
mysql-test/t/renamedb.test:
Updated test case.
mysql-test/t/upgrade.test:
Test case for bug #53804.
sql/mysql_priv.h:
Bug #53804: serious flaws in the alter database .. upgrade
data directory name command
The check_mysql50_prefix has been added.
sql/sql_table.cc:
Bug #53804: serious flaws in the alter database .. upgrade
data directory name command
- The check_mysql50_prefix has been added.
- The check_n_cut_mysql50_prefix function has been refactored
to share code with new check_mysql50_prefix function.
sql/table.cc:
Bug #53804: serious flaws in the alter database .. upgrade
data directory name command
The check_db_name function has been modified to validate tails of
#mysql50#-prefixed database names for compliance with MySQL 5.0
database name encoding rules.
|
|\ \
| |/
|/|
| |
| |
| | |
sql/ha_partition.cc:
Bug#49477, added safety that a partitioned table cannot be
temporary.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
with temporary table and partitions
It was possible to create temporary partitioned tables
via create table ... like ... (which is not allowed with
create temporary table). This lead to a new HA_EXTRA flag
(HA_EXTRA_MMAP) was sent to the partitioning handler,
which was caught on an assert in debug builds.
Solution was to check for partitioned tables when
doing create table ... like ... and disallow it.
mysql-test/r/partition_error.result:
Bug#49477: Assertion `0' failed in ha_partition.cc:5530
with temporary table and partitions
Added result
mysql-test/t/partition_error.test:
Bug#49477: Assertion `0' failed in ha_partition.cc:5530
with temporary table and partitions
Added test
sql/sql_table.cc:
Bug#49477: Assertion `0' failed in ha_partition.cc:5530
with temporary table and partitions
Added check to prevent creation of partitioned temporary
tables.
Only copy .par file for partitioned tables.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Server crashes on 64bit linux with 'double free or corruption'
message, on 32bit mysql-test-run silently fails on bootstrap
stage. The problem is that FreeState() is called twice
for init_settings struct in _db_end_ function.
The fix is to remove superfluous FreeState() call.
Additional fix:
fixed discrepancy of result file when
debug & valgrind options are enabled
for MTR.
dbug/dbug.c:
The problem is that FreeState() is called twice
for init_settings struct in _db_end_ function.
The fix is to remove superfluous FreeState() call.
mysql-test/r/variables_debug.result:
fixed discrepancy of result file when
debug & valgrind options are enabled
for MTR.
mysql-test/t/variables_debug.test:
fixed discrepancy of result file when
debug & valgrind options are enabled
for MTR.
sql/set_var.cc:
fixed discrepancy of result file when
debug & valgrind options are enabled
for MTR.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
tor.didriksen@sun.com-20100106140051-3j2iuag63eltsr2e
Bug #50087 Interval arithmetic for Event_queue_element is not portable.
Subtraction of two unsigned months yielded a (very large) positive value.
Conversion of this to a signed value was not necessarily well defined.
Solution: do the subtraction on signed values.
mysql-test/r/events_scheduling.result:
Add test case.
mysql-test/t/events_scheduling.test:
Add test case.
sql/event_data_objects.cc:
Convert month to signed before doing the subtraction.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ha_myisam::index_first(uchar*)") at assert.c:81
Single-table DELETE crash/assertion similar to single-table
UPDATE bug 14272.
Same resolution as for the bug 14272:
Don't run index scan when we should use quick select.
This could cause failures because there are table handlers (like federated)
that support quick select scanning but do not support index scanning.
mysql-test/r/delete.result:
Test case for bug #53450.
mysql-test/t/delete.test:
Test case for bug #53450.
sql/sql_delete.cc:
Bug #53450: Crash / assertion "virtual int
ha_myisam::index_first(uchar*)") at assert.c:81
The mysql_delete function has been modified to not to use
init_read_record_idx instead of init_read_record for the
quick select.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
NULL from outer join query
Problem: optimising MIN/MAX() queries without GROUP BY clause
by replacing the aggregate expression with a constant, we may set it
to NULL disregarding the fact that there may be outer joins involved.
Fix: don't replace MIN/MAX() with NULL if there're outer joins.
Note: the fix itself is just
- if (!count)
+ if (!count && !outer_tables)
set to NULL
The rest of the patch eliminates repeated code to improve speed
and for easy maintenance of the code.
mysql-test/r/group_by.result:
Fix for bug#52051: Aggregate functions incorrectly returns
NULL from outer join query
- test result.
mysql-test/t/group_by.test:
Fix for bug#52051: Aggregate functions incorrectly returns
NULL from outer join query
- test case.
sql/opt_sum.cc:
Fix for bug#52051: Aggregate functions incorrectly returns
NULL from outer join query
- optimising MIN/MAX() queries without GROUP BY clause by
replacing them with a constant, take into account that
there're may be outer joins involved.
- repeated code for MIN/MAX optimization in the opt_sum_query()
eliminated by introducing new functions that read MIN/MAX values
using index and combining MIN/MAX cases to one.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
update statements
Only SELECT statements report any examined rows in the slow
log. Slow UPDATE, DELETE and INSERT statements report 0 rows
examined, unless the statement has a condition including a
SELECT substatement.
This patch adds counting of examined rows for the UPDATE and
DELETE statements. An INSERT ... VALUES statement will still
not report any rows as examined.
sql/sql_class.h:
Added more docs for THD::examined_row_count.
sql/sql_delete.cc:
Add incrementing thd->examined_row_count.
sql/sql_update.cc:
Add incrementing thd->examined_row_count.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
remember range endpoints
The Loose Index Scan optimization keeps track of a sequence
of intervals. For the current interval it maintains the
current interval's endpoints. But the maximum endpoint was
not stored in the SQL layer; rather, it relied on the
storage engine to retain this value in-between reads. By
coincidence this holds for MyISAM and InnoDB. Not for the
partitioning engine, however.
Fixed by making the key values iterator
(QUICK_RANGE_SELECT) keep track of the current maximum endpoint.
This is also more efficient as we save a call through the
handler API in case of open-ended intervals.
The code to calculate endpoints was extracted into
separate methods in QUICK_RANGE_SELECT, and it was possible to
get rid of some code duplication as part of fix.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The fix actually reverts the change introduced
by the patch for bug 51494.
The fact is that patches for bugs 52177&48419
fix bugs 51194&50575 as well.
mysql-test/r/innodb_mysql.result:
test case
mysql-test/t/innodb_mysql.test:
test case
sql/sql_select.cc:
reverted wrong fix for bug 51494
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
truncates text/blob to 766 chars
mysqldump and SELECT ... INTO OUTFILE truncated long BLOB/TEXT
values to size of 766 bytes (MAX_FIELD_WIDTH or 255 * 3 + 1).
The select_export::send_data method has been modified to
reallocate a conversion buffer for long field data.
mysql-test/r/mysqldump.result:
Test case for bug #53088.
mysql-test/r/outfile_loaddata.result:
Test case for bug #53088.
mysql-test/t/mysqldump.test:
Test case for bug #53088.
mysql-test/t/outfile_loaddata.test:
Test case for bug #53088.
sql/sql_class.cc:
Bug #53088: mysqldump with -T & --default-character-set set
truncates text/blob to 766 chars
The select_export::send_data method has been modified to
reallocate a conversion buffer for long field data.
|
|\ \ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
greedy_search optimizer_search_depth=0
The algorithm inside restore_prev_nj_state failed to
properly update the counters within the NESTED_JOIN
tree. The counter was decremented each time a table in the
node was removed from the QEP, the correct thing to do being
only to decrement it when the last table in the child node
was removed from the plan. This lead to node counters
getting negative values and the plan thus appeared
impossible. An assertion caught this.
Fixed by not recursing up the tree unless the last table in
the join nest node is removed from the plan
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is the 5.1 merge and extension of the fix.
The server was happily accepting paths in table name in all places a table
name is accepted (e.g. a SELECT). This allowed all users that have some
privilege over some database to read all tables in all databases in all
mysql server instances that the server file system has access to.
Fixed by :
1. making sure no path elements are allowed in quoted table name when
constructing the path (note that the path symbols are still valid in table names
when they're properly escaped by the server).
2. checking the #mysql50# prefixed names the same way they're checked for
path elements in mysql-5.0.
|
|\ \ \ |
|
| |\ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
the InnoDB Plugin tests are now in mysql-test/suite/innodb_plugin.
Move InnoDB tests to the innodb suite at mysql-test/suite/innodb.
|
| | |\ \ \ |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
innodb.*, innodb_bug34300* and innodb_bug39438* in order to preserve their
history from SVN.
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Iterative patch improvement. Previously committed patch
caused wrong result on Windows. The previous patch also
broke secure_file_priv for symlinks since not all file
paths which must be compared against this variable are
normalized using the same norm.
The server variable opt_secure_file_priv wasn't
normalized properly and caused the operations
LOAD DATA INFILE .. INTO TABLE ..
and
SELECT load_file(..)
to do different interpretations of the
--secure-file-priv option.
The patch moves code to the server initialization
routines so that the path always is normalized
once and only once.
It was also intended that setting the option
to an empty string should be equal to
lifting all previously set restrictions. This
is also fixed by this patch.
mysql-test/r/loaddata.result:
* Removed test code which will currently break the much used --mem feature of mtr.
mysql-test/t/loaddata.test:
* Removed test code which will currently break the much used --mem feature of mtr.
sql/item_strfunc.cc:
* Replaced string comparing code on opt_secure_file_priv with an interface which guarantees that both file paths are normalized using the same norm on all platforms.
sql/mysql_priv.h:
* Added signature for is_secure_file_path()
sql/mysqld.cc:
* New function for checking if a path compatible with the secure path restriction.
* Added initialization of the opt_secure_file_priv variable.
sql/sql_class.cc:
* Replaced string comparing code on opt_secure_file_priv with an interface which guarantees that both file paths are normalized using the same norm on all platforms.
sql/sql_load.cc:
* Replaced string comparing code on opt_secure_file_priv with an interface which guarantees that both file paths are normalized using the same norm on all platforms.
|
|\ \ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
WHERE predicates containing references to empty tables in a
subquery were handled incorrectly by the optimizer when
executing EXPLAIN. As a result, the optimizer could try to
evaluate such predicates rather than just stop with
"Impossible WHERE noticed after reading const tables" as
it would do in a non-subquery case. This led to valgrind
errors and crashes.
Fixed the code checking the above condition so that subqueries
are not excluded and hence are handled in the same way as top
level SELECTs.
mysql-test/r/explain.result:
Added a test case for bug #48419.
mysql-test/r/ps.result:
Updated test results to take the new (and more correct)
"Extra" comments in execution plans.
mysql-test/t/explain.test:
Added a test case for bug #48419.
sql/sql_select.cc:
There is no point in excluding subqueries from checking
for identically false WHERE conditions.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The problem was that a syntactically invalid trigger could cause
the server to crash when trying to list triggers. The crash would
happen due to a mishap in the backup/restore procedure that should
protect parser items which are not associated with the trigger. The
backup/restore is used to isolate the parse tree (and context) of
a statement from the load (and parsing) of a trigger. In this case,
a error during the parsing of a trigger could cause the improper
backup/restore sequence.
The solution is to properly restore the original statement context
before the parser is exited due to syntax errors in the trigger body.
mysql-test/r/trigger.result:
Add test case result for Bug#50755
mysql-test/t/trigger.test:
Add test case for Bug#50755
sql/sp_head.cc:
Merge sp_head::destroy() and sp_head destructor. Retrieve THD
from the LEX so that m_thd is not necessary.
sql/sql_lex.cc:
Explicitly restore the original environment.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
during an UPDATE
Extended the fix for bug 29310 to multi-table update:
When a table is being updated it has two set of fields - fields required for
checks of conditions and fields to be updated. A storage engine is allowed
not to retrieve columns marked for update. Due to this fact records can't
be compared to see whether the data has been changed or not. This makes the
server always update records independently of data change.
Now when an auto-updatable timestamp field is present and server sees that
a table handle isn't going to retrieve write-only fields then all of such
fields are marked as to be read to force the handler to retrieve them.
|
|\ \ \ \ \ \
| | |_|_|/ /
| |/| | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The problem was in an incorrect debug assertion. The expression
used in the failing assertion states that when finding
references matching ORDER BY expressions, there can be only one
reference to a single table. But that does not make any sense,
all test cases for this bug are valid examples with multiple
identical WHERE expressions referencing the same table which
are also present in the ORDER BY list.
Fixed by removing the failing assertion. We also have to take
care of the 'found' counter so that we count multiple
references only once. We rely on this fact later in
eq_ref_table().
mysql-test/r/join.result:
Added a test case for bug #50335.
mysql-test/t/join.test:
Added a test case for bug #50335.
sql/sql_select.cc:
Removing the assertion in eq_ref_table() as it does not make
any sense. We also have to take care of the 'found' counter so
that we count multiple references only once. We rely on this
fact later in eq_ref_table().
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Problem: ALTER TABLE ADD INDEX may lead to table copying if there's
numeric field(s) with non-default display width modificator specified.
Fix: compare numeric field's storage lenghts when we decide whether
they can be considered 'equal' for table alteration purposes.
mysql-test/r/error_simulation.result:
Fix for bug#50946: fast index creation still seems to copy the table
- test result.
mysql-test/t/error_simulation.test:
Fix for bug#50946: fast index creation still seems to copy the table
- test case.
sql/field.cc:
Fix for bug#50946: fast index creation still seems to copy the table
- check numeric field's pack lengths instead of it's display lenghts
comparing fields equality for table alteration purposes.
sql/sql_table.cc:
Fix for bug#50946: fast index creation still seems to copy the table
- check compare_tables() result for testing purposes.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Previously installed dynamic plugins are explicitly not loaded
on startup with --skip-grant-tables enabled. However, INSTALL
PLUGIN/UNINSTALL PLUGIN commands are allowed, and result in
inconsistent error messages (reporting duplicate plugin or
plugin does not exist).
This patch adds a check for --skip-grant-tables mode, and
returns error ER_OPTION_PREVENTS_STATEMENT to the user when
the above commands are attempted.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Correcting a patch misstake. The converted file path is placed in 'buff' not in opt_secure_file_priv.
mysql-test/r/loaddata.result:
* Updated test case; Since secure_file_priv now is normalized the previous values are changed.
sql/mysqld.cc:
* Fixed patch misstake
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
fields + warnings
Arg_comparator initializes 'comparators' array in case of
ROW comparison and does not free this array on destruction.
It leads to memory leaks.
The fix:
-added Arg_comparator::cleanup() method which frees
'comparators' array.
-added Item_bool_func2::cleanup() method which calls
Arg_comparator::cleanup() method
mysql-test/r/ps.result:
test case
mysql-test/r/row.result:
test case
mysql-test/t/ps.test:
test case
mysql-test/t/row.test:
test case
sql/item_cmpfunc.h:
-added Arg_comparator::cleanup() method which frees
'comparators' array.
-added Item_bool_func2::cleanup() method which calls
Arg_comparator::cleanup() method
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When re-setting (SET GLOBAL debug='') the GLOBAL debug settings the
server was not freeing the data elements from the top (initial) frame
before setting them to 0 without freeing the underlying memory. As these
are global settings there's a chance that something is there already.
Fixed by :
1. making sure the allocated data are cleaned up before re-setting them
while parsing a debug string
2. making sure the stuff allocated in the global settings is freed on
shutdown.
|
| |_|_|/ /
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
line 817
We should disable const subselect item evaluation because
subselect transformation does not happen in view_prepare_mode
and thus val_...() methods can not be called.
mysql-test/r/ctype_ucs.result:
test case
mysql-test/r/view.result:
test case
mysql-test/t/ctype_ucs.test:
test case
mysql-test/t/view.test:
test case
sql/item.cc:
disabled const subselect item evaluation in
view prepare mode.
sql/item_subselect.cc:
added Item_subselect::safe_charset_converter which
prevents const item evaluation in view prepare mode.
sql/item_subselect.h:
added Item_subselect::safe_charset_converter which
prevents const item evaluation in view prepare mode.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
sql_select.cc:15355
The problem is that we can not use make_cond_for_table().
This function relies on used_tables() condition
which is not set properly for subqueries.
As result subquery is not filtered out.
The fix is to use remove_eq_conds() function instead
of make_cond_for_table() func. 'remove_eq_conds()'
algorithm relies on const_item() value and it allows
to handle subqueries in right way.
mysql-test/r/having.result:
test case
mysql-test/t/having.test:
test case
sql/sql_select.cc:
The fix is to use remove_eq_conds() function instead
of make_cond_for_table() function.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Procedure, while DECIMAL works
Selecting of the CONCAT(...<SP variable>...) result into
a user variable may return wrong data.
Item_func_concat::val_str contains a number of memory
allocation-saving tricks. One of them concatenates
strings inplace inserting the value of one string
at the beginning of the other string. However,
this trick didn't care about strings those points
to the same data buffer: this is possible when
a CONCAT() parameter is a stored procedure variable -
Item_sp_variable::val_str() uses the intermediate
Item_sp_variable::str_value field, where it may
store a reference to an external buffer.
The Item_func_concat::val_str function has been
modified to take into account val_str functions
(such as Item_sp_variable::val_str) that return
a pointer to an internal Item member variable
that may reference to a buffer provided.
mysql-test/r/func_concat.result:
Test case for the bug #40625.
mysql-test/t/func_concat.test:
Test case for the bug #40625.
sql/item_strfunc.cc:
Bug #40625: Concat fails on DOUBLE values in a Stored
Procedure, while DECIMAL works
The Item_func_concat::val_str function has been
modified to take into account val_str functions
(such as Item_sp_variable::val_str) that return
a pointer to an internal Item member variable
that may reference to a buffer provided.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
on index
'my_decimal' class has two members which can be used to access the
value. The member variable buf (inherited from parent class decimal_t)
is set to member variable buffer so that both are pointing to same value.
Item_copy_decimal::copy() uses memcpy to clone 'my_decimal'. The member
buffer is declared as an array and memcpy results in copying the values
of the array, but the inherited member buf, which should be pointing at
the begining of the array 'buffer' starts pointing to the begining of
buffer in original object (which is being cloned). Further updates on
'my_decimal' updates only the inherited member 'buf' but leaves
buffer unchanged.
Later when the new object (which now holds a inconsistent value) is cloned
again using proper cloning function 'my_decimal2decimal' the buf pointer
is fixed resulting in loss of the current value.
Using my_decimal2decimal instead of memcpy in Item_copy_decimal::copy()
fixed this problem.
mysql-test/r/subselect.result:
Updated result file after addding test case for bug#47904.
mysql-test/t/subselect.test:
Added test case for bug#47904.
sql/item.cc:
Memcopy shouldn't be used to clone my_decimal. Use my_decimal2decimal
instead.
|
|\ \ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
data and index files
It was possible if DATA/INDEX DIRECTORY is pointing to
symlinked MySQL data home directory.
Do not allow to drop data/index files implicitly symlinked
to data home directory. For such tables remove symlink only.
mysql-test/r/symlink.result:
A test case for BUG#40980.
mysql-test/t/symlink.test:
A test case for BUG#40980.
storage/myisam/mi_delete_table.c:
Do not allow to drop data/index files implicitly symlinked
to data home directory. For such tables remove symlink only.
|
|\ \ \ \ \ \ |
|
| | |_|/ / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Problem: EXPLAIN EXTENDED was trying to resolve references to
freed temporary table fields for GROUP_CONCAT()'s ORDER BY arguments.
Fix: use stored original GROUP_CONCAT()'s arguments in such a case.
mysql-test/r/func_gconcat.result:
Fix for bug#52397: another crash with explain extended and group_concat
- test result.
mysql-test/t/func_gconcat.test:
Fix for bug#52397: another crash with explain extended and group_concat
- test case.
sql/item_sum.cc:
Fix for bug#52397: another crash with explain extended and group_concat
- use "pargs", printing ORDER BY arguments in the
Item_func_group_concat::print() instead of "order" to avoid
possible reference resolving to (freed) temporary table fields.
|
|/ / / / /
| | | | |
| | | | |
| | | | | |
Added a read-only global boolean variable skip_name_resolve.
|
|\ \ \ \ \
| | |/ / /
| |/| | | |
|