mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 10.6 into 10.10
The MDEV-29693 conflict resolution is from Monty, as well as is a bug fix where ANALYZE TABLE wrongly built histograms for single-column PRIMARY KEY. Also includes a fix for safe_malloc error reporting. Other things: - Copied main.log_slow from 10.4 to avoid mtr issue Disabled test: - spider/bugfix.mdev_27239 because we started to get +Error 1429 Unable to connect to foreign data source: localhost -Error 1158 Got an error reading communication packets - main.delayed - Bug#54332 Deadlock with two connections doing LOCK TABLE+INSERT DELAYED This part is disabled for now as it fails randomly with different warnings/errors (no corruption).
This commit is contained in:
@ -121,3 +121,70 @@ drop table t;
|
||||
--echo #
|
||||
--echo # End of 10.3 tests
|
||||
--echo #
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-31742: incorrect examined rows in case of stored function usage
|
||||
--echo #
|
||||
|
||||
|
||||
CREATE TABLE `tab_MDEV_30820` (
|
||||
`ID` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`NAME_F` varchar(50) DEFAULT NULL,
|
||||
PRIMARY KEY (`ID`)
|
||||
);
|
||||
|
||||
CREATE TABLE `tab2` (
|
||||
`ID` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`TAB1_ID` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
|
||||
--disable_ps2_protocol
|
||||
--disable_view_protocol
|
||||
|
||||
--delimiter //
|
||||
CREATE FUNCTION `get_zero`() RETURNS int(11)
|
||||
BEGIN
|
||||
RETURN(0) ;
|
||||
END
|
||||
//
|
||||
|
||||
for i in 1..100 do insert into tab_MDEV_30820 values (i,'qwerty'); end for ; //
|
||||
for i in 1..1000 do insert into tab2 values (i,i+300); end for ; //
|
||||
|
||||
--delimiter ;
|
||||
|
||||
SET @old_slow_query_log= @@global.slow_query_log;
|
||||
SET @old_log_output= @@global.log_output;
|
||||
SET @old_long_query_time= @@long_query_time;
|
||||
SET GLOBAL log_output= "TABLE";
|
||||
SET GLOBAL slow_query_log= ON;
|
||||
|
||||
SET SESSION slow_query_log=ON;
|
||||
SET SESSION long_query_time= 0;
|
||||
|
||||
SELECT 0 as zero, (SELECT ID FROM tab2 where tab2.TAB1_ID =
|
||||
tab_MDEV_30820.ID ORDER BY 1 LIMIT 1 ) AS F1 FROM tab_MDEV_30820 ORDER BY 2 DESC LIMIT 2;
|
||||
|
||||
SELECT get_zero() as zero, (SELECT ID FROM tab2 where tab2.TAB1_ID =
|
||||
tab_MDEV_30820.ID ORDER BY 1 LIMIT 1) AS F1 FROM tab_MDEV_30820 ORDER BY 2 DESC LIMIT 2;
|
||||
|
||||
--echo # should be the same rows_examined
|
||||
SELECT rows_examined FROM mysql.slow_log WHERE sql_text LIKE '%SELECT%tab_MDEV_30820%';
|
||||
|
||||
## Reset to initial values
|
||||
SET @@long_query_time= @old_long_query_time;
|
||||
SET @@global.log_output= @old_log_output;
|
||||
SET @@global.slow_query_log= @old_slow_query_log;
|
||||
SET SESSION slow_query_log=default;
|
||||
|
||||
drop table tab_MDEV_30820, tab2;
|
||||
drop function get_zero;
|
||||
|
||||
--enable_view_protocol
|
||||
--enable_ps2_protocol
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
||||
|
Reference in New Issue
Block a user