Commit 87026280 authored by unknown's avatar unknown

Merge ltantony.dsl-verizon.net:/usr/home/antony/work/mysql-4.0

into ltantony.dsl-verizon.net:/usr/home/antony/work/bug3481


mysql-test/r/func_str.result:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
parents 4118e3fb 0d07fe42
...@@ -7,6 +7,7 @@ Miguel@light.local ...@@ -7,6 +7,7 @@ Miguel@light.local
Sinisa@sinisa.nasamreza.org Sinisa@sinisa.nasamreza.org
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
akishkin@work.mysql.com akishkin@work.mysql.com
antony@ltantony.dsl-verizon.net
arjen@bitbike.com arjen@bitbike.com
arjen@co3064164-a.bitbike.com arjen@co3064164-a.bitbike.com
arjen@fred.bitbike.com arjen@fred.bitbike.com
......
...@@ -63,7 +63,7 @@ CREATE TABLE t1 ( ...@@ -63,7 +63,7 @@ CREATE TABLE t1 (
AUFNR varchar(12) NOT NULL default '', AUFNR varchar(12) NOT NULL default '',
PLNFL varchar(6) NOT NULL default '', PLNFL varchar(6) NOT NULL default '',
VORNR varchar(4) NOT NULL default '', VORNR varchar(4) NOT NULL default '',
xstatus_vor smallint(5) unsigned NOT NULL default '0', xstatus_vor smallint(5) unsigned NOT NULL default '0'
); );
INSERT INTO t1 VALUES ('40004712','000001','0010',9); INSERT INTO t1 VALUES ('40004712','000001','0010',9);
INSERT INTO t1 VALUES ('40004712','000001','0020',0); INSERT INTO t1 VALUES ('40004712','000001','0020',0);
......
...@@ -222,3 +222,9 @@ create database `db1 `; ...@@ -222,3 +222,9 @@ create database `db1 `;
Incorrect database name 'db1 ' Incorrect database name 'db1 '
create table t1(`a ` int); create table t1(`a ` int);
Incorrect column name 'a ' Incorrect column name 'a '
create table t1 (a int,);
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
create table t1 (a int,,b int);
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1
create table t1 (,b int);
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1
...@@ -247,7 +247,7 @@ CREATE TABLE t1 ( ...@@ -247,7 +247,7 @@ CREATE TABLE t1 (
wid int(10) unsigned NOT NULL auto_increment, wid int(10) unsigned NOT NULL auto_increment,
data_podp date default NULL, data_podp date default NULL,
status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy', status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy',
PRIMARY KEY(wid), PRIMARY KEY(wid)
); );
INSERT INTO t1 VALUES (8,NULL,'real'); INSERT INTO t1 VALUES (8,NULL,'real');
INSERT INTO t1 VALUES (9,NULL,'nowy'); INSERT INTO t1 VALUES (9,NULL,'nowy');
......
...@@ -7,7 +7,7 @@ slave start; ...@@ -7,7 +7,7 @@ slave start;
drop table if exists t1,t2; drop table if exists t1,t2;
CREATE TABLE t1 ( CREATE TABLE t1 (
a int unsigned not null auto_increment primary key, a int unsigned not null auto_increment primary key,
b int unsigned, b int unsigned
) TYPE=MyISAM; ) TYPE=MyISAM;
CREATE TABLE t2 ( CREATE TABLE t2 (
a int unsigned not null auto_increment primary key, a int unsigned not null auto_increment primary key,
......
...@@ -71,8 +71,7 @@ CREATE TABLE t1 ( ...@@ -71,8 +71,7 @@ CREATE TABLE t1 (
AUFNR varchar(12) NOT NULL default '', AUFNR varchar(12) NOT NULL default '',
PLNFL varchar(6) NOT NULL default '', PLNFL varchar(6) NOT NULL default '',
VORNR varchar(4) NOT NULL default '', VORNR varchar(4) NOT NULL default '',
xstatus_vor smallint(5) unsigned NOT NULL default '0', xstatus_vor smallint(5) unsigned NOT NULL default '0'
); );
INSERT INTO t1 VALUES ('40004712','000001','0010',9); INSERT INTO t1 VALUES ('40004712','000001','0010',9);
......
...@@ -191,3 +191,15 @@ create table `t1 `(a int); ...@@ -191,3 +191,15 @@ create table `t1 `(a int);
create database `db1 `; create database `db1 `;
--error 1166; --error 1166;
create table t1(`a ` int); create table t1(`a ` int);
#
# Test for Bug #3481
# "Parser permits multiple commas without syntax error"
#
--error 1064
create table t1 (a int,);
--error 1064
create table t1 (a int,,b int);
--error 1064
create table t1 (,b int);
...@@ -133,7 +133,7 @@ CREATE TABLE t1 ( ...@@ -133,7 +133,7 @@ CREATE TABLE t1 (
wid int(10) unsigned NOT NULL auto_increment, wid int(10) unsigned NOT NULL auto_increment,
data_podp date default NULL, data_podp date default NULL,
status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy', status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy',
PRIMARY KEY(wid), PRIMARY KEY(wid)
); );
INSERT INTO t1 VALUES (8,NULL,'real'); INSERT INTO t1 VALUES (8,NULL,'real');
......
...@@ -3,7 +3,7 @@ drop table if exists t1,t2; ...@@ -3,7 +3,7 @@ drop table if exists t1,t2;
CREATE TABLE t1 ( CREATE TABLE t1 (
a int unsigned not null auto_increment primary key, a int unsigned not null auto_increment primary key,
b int unsigned, b int unsigned
) TYPE=MyISAM; ) TYPE=MyISAM;
CREATE TABLE t2 ( CREATE TABLE t2 (
......
...@@ -945,7 +945,7 @@ field_list_item: ...@@ -945,7 +945,7 @@ field_list_item:
; ;
column_def: column_def:
field_spec check_constraint field_spec opt_check_constraint
| field_spec references | field_spec references
{ {
Lex->col_list.empty(); /* Alloced by sql_alloc */ Lex->col_list.empty(); /* Alloced by sql_alloc */
...@@ -963,20 +963,31 @@ key_def: ...@@ -963,20 +963,31 @@ key_def:
{ {
Lex->col_list.empty(); /* Alloced by sql_alloc */ Lex->col_list.empty(); /* Alloced by sql_alloc */
} }
| constraint opt_check_constraint
{
Lex->col_list.empty(); /* Alloced by sql_alloc */
}
| opt_constraint check_constraint | opt_constraint check_constraint
{ {
Lex->col_list.empty(); /* Alloced by sql_alloc */ Lex->col_list.empty(); /* Alloced by sql_alloc */
} }
; ;
check_constraint: opt_check_constraint:
/* empty */ /* empty */
| CHECK_SYM expr | check_constraint
;
check_constraint:
CHECK_SYM expr
; ;
opt_constraint: opt_constraint:
/* empty */ /* empty */
| CONSTRAINT opt_ident; | constraint;
constraint:
CONSTRAINT opt_ident;
field_spec: field_spec:
field_ident field_ident
......
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