Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: http://svn.php.net/repository/pear/packages/SQL_Parser/trunk@263285 c90b9560-bf6c-de11-be94-00142212c4b1
- Loading branch information
Sebastian Mendel
committed
Jul 23, 2008
1 parent
d72c5dd
commit ca0ff4a
Showing
19 changed files
with
4,746 additions
and
3,000 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,74 @@ | ||
-- SQL PARSER TESTCASE | ||
CREATE TABLE albums ( | ||
name varchar(60), | ||
directory varchar(60), | ||
rating enum (1,2,3,4,5,6,7,8,9,10) NOT NULL, | ||
category set('sexy','\'family time\'',"outdoors",'generic','very weird') NULL, | ||
description text NULL, | ||
id int default 200 PRIMARY KEY | ||
name varchar(60), | ||
directory varchar(60), | ||
rating enum (1,2,3,4,5,6,7,8,9,10) NOT NULL, | ||
category set('sexy','\'family time\'',"outdoors",'generic','very weird') NULL, | ||
description text NULL, | ||
id int default 200 PRIMARY KEY | ||
); | ||
|
||
-- SQL PARSER TESTCASE | ||
CREATE TABLE photos ( | ||
filename varchar(60) not NULL, | ||
name varchar(60) default 'no name', | ||
album int, | ||
price float (4,2), | ||
description text default 'hello', | ||
id int default 0 primary key not null, | ||
filename varchar(60) not NULL, | ||
name varchar(60) default 'no name', | ||
album int, | ||
price float (4,2), | ||
description text default 'hello', | ||
id int default 0 primary key not null, | ||
); | ||
-- SQL PARSER TESTCASE | ||
create table brent ( | ||
filename varchar(10), | ||
description varchar(20), | ||
); | ||
-- SQL PARSER TESTCASE | ||
CREATE TABLE films ( | ||
code CHARACTER(5) CONSTRAINT firstkey PRIMARY KEY, | ||
title CHARACTER VARYING(40) NOT NULL, | ||
did DECIMAL(3) NOT NULL, | ||
date_prod DATE, | ||
kind CHAR(10), | ||
len INTERVAL HOUR TO MINUTE | ||
CONSTRAINT production UNIQUE(date_prod) | ||
code CHARACTER(5) CONSTRAINT firstkey PRIMARY KEY, | ||
title CHARACTER VARYING(40) NOT NULL, | ||
did DECIMAL(3) NOT NULL, | ||
date_prod DATE, | ||
kind CHAR(10), | ||
len INTERVAL HOUR TO MINUTE | ||
CONSTRAINT production UNIQUE(date_prod) | ||
); | ||
-- SQL PARSER TESTCASE | ||
CREATE TABLE films ( | ||
code CHARACTER(5) CONSTRAINT firstkey PRIMARY KEY, | ||
title CHARACTER VARYING(40) NOT NULL, | ||
did DECIMAL(3) NOT NULL, | ||
date_prod DATE, | ||
kind CHAR(10), | ||
len INTERVAL minute to hour | ||
CONSTRAINT production UNIQUE(date_prod) | ||
code CHARACTER(5) CONSTRAINT firstkey PRIMARY KEY, | ||
title CHARACTER VARYING(40) NOT NULL, | ||
did DECIMAL(3) NOT NULL, | ||
date_prod DATE, | ||
kind CHAR(10), | ||
len INTERVAL minute to hour | ||
CONSTRAINT production UNIQUE(date_prod) | ||
); | ||
-- SQL PARSER TESTCASE | ||
CREATE TABLE distributors ( | ||
did DECIMAL(3) PRIMARY KEY DEFAULT NEXTVAL('serial'), | ||
name VARCHAR(40) NOT NULL CHECK (name <> '') | ||
CONSTRAINT con1 CHECK (did > 100 AND name > '') | ||
did DECIMAL(3) PRIMARY KEY DEFAULT NEXTVAL('serial'), | ||
name VARCHAR(40) NOT NULL CHECK (name <> '') | ||
CONSTRAINT con1 CHECK (did > 100 AND name > '') | ||
); | ||
-- SQL PARSER TESTCASE | ||
CREATE TABLE distributors ( | ||
did DECIMAL(3) PRIMARY KEY, | ||
name VARCHAR(40) | ||
did DECIMAL(3) PRIMARY KEY, | ||
name VARCHAR(40) | ||
); | ||
|
||
-- SQL PARSER TESTCASE | ||
CREATE TABLE msgs ( user_id integer, msg_id integer, msg_text varchar, msg_title varchar(30), msg_date time); | ||
|
||
-- SQL PARSER TESTCASE | ||
-- SQL_PARSER_FLAG_FAIL | ||
create table nodefinitions; | ||
|
||
-- SQL PARSER TESTCASE | ||
-- SQL_PARSER_FLAG_FAIL | ||
create dogfood; | ||
|
||
-- SQL PARSER TESTCASE | ||
-- SQL_PARSER_FLAG_FAIL | ||
create table dunce (name varchar; | ||
|
||
-- SQL PARSER TESTCASE | ||
-- SQL_PARSER_FLAG_FAIL | ||
create table dunce (name varchar(2,3)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
-- SQL PARSER TESTCASE | ||
delete from dog where cat = 4 and horse <> "dead meat" or mouse = 'furry'; | ||
|
||
-- SQL PARSER TESTCASE | ||
-- SQL_PARSER_FLAG_FAIL | ||
delete from; | ||
|
||
-- SQL PARSER TESTCASE | ||
delete from cat; | ||
|
||
-- SQL PARSER TESTCASE | ||
-- SQL_PARSER_FLAG_FAIL | ||
delete from where cat = 53; | ||
|
||
-- SQL PARSER TESTCASE | ||
-- SQL_PARSER_FLAG_FAIL | ||
delete from dog where mouse is happy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,21 @@ | ||
-- SQL PARSER TESTCASE | ||
drop table dishes cascade; | ||
|
||
-- SQL PARSER TESTCASE | ||
drop table bondage restrict; | ||
|
||
-- SQL PARSER TESTCASE | ||
-- SQL_PARSER_FLAG_FAIL | ||
drop table bondage, dishes; | ||
|
||
-- SQL PARSER TESTCASE | ||
-- SQL_PARSER_FLAG_FAIL | ||
drop table play cascade restrict; | ||
|
||
-- SQL PARSER TESTCASE | ||
-- SQL_PARSER_FLAG_FAIL | ||
drop table cat where mouse = floor; | ||
|
||
-- SQL PARSER TESTCASE | ||
-- SQL_PARSER_FLAG_FAIL | ||
drop elephant; |
Oops, something went wrong.