1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Backport of Bug#53236 Segfault in DTCollation::set(DTCollation&)

Don't call member functions for a NIL pointer.


mysql-test/r/subselect4.result:
  Add test case.
mysql-test/t/subselect4.test:
  Add test case.
sql/sql_select.cc:
  If the (virtual) member function clone_item() returns NULL,
  there is no substitution to be made, and we don't need to set the collation.
  The test was invoking Item_cache::clone_item()
This commit is contained in:
Tor Didriksen
2010-06-23 08:13:34 +02:00
parent ef4c0f68d1
commit ec537a1ad1
3 changed files with 56 additions and 4 deletions

View File

@ -62,3 +62,32 @@ FROM t3 WHERE 1 = 0 GROUP BY 1;
DROP TABLE t1,t2,t3;
--echo End of 5.0 tests.
--echo #
--echo # Bug#53236 Segfault in DTCollation::set(DTCollation&)
--echo #
CREATE TABLE t1 (
pk INTEGER AUTO_INCREMENT,
col_varchar VARCHAR(1),
PRIMARY KEY (pk)
)
;
INSERT INTO t1 (col_varchar)
VALUES
('w'),
('m')
;
SELECT table1.pk
FROM ( t1 AS table1 JOIN t1 AS table2 ON (table1.col_varchar =
table2.col_varchar) )
WHERE ( 1, 2 ) IN ( SELECT SUBQUERY1_t1.pk AS SUBQUERY1_field1,
SUBQUERY1_t1.pk AS SUBQUERY1_field2
FROM ( t1 AS SUBQUERY1_t1 JOIN t1 AS SUBQUERY1_t2
ON (SUBQUERY1_t2.col_varchar =
SUBQUERY1_t1.col_varchar) ) )
;
drop table t1;