summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonty@mysql.com <>2005-02-03 18:00:50 +0200
committermonty@mysql.com <>2005-02-03 18:00:50 +0200
commitb233ddba8ef89e0cb30c0f4358ae9e692945d0b2 (patch)
tree14992c6e4d00d432cd54fe1e99b8dd5ebba5a8b4
parent43eb7cf303d60f11ec9f8430eaf46efd50bd5aa2 (diff)
downloadmariadb-git-b233ddba8ef89e0cb30c0f4358ae9e692945d0b2.tar.gz
After merge fixes
-rw-r--r--mysql-test/r/derived.result10
-rw-r--r--mysql-test/r/func_str.result6
-rw-r--r--sql/item.cc2
-rw-r--r--sql/sql_show.cc31
4 files changed, 22 insertions, 27 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 8322933a360..071cb673501 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -330,11 +330,6 @@ SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MA
min max avg
10.00 10.00 10
DROP TABLE t1;
-CREATE TABLE t1 (a char(10), b char(10));
-INSERT INTO t1 VALUES ('root','localhost'), ('root','%');
-SELECT * FROM (SELECT (SELECT a.a FROM t1 AS a WHERE a.a = b.a) FROM t1 AS b) AS c;
-ERROR 21000: Subquery returns more than 1 row
-DROP TABLE t1;
create table t1 (a integer, b integer);
insert into t1 values (1,4), (2,2),(2,2), (4,1),(4,1),(4,1),(4,1);
select distinct sum(b) from t1 group by a;
@@ -344,3 +339,8 @@ select distinct sum(b) from (select a,b from t1) y group by a;
sum(b)
4
drop table t1;
+CREATE TABLE t1 (a char(10), b char(10));
+INSERT INTO t1 VALUES ('root','localhost'), ('root','%');
+SELECT * FROM (SELECT (SELECT a.a FROM t1 AS a WHERE a.a = b.a) FROM t1 AS b) AS c;
+ERROR 21000: Subquery returns more than 1 row
+DROP TABLE t1;
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index cb07ae0c173..71a1a7539b0 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -707,12 +707,6 @@ select count(*) as total, left(c,10) as reg from t1 group by reg order by reg de
total reg
10 2004-12-10
drop table t1;
-select quote(ltrim(concat(' ', 'a')));
-quote(ltrim(concat(' ', 'a')))
-'a'
-select quote(trim(concat(' ', 'a')));
-quote(trim(concat(' ', 'a')))
-'a'
select trim(null from 'kate') as "must_be_null";
must_be_null
NULL
diff --git a/sql/item.cc b/sql/item.cc
index 76d802e972f..08de3889ae6 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1775,7 +1775,7 @@ resolve_ref_in_select_and_group(THD *thd, Item_ident *ref, SELECT_LEX *select)
if (select_ref != not_found_item && !ambiguous_fields)
{
DBUG_ASSERT(*select_ref);
- if (!last->ref_pointer_array[counter])
+ if (!select->ref_pointer_array[counter])
{
my_error(ER_ILLEGAL_REFERENCE, MYF(0),
ref->name, "forward reference in item list");
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index e9126871045..9c544142b14 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1786,7 +1786,9 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
enum enum_schema_tables schema_table_idx;
thr_lock_type lock_type;
List<char> bases;
+ List_iterator_fast<char> it(bases);
COND *partial_cond;
+ int error= 1;
DBUG_ENTER("get_all_tables");
LINT_INIT(end);
@@ -1803,13 +1805,11 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
if (schema_table->process_table(thd, show_table_list,
table, res, show_table_list->db,
show_table_list->alias))
- {
- DBUG_RETURN(1);
- }
+ goto err;
close_thread_tables(thd, 0, 0, old_open_tables);
show_table_list->table= 0;
- lex->all_selects_list= select_lex;
- DBUG_RETURN(0);
+ error= 0;
+ goto err;
}
lex->all_selects_list= &sel;
@@ -1822,14 +1822,14 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
/* information schema name always is first in list */
if (schema_db_add(thd, &bases, idx_field_vals.db_value, &with_i_schema))
- return 1;
+ goto err;
if (mysql_find_files(thd, &bases, NullS, mysql_data_home,
idx_field_vals.db_value, 1))
- return 1;
+ goto err;
- List_iterator_fast<char> it(bases);
partial_cond= make_cond_for_info_schema(cond, tables);
+ it.rewind(); /* To get access to new elements in basis list */
while ((base_name= it++) ||
/*
generate error for non existing database.
@@ -1851,7 +1851,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
if (with_i_schema) // information schema table names
{
if (schema_tables_add(thd, &files, idx_field_vals.table_value))
- DBUG_RETURN(1);
+ goto err;
}
else
{
@@ -1860,7 +1860,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
len= FN_LEN - len;
if (mysql_find_files(thd, &files, base_name,
path, idx_field_vals.table_value, 0))
- DBUG_RETURN(1);
+ goto err;
}
List_iterator_fast<char> it_files(files);
@@ -1906,16 +1906,14 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
int res;
TABLE *old_open_tables= thd->open_tables;
if (make_table_list(thd, &sel, base_name, file_name))
- DBUG_RETURN(1);
+ goto err;
TABLE_LIST *show_table_list= (TABLE_LIST*) sel.table_list.first;
show_table_list->lock_type= lock_type;
res= open_and_lock_tables(thd, show_table_list);
if (schema_table->process_table(thd, show_table_list, table,
res, base_name,
show_table_list->alias))
- {
- DBUG_RETURN(1);
- }
+ goto err;
close_thread_tables(thd, 0, 0, old_open_tables);
}
}
@@ -1927,8 +1925,11 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
with_i_schema= 0;
}
}
+
+ error= 0;
+err:
lex->all_selects_list= select_lex;
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
}