diff options
author | unknown <bell@sanja.is.com.ua> | 2004-11-30 21:41:12 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-11-30 21:41:12 +0200 |
commit | a49025d2c86adefcb61517ff75434479b75b8d02 (patch) | |
tree | 35c1ff6c8cdf8dfb42fcc80193de22685fca23ba /mysql-test/t/subselect_innodb.test | |
parent | dcd6e3d070abf96d9d2bf69bd42ff668059e8e83 (diff) | |
download | mariadb-git-a49025d2c86adefcb61517ff75434479b75b8d02.tar.gz |
now we create temporary join for all queries with subqueries to make correct cleunup of tables and avoid too early unlock (BUG#6841)
mysql-test/t/subselect_innodb.test:
possible early unlock
sql/sql_lex.cc:
subqueries presence flag
sql/sql_lex.h:
subqueries presence flag
sql/sql_parse.cc:
subqueries presence flag
sql/sql_select.cc:
removed some too optimistic optimisation, now we create temporary join for all queries with subqueries to make correct cleunup of tables and avoid too early unlock
Diffstat (limited to 'mysql-test/t/subselect_innodb.test')
-rw-r--r-- | mysql-test/t/subselect_innodb.test | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 5f4badb3624..54c56e640dc 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -125,3 +125,12 @@ INSERT INTO `t2` VALUES ('yy','xx'); SELECT R.unit, R.ingredient FROM t1 R WHERE R.ingredient IN (SELECT N.ingredient FROM t2 N WHERE N.unit = R.unit); drop table t1, t2; + +# +# possible early unlock +# +CREATE TABLE t1 ( id INT NOT NULL auto_increment, date1 DATE, coworkerid INT, description VARCHAR(255), sum_used DOUBLE, sum_remaining DOUBLE, comments VARCHAR(255), PRIMARY KEY(id)) engine=innodb; +insert into t1 values (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'); +SELECT DISTINCT (SELECT sum(sum_used) FROM t1 WHERE sum_used > 0 AND year(date1) <= '2004') as somallontvangsten, (SELECT sum(sum_used) FROM t1 WHERE sum_used < 0 AND year(date1) <= '2004') as somalluitgaven FROM t1; +select * from t1; +drop table t1; |