Commit bb3a5f85 authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

Merge abarkov@work.mysql.com:/home/bk/mysql-4.1

into bar.mysql.r18.ru:/usr/home/bar/mysql-4.1.wrk
parents 6b1fe32a e3d78f0b
...@@ -9,23 +9,23 @@ set autocommit=0; ...@@ -9,23 +9,23 @@ set autocommit=0;
update t2 set x = 1 where id = 0; update t2 set x = 1 where id = 0;
select x from t1 where id = 0; select x from t1 where id = 0;
select x from t2 where id = 0; select x from t2 where id = 0;
commit;
Deadlock found when trying to get lock; Try restarting transaction Deadlock found when trying to get lock; Try restarting transaction
commit; commit;
x x
1 1
commit;
select * from t1; select * from t1;
id x
0 1
select * from t2; select * from t2;
id x id x
0 1 0 1
commit; commit;
select * from t1;
id x id x
0 1 0 1
select * from t1;
select * from t2; select * from t2;
id x id x
0 1 0 1
commit; commit;
id x
0 1
drop table t1,t2; drop table t1,t2;
...@@ -236,6 +236,9 @@ CREATE TABLE `searchconthardwarefr7` ( ...@@ -236,6 +236,9 @@ CREATE TABLE `searchconthardwarefr7` (
PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`) PRIMARY KEY (`mot`,`pseudo`,`date`,`topic`)
) TYPE=MyISAM ROW_FORMAT=DYNAMIC; ) TYPE=MyISAM ROW_FORMAT=DYNAMIC;
INSERT INTO searchconthardwarefr7 (mot,topic,date,pseudo) VALUES ('joce','40143','2002-10-22','joce'), ('joce','43506','2002-10-22','joce'); INSERT INTO searchconthardwarefr7 (mot,topic,date,pseudo) VALUES ('joce','40143','2002-10-22','joce'), ('joce','43506','2002-10-22','joce');
select numeropost as a FROM forumconthardwarefr7 GROUP BY (SELECT 1 FROM forumconthardwarefr7 HAVING a=1);
a
40143
SELECT numeropost,maxnumrep FROM forumconthardwarefr7 WHERE exists (SELECT 1 FROM searchconthardwarefr7 WHERE (mot='joce') AND date >= '2002-10-21' AND forumconthardwarefr7.numeropost = searchconthardwarefr7.topic) ORDER BY maxnumrep DESC LIMIT 0, 20; SELECT numeropost,maxnumrep FROM forumconthardwarefr7 WHERE exists (SELECT 1 FROM searchconthardwarefr7 WHERE (mot='joce') AND date >= '2002-10-21' AND forumconthardwarefr7.numeropost = searchconthardwarefr7.topic) ORDER BY maxnumrep DESC LIMIT 0, 20;
numeropost maxnumrep numeropost maxnumrep
43506 2 43506 2
...@@ -243,3 +246,14 @@ numeropost maxnumrep ...@@ -243,3 +246,14 @@ numeropost maxnumrep
SELECT (SELECT 1) as a FROM (SELECT 1 FROM forumconthardwarefr7 HAVING a=1); SELECT (SELECT 1) as a FROM (SELECT 1 FROM forumconthardwarefr7 HAVING a=1);
Unknown column 'a' in 'having clause' Unknown column 'a' in 'having clause'
drop table forumconthardwarefr7, searchconthardwarefr7; drop table forumconthardwarefr7, searchconthardwarefr7;
drop table if exists forumconthardwarefr7;
CREATE TABLE `forumconthardwarefr7` (
`numeropost` mediumint(8) unsigned NOT NULL auto_increment,
`maxnumrep` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`numeropost`),
UNIQUE KEY `maxnumrep` (`maxnumrep`)
) TYPE=MyISAM ROW_FORMAT=FIXED;
INSERT INTO forumconthardwarefr7 (numeropost,maxnumrep) VALUES (1,0),(2,1);
select numeropost as a FROM forumconthardwarefr7 GROUP BY (SELECT 1 FROM forumconthardwarefr7 HAVING a=1);
Subselect returns more than 1 record
drop table if exists forumconthardwarefr7;
...@@ -35,9 +35,11 @@ select x from t2 where id = 0; ...@@ -35,9 +35,11 @@ select x from t2 where id = 0;
connection con2; connection con2;
--error 1213 --error 1213
reap;
commit; commit;
connection con1; connection con1;
reap;
commit; commit;
connection con2; connection con2;
......
...@@ -135,9 +135,21 @@ CREATE TABLE `searchconthardwarefr7` ( ...@@ -135,9 +135,21 @@ CREATE TABLE `searchconthardwarefr7` (
) TYPE=MyISAM ROW_FORMAT=DYNAMIC; ) TYPE=MyISAM ROW_FORMAT=DYNAMIC;
INSERT INTO searchconthardwarefr7 (mot,topic,date,pseudo) VALUES ('joce','40143','2002-10-22','joce'), ('joce','43506','2002-10-22','joce'); INSERT INTO searchconthardwarefr7 (mot,topic,date,pseudo) VALUES ('joce','40143','2002-10-22','joce'), ('joce','43506','2002-10-22','joce');
select numeropost as a FROM forumconthardwarefr7 GROUP BY (SELECT 1 FROM forumconthardwarefr7 HAVING a=1);
SELECT numeropost,maxnumrep FROM forumconthardwarefr7 WHERE exists (SELECT 1 FROM searchconthardwarefr7 WHERE (mot='joce') AND date >= '2002-10-21' AND forumconthardwarefr7.numeropost = searchconthardwarefr7.topic) ORDER BY maxnumrep DESC LIMIT 0, 20; SELECT numeropost,maxnumrep FROM forumconthardwarefr7 WHERE exists (SELECT 1 FROM searchconthardwarefr7 WHERE (mot='joce') AND date >= '2002-10-21' AND forumconthardwarefr7.numeropost = searchconthardwarefr7.topic) ORDER BY maxnumrep DESC LIMIT 0, 20;
-- error 1054 -- error 1054
SELECT (SELECT 1) as a FROM (SELECT 1 FROM forumconthardwarefr7 HAVING a=1); SELECT (SELECT 1) as a FROM (SELECT 1 FROM forumconthardwarefr7 HAVING a=1);
drop table forumconthardwarefr7, searchconthardwarefr7;
drop table forumconthardwarefr7, searchconthardwarefr7; drop table if exists forumconthardwarefr7;
\ No newline at end of file CREATE TABLE `forumconthardwarefr7` (
`numeropost` mediumint(8) unsigned NOT NULL auto_increment,
`maxnumrep` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`numeropost`),
UNIQUE KEY `maxnumrep` (`maxnumrep`)
) TYPE=MyISAM ROW_FORMAT=FIXED;
INSERT INTO forumconthardwarefr7 (numeropost,maxnumrep) VALUES (1,0),(2,1);
-- error 1240
select numeropost as a FROM forumconthardwarefr7 GROUP BY (SELECT 1 FROM forumconthardwarefr7 HAVING a=1);
drop table if exists forumconthardwarefr7;
\ No newline at end of file
...@@ -33,7 +33,7 @@ SUBSELECT TODO: ...@@ -33,7 +33,7 @@ SUBSELECT TODO:
#include "sql_select.h" #include "sql_select.h"
Item_subselect::Item_subselect(): Item_subselect::Item_subselect():
Item(), engine_owner(1), value_assigned(0) Item_result_field(), engine_owner(1), value_assigned(0)
{ {
assign_null(); assign_null();
/* /*
......
...@@ -28,7 +28,7 @@ class subselect_engine; ...@@ -28,7 +28,7 @@ class subselect_engine;
/* base class for subselects */ /* base class for subselects */
class Item_subselect :public Item class Item_subselect :public Item_result_field
{ {
my_bool engine_owner; /* Is this item owner of engine */ my_bool engine_owner; /* Is this item owner of engine */
my_bool value_assigned; /* value already assigned to subselect */ my_bool value_assigned; /* value already assigned to subselect */
...@@ -116,6 +116,7 @@ class Item_singleval_subselect :public Item_subselect ...@@ -116,6 +116,7 @@ class Item_singleval_subselect :public Item_subselect
Item *new_item() { return new Item_singleval_subselect(this); } Item *new_item() { return new Item_singleval_subselect(this); }
enum Item_result result_type() const { return res_type; } enum Item_result result_type() const { return res_type; }
void fix_length_and_dec(); void fix_length_and_dec();
friend class select_singleval_subselect; friend class select_singleval_subselect;
}; };
......
...@@ -4528,7 +4528,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) ...@@ -4528,7 +4528,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
if (error == -1) if (error == -1)
table->file->print_error(my_errno,MYF(0)); table->file->print_error(my_errno,MYF(0));
} }
DBUG_RETURN(error); DBUG_RETURN(error || join->thd->net.report_error);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment