mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Bug#48052: Valgrind warning - uninitialized value in
init_read_record() - (records.cc:274)
Item_cond::used_tables_cache was accessed in
records.cc#init_read_record() without being initialized. It had
not been initialized because it was wrongly assumed that the
Item's variables would not be accessed, and hence
quick_fix_field() was used instead of fix_fields() to save a few
CPU cycles at creation time.
The fix is to properly initilize the Item by replacing
quick_fix_field() with fix_fields().
mysql-test/r/select.result:
Add test for BUG#48052
mysql-test/t/select.test:
Add test for BUG#48052
sql/sql_select.cc:
Properly initialize Item_cond_and by calling fix_fields (instead of quick_fix_field) when the Item that "ANDs" WHERE clause conditions with HAVING clause conditions is created.
This commit is contained in:
@@ -4591,4 +4591,22 @@ field2
|
||||
15:13:38
|
||||
drop table A,AA,B,BB;
|
||||
#end of test for bug#45266
|
||||
#
|
||||
# BUG#48052: Valgrind warning - uninitialized value in init_read_record()
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
pk int(11) NOT NULL,
|
||||
i int(11) DEFAULT NULL,
|
||||
v varchar(1) DEFAULT NULL,
|
||||
PRIMARY KEY (pk)
|
||||
);
|
||||
INSERT INTO t1 VALUES (2,7,'m');
|
||||
INSERT INTO t1 VALUES (3,9,'m');
|
||||
SELECT v
|
||||
FROM t1
|
||||
WHERE NOT pk > 0
|
||||
HAVING v <= 't'
|
||||
ORDER BY pk;
|
||||
v
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
||||
@@ -3931,4 +3931,37 @@ SELECT table1 .`time_key` field2 FROM B table1 LEFT JOIN BB JOIN A table5 ON
|
||||
|
||||
drop table A,AA,B,BB;
|
||||
--echo #end of test for bug#45266
|
||||
|
||||
--echo #
|
||||
--echo # BUG#48052: Valgrind warning - uninitialized value in init_read_record()
|
||||
--echo #
|
||||
|
||||
# Needed in 6.0 codebase
|
||||
#--echo # Disable Index condition pushdown
|
||||
#--replace_column 1 #
|
||||
#SELECT @old_icp:=@@engine_condition_pushdown;
|
||||
#SET SESSION engine_condition_pushdown = 'OFF';
|
||||
|
||||
CREATE TABLE t1 (
|
||||
pk int(11) NOT NULL,
|
||||
i int(11) DEFAULT NULL,
|
||||
v varchar(1) DEFAULT NULL,
|
||||
PRIMARY KEY (pk)
|
||||
);
|
||||
|
||||
INSERT INTO t1 VALUES (2,7,'m');
|
||||
INSERT INTO t1 VALUES (3,9,'m');
|
||||
|
||||
SELECT v
|
||||
FROM t1
|
||||
WHERE NOT pk > 0
|
||||
HAVING v <= 't'
|
||||
ORDER BY pk;
|
||||
|
||||
# Needed in 6.0 codebase
|
||||
#--echo # Restore old value for Index condition pushdown
|
||||
#SET SESSION engine_condition_pushdown=@old_icp;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
Reference in New Issue
Block a user