summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpem@mysql.com <>2002-10-12 11:07:54 +0200
committerpem@mysql.com <>2002-10-12 11:07:54 +0200
commit8bd61c3fce74238b8459359a8c9ec588af1b7dc1 (patch)
tree5641e008c029695fb907d1fb0ebc457d1fe957e8
parent3805a5edfeee171a5dd1945f4f44ea67a00fdb29 (diff)
downloadmariadb-git-8bd61c3fce74238b8459359a8c9ec588af1b7dc1.tar.gz
Task 430: Allowing braces in joins by simply removing them.
This is a simple fix, allowing a join_table_list in the right reduction of a normal_join sequence, instead of just a join_table. This makes things like "t1, (t2 left join t3)" work, but it also allows "join" and "cross join" instead of ",". This should fix the bug reported as: Subject: ODBC SQL syntax issue From: Ivan Vazharov Date: Mon, 30 Sep 2002 12:02:42 +0200
-rw-r--r--BitKeeper/etc/logging_ok1
-rw-r--r--mysql-test/r/select.result27
-rw-r--r--mysql-test/t/select.test13
-rw-r--r--sql/sql_yacc.yy5
4 files changed, 45 insertions, 1 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index 55c64144268..000e7588370 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -85,3 +85,4 @@ zgreant@mysql.com
tfr@beta.frontier86.ee
Administrador@light.
mwagner@work.mysql.com
+pem@mysql.com
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 88220b75591..f0e19788ab3 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -3266,3 +3266,30 @@ select wss_type from t1 where wss_type =102935229216544093;
wss_type
102935229216544093
drop table t1;
+create table t1 (a int not null auto_increment primary key);
+insert into t1 values ();
+insert into t1 values ();
+insert into t1 values ();
+select * from (t1 as t2 left join t1 as t3 using (a)), t1;
+a a a
+1 1 1
+2 2 1
+3 3 1
+1 1 2
+2 2 2
+3 3 2
+1 1 3
+2 2 3
+3 3 3
+select * from t1, (t1 as t2 left join t1 as t3 using (a));
+a a a
+1 1 1
+2 1 1
+3 1 1
+1 2 2
+2 2 2
+3 2 2
+1 3 3
+2 3 3
+3 3 3
+drop table t1;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 94806d44e37..96aed166672 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1751,3 +1751,16 @@ select wss_type from t1 where wss_type ='102935229216544104';
select wss_type from t1 where wss_type ='102935229216544093';
select wss_type from t1 where wss_type =102935229216544093;
drop table t1;
+
+#
+# Test of removing redundant braces in the FROM part
+# (The second case used to cause a syntax error)
+#
+
+create table t1 (a int not null auto_increment primary key);
+insert into t1 values ();
+insert into t1 values ();
+insert into t1 values ();
+select * from (t1 as t2 left join t1 as t3 using (a)), t1;
+select * from t1, (t1 as t2 left join t1 as t3 using (a));
+drop table t1;
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index c0b804df17e..f9a24a31eac 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -2026,7 +2026,7 @@ opt_pad:
join_table_list:
'(' join_table_list ')' { $$=$2; }
| join_table { $$=$1; }
- | join_table_list normal_join join_table { $$=$3; }
+ | join_table_list normal_join join_table_list { $$=$3; }
| join_table_list STRAIGHT_JOIN join_table { $$=$3 ; $$->straight=1; }
| join_table_list INNER_SYM JOIN_SYM join_table ON expr
{ add_join_on($4,$6); $$=$4; }
@@ -3307,6 +3307,7 @@ option_value:
{
Lex->var_list.push_back(new set_var_password($3,$5));
}
+ ;
internal_variable_name:
ident
@@ -3316,6 +3317,7 @@ internal_variable_name:
YYABORT;
$$=tmp;
}
+ ;
isolation_types:
READ_SYM UNCOMMITTED_SYM { $$= ISO_READ_UNCOMMITTED; }
@@ -3674,6 +3676,7 @@ require_clause: /* empty */
{
Lex->ssl_type=SSL_TYPE_NONE;
}
+ ;
grant_options:
/* empty */ {}