From c04fd7b17796a2abdc09288c52288636ac10b45f Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Sat, 17 Jan 2004 13:00:46 +0200 Subject: [PATCH] switched to new syntax (TYPE->ENGINE) check of memory allocation operation was added --- mysql-test/r/subselect_innodb.result | 4 ++-- mysql-test/t/subselect_innodb.test | 4 ++-- sql/sql_select.cc | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index 3a2a36475c5..e3528e06546 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -69,7 +69,7 @@ b int(11) default NULL, c char(3) default NULL, PRIMARY KEY (id), KEY t2i1 (b) -) TYPE=innodb DEFAULT CHARSET=latin1; +) ENGINE=innodb DEFAULT CHARSET=latin1; INSERT INTO t1 VALUES (0,0,'GPL'),(1,0,'GPL'),(2,1,'GPL'),(3,2,'GPL'); CREATE TABLE t2 ( id int(11) NOT NULL default '0', @@ -77,7 +77,7 @@ b int(11) default NULL, c char(3) default NULL, PRIMARY KEY (id), KEY t2i (b) -) TYPE=innodb DEFAULT CHARSET=latin1; +) ENGINE=innodb DEFAULT CHARSET=latin1; INSERT INTO t2 VALUES (0,0,'GPL'),(1,0,'GPL'),(2,1,'GPL'),(3,2,'GPL'); select (select max(id) from t2 where b=1 group by b) as x,b from t1 where b=1; x b diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index c17f3f30e39..affa6301db4 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -78,7 +78,7 @@ CREATE TABLE t1 ( c char(3) default NULL, PRIMARY KEY (id), KEY t2i1 (b) -) TYPE=innodb DEFAULT CHARSET=latin1; +) ENGINE=innodb DEFAULT CHARSET=latin1; INSERT INTO t1 VALUES (0,0,'GPL'),(1,0,'GPL'),(2,1,'GPL'),(3,2,'GPL'); CREATE TABLE t2 ( id int(11) NOT NULL default '0', @@ -86,7 +86,7 @@ CREATE TABLE t2 ( c char(3) default NULL, PRIMARY KEY (id), KEY t2i (b) -) TYPE=innodb DEFAULT CHARSET=latin1; +) ENGINE=innodb DEFAULT CHARSET=latin1; INSERT INTO t2 VALUES (0,0,'GPL'),(1,0,'GPL'),(2,1,'GPL'),(3,2,'GPL'); select (select max(id) from t2 where b=1 group by b) as x,b from t1 where b=1; drop table t1,t2; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 1b03a70c43d..3f9492f1d72 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1586,7 +1586,8 @@ mysql_select(THD *thd, Item ***rref_pointer_array, } else { - join= new JOIN(thd, fields, select_options, result); + if (!(join= new JOIN(thd, fields, select_options, result))) + DBUG_RETURN(-1); thd->proc_info="init"; thd->used_tables=0; // Updated by setup_fields if (join->prepare(rref_pointer_array, tables, wild_num,