diff options
Diffstat (limited to 'db-4.8.30/test/scr038')
57 files changed, 565 insertions, 0 deletions
diff --git a/db-4.8.30/test/scr038/chk.bdb b/db-4.8.30/test/scr038/chk.bdb new file mode 100644 index 0000000..73007cd --- /dev/null +++ b/db-4.8.30/test/scr038/chk.bdb @@ -0,0 +1,10 @@ +#!/bin/sh + +BDB_DIR="../../build_unix" +rm -rf ./numismatics + +$BDB_DIR/db_sql -i data/all_data_types.sql -o sample.c -v sample_verify.c +cc -g -I$BDB_DIR -L$BDB_DIR/.libs -o sample sample.c sample_verify.c $BDB_DIR/libdb.a -lpthread +mkdir numismatics +LD_LIBRARY_PATH=$BDB_DIR/.libs ./sample + diff --git a/db-4.8.30/test/scr038/data/17925.sql b/db-4.8.30/test/scr038/data/17925.sql new file mode 100644 index 0000000..d76949d --- /dev/null +++ b/db-4.8.30/test/scr038/data/17925.sql @@ -0,0 +1,47 @@ +CREATE DATABASE numismatics; + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR2(20), + value NUMERIC(8,2), + mintage_year INT(8), + mint_id INT(8), + CONSTRAINT mint_id_fk FOREIGN KEY(mint_id) + REFERENCES mint(mid)); + +CREATE INDEX unit_index ON coin(unit); + +CREATE TABLE mint (mid INT(8) PRIMARY KEY, + country VARCHAR2(20), + city VARCHAR2(20)); + +CREATE INDEX mid_index ON mint(mid); + +CREATE TABLE random (rid VARCHAR2(20) PRIMARY KEY, + chunk bin(127)); + +CREATE TABLE table1 (att_int INT(8) PRIMARY KEY, + att_char CHAR(20), + att_varchar VARCHAR(20), + att_bit BIT, + att_tinyint TINYINT, + att_smallint SMALLINT(2), + att_integer INTEGER(4), + att_bigint BIGINT, + att_real REAL, + att_double DOUBLE, + att_float FLOAT, + att_decimal DECIMAL, + att_numeric NUMERIC, + att_bin bin(5)); + +CREATE TABLE table2(att_int INT(8) PRIMARY KEY); + +CREATE TABLE table3(att_char CHAR(20) PRIMARY KEY); + +CREATE TABLE table4(att_bin bin(10) PRIMARY KEY); + +CREATE TABLE table5(att_bin bin(10) PRIMARY KEY, + att_bit BIT); + +CREATE TABLE table6(att_bin bin(10), + att_bit BIT PRIMARY KEY); diff --git a/db-4.8.30/test/scr038/data/all_data_types.sql b/db-4.8.30/test/scr038/data/all_data_types.sql new file mode 100644 index 0000000..0e8584e --- /dev/null +++ b/db-4.8.30/test/scr038/data/all_data_types.sql @@ -0,0 +1,17 @@ + +CREATE DATABASE numismatics; + +CREATE TABLE table1 (att_int INT(8) PRIMARY KEY, + att_char CHAR(20), + att_varchar VARCHAR(20), + att_bit BIT, + att_tinyint TINYINT, + att_smallint SMALLINT(2), + att_integer INTEGER(4), + att_bigint BIGINT, + att_real REAL, + att_double DOUBLE, + att_float FLOAT, + att_decimal DECIMAL, + att_numeric NUMERIC, + att_bin bin(5)); diff --git a/db-4.8.30/test/scr038/data/bigint_table.sql b/db-4.8.30/test/scr038/data/bigint_table.sql new file mode 100644 index 0000000..5488cf3 --- /dev/null +++ b/db-4.8.30/test/scr038/data/bigint_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_bigint BIGINT PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/bin_table.sql b/db-4.8.30/test/scr038/data/bin_table.sql new file mode 100644 index 0000000..9f44fc4 --- /dev/null +++ b/db-4.8.30/test/scr038/data/bin_table.sql @@ -0,0 +1,3 @@ +CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_bin bin(10) PRIMARY KEY);
diff --git a/db-4.8.30/test/scr038/data/bit_table.sql b/db-4.8.30/test/scr038/data/bit_table.sql new file mode 100644 index 0000000..68b5d14 --- /dev/null +++ b/db-4.8.30/test/scr038/data/bit_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_bit BIT PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/btree_table.sql b/db-4.8.30/test/scr038/data/btree_table.sql new file mode 100644 index 0000000..17354e0 --- /dev/null +++ b/db-4.8.30/test/scr038/data/btree_table.sql @@ -0,0 +1,6 @@ +CREATE DATABASE numismatics;
+
+CREATE TABLE mint (mid INT(8)PRIMARY KEY,
+ country VARCHAR(20),
+ city VARCHAR(20)); --+ DBTYPE = BTREE
+
diff --git a/db-4.8.30/test/scr038/data/cachesize.sql b/db-4.8.30/test/scr038/data/cachesize.sql new file mode 100644 index 0000000..b578b08 --- /dev/null +++ b/db-4.8.30/test/scr038/data/cachesize.sql @@ -0,0 +1,4 @@ +CREATE DATABASE numismatics; /*+ CACHESIZE = 16m */
+
+CREATE TABLE coin (cid INT(8) PRIMARY KEY,
+ unit VARCHAR(20));
diff --git a/db-4.8.30/test/scr038/data/char_length.sql b/db-4.8.30/test/scr038/data/char_length.sql new file mode 100644 index 0000000..45f8e68 --- /dev/null +++ b/db-4.8.30/test/scr038/data/char_length.sql @@ -0,0 +1,5 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_int INT(8) PRIMARY KEY,
+ att_char CHAR(2));
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/char_table.sql b/db-4.8.30/test/scr038/data/char_table.sql new file mode 100644 index 0000000..1db937e --- /dev/null +++ b/db-4.8.30/test/scr038/data/char_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_char CHAR(20) PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/column_name_conflict_with_table.sql b/db-4.8.30/test/scr038/data/column_name_conflict_with_table.sql new file mode 100644 index 0000000..aa9d21f --- /dev/null +++ b/db-4.8.30/test/scr038/data/column_name_conflict_with_table.sql @@ -0,0 +1,4 @@ +CREATE DATABASE numismatics;
+
+CREATE TABLE coin (coin INT(8) PRIMARY KEY,
+ unit VARCHAR(20));
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/commented_dml.sql b/db-4.8.30/test/scr038/data/commented_dml.sql new file mode 100644 index 0000000..4fc7c94 --- /dev/null +++ b/db-4.8.30/test/scr038/data/commented_dml.sql @@ -0,0 +1,6 @@ +CREATE DATABASE numismatics; /*+ CACHESIZE = 16m */ + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20)); + +/* SELECT * from mint;*/ diff --git a/db-4.8.30/test/scr038/data/comments_at_the_end.sql b/db-4.8.30/test/scr038/data/comments_at_the_end.sql new file mode 100644 index 0000000..8ae5387 --- /dev/null +++ b/db-4.8.30/test/scr038/data/comments_at_the_end.sql @@ -0,0 +1,6 @@ +CREATE DATABASE numismatics; /*+ CACHESIZE = 16m */ + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20)); + +/* This is the end of sql. */ diff --git a/db-4.8.30/test/scr038/data/constraints_name_conflict_with_column.sql b/db-4.8.30/test/scr038/data/constraints_name_conflict_with_column.sql new file mode 100644 index 0000000..5f2a4a6 --- /dev/null +++ b/db-4.8.30/test/scr038/data/constraints_name_conflict_with_column.sql @@ -0,0 +1,13 @@ +CREATE DATABASE numismatics;
+CREATE TABLE coin (cid INT(8) PRIMARY KEY,
+ unit VARCHAR(20),
+ value NUMERIC(8,2),
+ mintage_year INT(8),
+ mint_id INT(8),
+ CONSTRAINT unit FOREIGN KEY(mint_id)
+ REFERENCES mint(mid));
+
+CREATE TABLE mint (mid INT(8)PRIMARY KEY,
+ country VARCHAR(20),
+ city VARCHAR(20));
+
diff --git a/db-4.8.30/test/scr038/data/constraints_on_nonexistent_column.sql b/db-4.8.30/test/scr038/data/constraints_on_nonexistent_column.sql new file mode 100644 index 0000000..c7a5483 --- /dev/null +++ b/db-4.8.30/test/scr038/data/constraints_on_nonexistent_column.sql @@ -0,0 +1,14 @@ +CREATE DATABASE numismatics;
+CREATE TABLE coin (cid INT(8) PRIMARY KEY,
+ unit VARCHAR(20),
+ value NUMERIC(8,2),
+ mintage_year INT(8),
+ mint_id INT(8),
+ CONSTRAINT mint_id_fk FOREIGN KEY(mint_id)
+ REFERENCES mint(mmid));
+
+CREATE TABLE mint (mid INT(8) PRIMARY KEY,
+ country VARCHAR(20),
+ city VARCHAR(20));
+
+
diff --git a/db-4.8.30/test/scr038/data/constraints_on_nonexistent_table.sql b/db-4.8.30/test/scr038/data/constraints_on_nonexistent_table.sql new file mode 100644 index 0000000..1147df6 --- /dev/null +++ b/db-4.8.30/test/scr038/data/constraints_on_nonexistent_table.sql @@ -0,0 +1,9 @@ +CREATE DATABASE numismatics;
+CREATE TABLE coin (cid INT(8) PRIMARY KEY,
+ unit VARCHAR(20),
+ value NUMERIC(8,2),
+ mintage_year INT(8),
+ mint_id INT(8),
+ CONSTRAINT mint_id_fk FOREIGN KEY(mint_id)
+ REFERENCES mint(mid));
+
diff --git a/db-4.8.30/test/scr038/data/database_without_name.sql b/db-4.8.30/test/scr038/data/database_without_name.sql new file mode 100644 index 0000000..00134e5 --- /dev/null +++ b/db-4.8.30/test/scr038/data/database_without_name.sql @@ -0,0 +1,9 @@ +CREATE DATABASE; + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20), + value NUMERIC(8,2), -- just a comment here; + mintage_year INT(8), + mint_id INT(8), + CONSTRAINT mint_id_fk FOREIGN KEY(mint_id) + REFERENCES mint(mid)); diff --git a/db-4.8.30/test/scr038/data/decimal_table.sql b/db-4.8.30/test/scr038/data/decimal_table.sql new file mode 100644 index 0000000..f485eee --- /dev/null +++ b/db-4.8.30/test/scr038/data/decimal_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_decimal DECIMAL PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/dml.sql b/db-4.8.30/test/scr038/data/dml.sql new file mode 100644 index 0000000..96a8f5b --- /dev/null +++ b/db-4.8.30/test/scr038/data/dml.sql @@ -0,0 +1,6 @@ +CREATE DATABASE numismatics; + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20)); + +SELECT * from mint; diff --git a/db-4.8.30/test/scr038/data/double_table.sql b/db-4.8.30/test/scr038/data/double_table.sql new file mode 100644 index 0000000..394b72d --- /dev/null +++ b/db-4.8.30/test/scr038/data/double_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_double DOUBLE PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/float_table.sql b/db-4.8.30/test/scr038/data/float_table.sql new file mode 100644 index 0000000..e04d0e0 --- /dev/null +++ b/db-4.8.30/test/scr038/data/float_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_float FLOAT PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/hash_table.sql b/db-4.8.30/test/scr038/data/hash_table.sql new file mode 100644 index 0000000..229c592 --- /dev/null +++ b/db-4.8.30/test/scr038/data/hash_table.sql @@ -0,0 +1,7 @@ +CREATE DATABASE numismatics; /*+ CACHESIZE = 16m */
+
+CREATE TABLE mint (mid INT(8) PRIMARY KEY,
+ country VARCHAR(20),
+ city VARCHAR(20)); --+ DBTYPE = HASH
+
+
diff --git a/db-4.8.30/test/scr038/data/index_name_conflict_with_column.sql b/db-4.8.30/test/scr038/data/index_name_conflict_with_column.sql new file mode 100644 index 0000000..d941eaf --- /dev/null +++ b/db-4.8.30/test/scr038/data/index_name_conflict_with_column.sql @@ -0,0 +1,18 @@ +CREATE DATABASE numismatics;
+
+CREATE TABLE coin (cid INT(8) PRIMARY KEY,
+ unit VARCHAR(20),
+ value NUMERIC(8,2),
+ mintage_year INT(8),
+ mint_id INT(8),
+ CONSTRAINT mint_id_fk FOREIGN KEY(mint_id)
+ REFERENCES mint(mid));
+
+CREATE TABLE mint (mid INT(8) PRIMARY KEY,
+ country VARCHAR(20),
+ city VARCHAR(20));
+
+CREATE INDEX coin ON coin(unit);
+
+
+
diff --git a/db-4.8.30/test/scr038/data/index_without_name.sql b/db-4.8.30/test/scr038/data/index_without_name.sql new file mode 100644 index 0000000..1c2b88d --- /dev/null +++ b/db-4.8.30/test/scr038/data/index_without_name.sql @@ -0,0 +1,8 @@ +CREATE DATABASE numismatics; /*+ CACHESIZE = 16m */ + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20)); + + +CREATE INDEX ON coin(unit); + diff --git a/db-4.8.30/test/scr038/data/int_table.sql b/db-4.8.30/test/scr038/data/int_table.sql new file mode 100644 index 0000000..7aa82d5 --- /dev/null +++ b/db-4.8.30/test/scr038/data/int_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_int INT PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/integer_table.sql b/db-4.8.30/test/scr038/data/integer_table.sql new file mode 100644 index 0000000..5913866 --- /dev/null +++ b/db-4.8.30/test/scr038/data/integer_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_integer INTEGER PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/many_tables.sql b/db-4.8.30/test/scr038/data/many_tables.sql new file mode 100644 index 0000000..44a7648 --- /dev/null +++ b/db-4.8.30/test/scr038/data/many_tables.sql @@ -0,0 +1,93 @@ + +CREATE DATABASE numismatics; + +CREATE TABLE table1 (att_int INT(8) PRIMARY KEY, + att_char CHAR(2), + att_varchar VARCHAR(20), + att_bit BIT, + att_tinyint TINYINT, + att_smallint SMALLINT(2), + att_integer INTEGER(4), + att_bigint BIGINT, + att_real REAL, + att_double DOUBLE, + att_float FLOAT, + att_decimal DECIMAL, + att_numeric NUMERIC, + att_bin bin(10), + CONSTRAINT table8_fk FOREIGN KEY(att_integer) + REFERENCES table8(att_integer)); + +CREATE TABLE table2 (att_int INT(8) PRIMARY KEY); + +CREATE TABLE table3 (att_char CHAR(2) PRIMARY KEY); + +CREATE TABLE table4 (att_varchar VARCHAR(20) PRIMARY KEY); + +CREATE TABLE table5 (att_bit BIT PRIMARY KEY); + +CREATE TABLE table6 (att_tinyint TINYINT PRIMARY KEY); + +CREATE TABLE table7 (att_smallint SMALLINT(2) PRIMARY KEY); + +CREATE TABLE table8 (att_integer INTEGER(4) PRIMARY KEY); + +CREATE TABLE table9 (att_bigint BIGINT PRIMARY KEY); + +CREATE TABLE table10 (att_real REAL PRIMARY KEY); + +CREATE TABLE table11 (att_double DOUBLE PRIMARY KEY); + +CREATE TABLE table12 (att_float FLOAT PRIMARY KEY); + +CREATE TABLE table13 (att_decimal DECIMAL PRIMARY KEY); + +CREATE TABLE table14 (att_numeric NUMERIC PRIMARY KEY); + +CREATE TABLE table15 (att_binary bin(10) PRIMARY KEY); + +CREATE TABLE table16 (att_int INT(8) PRIMARY KEY, + att_char CHAR(2), + att_varchar VARCHAR(20), + att_bit BIT, + att_tinyint TINYINT, + att_smallint SMALLINT(2), + att_integer INTEGER(4), + att_bigint BIGINT, + att_real REAL, + att_double DOUBLE, + att_float FLOAT, + att_decimal DECIMAL, + att_numeric NUMERIC, + att_bin bin(10), + CONSTRAINT table17_fk FOREIGN KEY(att_int) + REFERENCES table17(att_int)); + +CREATE TABLE table17 (att_int INT(8) PRIMARY KEY); + +CREATE TABLE table18 (att_char CHAR(2) PRIMARY KEY); + +CREATE TABLE table19 (att_varchar VARCHAR(20) PRIMARY KEY); + +CREATE TABLE table20 (att_bit BIT PRIMARY KEY); + +CREATE TABLE table21 (att_tinyint TINYINT PRIMARY KEY); + +CREATE TABLE table22 (att_smallint SMALLINT(2) PRIMARY KEY); + +CREATE TABLE table23 (att_integer INTEGER(4) PRIMARY KEY); + +CREATE TABLE table24 (att_bigint BIGINT PRIMARY KEY); + +CREATE TABLE table25 (att_real REAL PRIMARY KEY); + +CREATE TABLE table26 (att_double DOUBLE PRIMARY KEY); + +CREATE TABLE table27 (att_float FLOAT PRIMARY KEY); + +CREATE TABLE table28 (att_decimal DECIMAL PRIMARY KEY); + +CREATE TABLE table29 (att_numeric NUMERIC PRIMARY KEY); + +CREATE TABLE table30 (att_binary bin(100) PRIMARY KEY); + diff --git a/db-4.8.30/test/scr038/data/no_primary_key_constraint.sql b/db-4.8.30/test/scr038/data/no_primary_key_constraint.sql new file mode 100644 index 0000000..b2c6d30 --- /dev/null +++ b/db-4.8.30/test/scr038/data/no_primary_key_constraint.sql @@ -0,0 +1,4 @@ +CREATE DATABASE numismatics; /*+ CACHESIZE = 16m */ + +CREATE TABLE coin (cid INT(8), + unit VARCHAR(20)); diff --git a/db-4.8.30/test/scr038/data/nonexistent_column_constraints.sql b/db-4.8.30/test/scr038/data/nonexistent_column_constraints.sql new file mode 100644 index 0000000..8bf001c --- /dev/null +++ b/db-4.8.30/test/scr038/data/nonexistent_column_constraints.sql @@ -0,0 +1,13 @@ +CREATE DATABASE numismatics;
+CREATE TABLE coin (cid INT(8) PRIMARY KEY,
+ unit VARCHAR(20),
+ value NUMERIC(8,2),
+ mintage_year INT(8),
+ mint_id INT(8),
+ CONSTRAINT mint_id_fk FOREIGN KEY(id)
+ REFERENCES mint(mid));
+
+CREATE TABLE mint (mid INT(8) PRIMARY KEY,
+ country VARCHAR(20),
+ city VARCHAR(20)); --+ DBTYPE = HASH
+
diff --git a/db-4.8.30/test/scr038/data/numeric_table.sql b/db-4.8.30/test/scr038/data/numeric_table.sql new file mode 100644 index 0000000..aef7314 --- /dev/null +++ b/db-4.8.30/test/scr038/data/numeric_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_numeric NUMERIC PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/only_database.sql b/db-4.8.30/test/scr038/data/only_database.sql new file mode 100644 index 0000000..b5cc7f4 --- /dev/null +++ b/db-4.8.30/test/scr038/data/only_database.sql @@ -0,0 +1 @@ +CREATE DATABASE numismatics; diff --git a/db-4.8.30/test/scr038/data/only_index.sql b/db-4.8.30/test/scr038/data/only_index.sql new file mode 100644 index 0000000..1d6a7c4 --- /dev/null +++ b/db-4.8.30/test/scr038/data/only_index.sql @@ -0,0 +1,3 @@ + +CREATE INDEX unit_index ON coin(unit); + diff --git a/db-4.8.30/test/scr038/data/only_table.sql b/db-4.8.30/test/scr038/data/only_table.sql new file mode 100644 index 0000000..49ea66f --- /dev/null +++ b/db-4.8.30/test/scr038/data/only_table.sql @@ -0,0 +1,6 @@ +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20)); + +CREATE TABLE mint (mid INT(8), + country VARCHAR(20), + city VARCHAR(20));
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/real_table.sql b/db-4.8.30/test/scr038/data/real_table.sql new file mode 100644 index 0000000..e542969 --- /dev/null +++ b/db-4.8.30/test/scr038/data/real_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_real REAL PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/sample.sql b/db-4.8.30/test/scr038/data/sample.sql new file mode 100644 index 0000000..62689c6 --- /dev/null +++ b/db-4.8.30/test/scr038/data/sample.sql @@ -0,0 +1,20 @@ +CREATE DATABASE numismatics; /*+ CACHESIZE = 16m */ + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR2(20), + value NUMERIC(8,2), -- just a comment here; + mintage_year INT(8), + mint_id INT(8), + CONSTRAINT mint_id_fk FOREIGN KEY(mint_id) + REFERENCES mint(mid)); + +CREATE TABLE mint (mid INT(8) PRIMARY KEY, + country VARCHAR2(20), + city VARCHAR2(20)); --+ DBTYPE = HASH + +CREATE INDEX unit_index ON coin(unit); + +CREATE TABLE random (rid VARCHAR2(20) PRIMARY KEY, + chunk bin(127)); + +/* SELECT * from mint;*/ diff --git a/db-4.8.30/test/scr038/data/smallint_table.sql b/db-4.8.30/test/scr038/data/smallint_table.sql new file mode 100644 index 0000000..18b9a58 --- /dev/null +++ b/db-4.8.30/test/scr038/data/smallint_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_smallint SMALLINT(2) PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/table_name_conflict_with_database.sql b/db-4.8.30/test/scr038/data/table_name_conflict_with_database.sql new file mode 100644 index 0000000..c229f4f --- /dev/null +++ b/db-4.8.30/test/scr038/data/table_name_conflict_with_database.sql @@ -0,0 +1,3 @@ +CREATE DATABASE numismatics;
+CREATE TABLE numismatics(cid INT(8) PRIMARY KEY,
+ unit VARCHAR(20));
diff --git a/db-4.8.30/test/scr038/data/table_without_name.sql b/db-4.8.30/test/scr038/data/table_without_name.sql new file mode 100644 index 0000000..f662401 --- /dev/null +++ b/db-4.8.30/test/scr038/data/table_without_name.sql @@ -0,0 +1,9 @@ +CREATE DATABASE numismatics; /*+ CACHESIZE = 16m */ + +CREATE TABLE (cid INT(8) PRIMARY KEY, + unit VARCHAR(20), + value NUMERIC(8,2), -- just a comment here; + mintage_year INT(8), + mint_id INT(8), + CONSTRAINT mint_id_fk FOREIGN KEY(mint_id) + REFERENCES mint(mid)); diff --git a/db-4.8.30/test/scr038/data/tiny_table.sql b/db-4.8.30/test/scr038/data/tiny_table.sql new file mode 100644 index 0000000..e29a1c9 --- /dev/null +++ b/db-4.8.30/test/scr038/data/tiny_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_tinyint TINYINT PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/two_different_databases.sql b/db-4.8.30/test/scr038/data/two_different_databases.sql new file mode 100644 index 0000000..c2be268 --- /dev/null +++ b/db-4.8.30/test/scr038/data/two_different_databases.sql @@ -0,0 +1,10 @@ +CREATE DATABASE numismatics; +CREATE DATABASE numismatics1; + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20), + value NUMERIC(8,2), + mintage_year INT(8), + mint_id INT(8), + CONSTRAINT mint_id_fk FOREIGN KEY(mint_id) + REFERENCES mint(mid)); diff --git a/db-4.8.30/test/scr038/data/two_different_indexes.sql b/db-4.8.30/test/scr038/data/two_different_indexes.sql new file mode 100644 index 0000000..f029235 --- /dev/null +++ b/db-4.8.30/test/scr038/data/two_different_indexes.sql @@ -0,0 +1,26 @@ +CREATE DATABASE numismatics; /*+ CACHESIZE = 16m */ + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20), + value NUMERIC(8,2), -- just a comment here; + mintage_year INT(8), + mint_id INT(8), + CONSTRAINT mint_id_fk FOREIGN KEY(mint_id) + REFERENCES mint(mid)); + +CREATE TABLE mint (mid INT(8) PRIMARY KEY, + country VARCHAR(20), + city VARCHAR(20), + zip_code INT(8)); --+ DBTYPE = HASH + + + +CREATE INDEX value_index ON coin(value); + +CREATE INDEX mint_id_index ON coin(mint_id); + +CREATE INDEX mintage_year_index ON coin(mintage_year); + +CREATE INDEX zip_code_index ON mint(zip_code); + +/* SELECT * from mint;*/ diff --git a/db-4.8.30/test/scr038/data/two_different_tables.sql b/db-4.8.30/test/scr038/data/two_different_tables.sql new file mode 100644 index 0000000..7643057 --- /dev/null +++ b/db-4.8.30/test/scr038/data/two_different_tables.sql @@ -0,0 +1,8 @@ +CREATE DATABASE numismatics; + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20)); + +CREATE TABLE mint (mid INT(8) PRIMARY KEY, + country VARCHAR(20), + city VARCHAR(20)); diff --git a/db-4.8.30/test/scr038/data/two_indexes_on_same_column.sql b/db-4.8.30/test/scr038/data/two_indexes_on_same_column.sql new file mode 100644 index 0000000..46fa409 --- /dev/null +++ b/db-4.8.30/test/scr038/data/two_indexes_on_same_column.sql @@ -0,0 +1,10 @@ +CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_int INT(8) PRIMARY KEY,
+ att_char CHAR(2));
+
+CREATE INDEX int_index ON table1(att_int);
+
+CREATE INDEX int_index_1 ON table1(att_int);
+
+
diff --git a/db-4.8.30/test/scr038/data/two_same_columns.sql b/db-4.8.30/test/scr038/data/two_same_columns.sql new file mode 100644 index 0000000..44f3612 --- /dev/null +++ b/db-4.8.30/test/scr038/data/two_same_columns.sql @@ -0,0 +1,12 @@ +CREATE DATABASE numismatics;
+
+CREATE TABLE coin (cid INT(8) PRIMARY KEY,
+ unit VARCHAR(20),
+ unit VARCHAR(20),
+ value NUMERIC(8,2),
+ mintage_year INT(8),
+ mint_id INT(8),
+ CONSTRAINT mint_id_fk FOREIGN KEY(mint_id)
+ REFERENCES mint(mid));
+
+
diff --git a/db-4.8.30/test/scr038/data/two_same_databases.sql b/db-4.8.30/test/scr038/data/two_same_databases.sql new file mode 100644 index 0000000..549a9dd --- /dev/null +++ b/db-4.8.30/test/scr038/data/two_same_databases.sql @@ -0,0 +1,11 @@ +CREATE DATABASE numismatics; + +CREATE DATABASE numismatics; + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20), + value NUMERIC(8,2), -- just a comment here; + mintage_year INT(8), + mint_id INT(8), + CONSTRAINT mint_id_fk FOREIGN KEY(mint_id) + REFERENCES mint(mid)); diff --git a/db-4.8.30/test/scr038/data/two_same_indexes.sql b/db-4.8.30/test/scr038/data/two_same_indexes.sql new file mode 100644 index 0000000..a5ddd64 --- /dev/null +++ b/db-4.8.30/test/scr038/data/two_same_indexes.sql @@ -0,0 +1,11 @@ +CREATE DATABASE numismatics; + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20), + value NUMERIC(8,2), + mintage_year INT(8)); + + +CREATE INDEX unit_index ON coin(unit); + +CREATE INDEX unit_index ON coin(unit);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/two_same_name_columns.sql b/db-4.8.30/test/scr038/data/two_same_name_columns.sql new file mode 100644 index 0000000..e257552 --- /dev/null +++ b/db-4.8.30/test/scr038/data/two_same_name_columns.sql @@ -0,0 +1,9 @@ +CREATE DATABASE numismatics;
+
+CREATE TABLE coin (cid INT(8) PRIMARY KEY,
+ unit VARCHAR(20),
+ unit NUMERIC(8,2),
+ mintage_year INT(8),
+ mint_id INT(8),
+ CONSTRAINT mint_id_fk FOREIGN KEY(mint_id)
+ REFERENCES mint(mid));
diff --git a/db-4.8.30/test/scr038/data/two_same_name_columns_in_different_tables.sql b/db-4.8.30/test/scr038/data/two_same_name_columns_in_different_tables.sql new file mode 100644 index 0000000..648b3bd --- /dev/null +++ b/db-4.8.30/test/scr038/data/two_same_name_columns_in_different_tables.sql @@ -0,0 +1,6 @@ +CREATE DATABASE numismatics;
+CREATE TABLE coin (cid INT(8) PRIMARY KEY,
+ unit VARCHAR(20));
+
+CREATE TABLE mint (mid INT(8) PRIMARY KEY,
+ unit VARCHAR(20));
diff --git a/db-4.8.30/test/scr038/data/two_same_name_indexes.sql b/db-4.8.30/test/scr038/data/two_same_name_indexes.sql new file mode 100644 index 0000000..533bb94 --- /dev/null +++ b/db-4.8.30/test/scr038/data/two_same_name_indexes.sql @@ -0,0 +1,11 @@ +CREATE DATABASE numismatics; + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20), + value NUMERIC(8,2), + mintage_year INT(8)); + +CREATE INDEX unit_index ON coin(unit); + +CREATE INDEX unit_index1 ON coin(unit); + diff --git a/db-4.8.30/test/scr038/data/two_same_name_tables.sql b/db-4.8.30/test/scr038/data/two_same_name_tables.sql new file mode 100644 index 0000000..17c8063 --- /dev/null +++ b/db-4.8.30/test/scr038/data/two_same_name_tables.sql @@ -0,0 +1,8 @@ +CREATE DATABASE numismatics; + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20)); + +CREATE TABLE coin (mid INT(8) PRIMARY KEY, + country VARCHAR(20), + city VARCHAR(20)); diff --git a/db-4.8.30/test/scr038/data/two_same_tables.sql b/db-4.8.30/test/scr038/data/two_same_tables.sql new file mode 100644 index 0000000..7775ca1 --- /dev/null +++ b/db-4.8.30/test/scr038/data/two_same_tables.sql @@ -0,0 +1,7 @@ +CREATE DATABASE numismatics; + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20)); + +CREATE TABLE coin (cid INT(8) PRIMARY KEY, + unit VARCHAR(20)); diff --git a/db-4.8.30/test/scr038/data/unsupported_access_method.sql b/db-4.8.30/test/scr038/data/unsupported_access_method.sql new file mode 100644 index 0000000..203ed8a --- /dev/null +++ b/db-4.8.30/test/scr038/data/unsupported_access_method.sql @@ -0,0 +1,8 @@ +CREATE DATABASE numismatics;
+
+CREATE TABLE mint (mid INT(8) PRIMARY KEY,
+ country VARCHAR(20),
+ city VARCHAR(20)); --+ DBTYPE = QUEUE
+
+
+
diff --git a/db-4.8.30/test/scr038/data/unsupported_data_type.sql b/db-4.8.30/test/scr038/data/unsupported_data_type.sql new file mode 100644 index 0000000..0e8f357 --- /dev/null +++ b/db-4.8.30/test/scr038/data/unsupported_data_type.sql @@ -0,0 +1,4 @@ +CREATE DATABASE numismatics; + +CREATE TABLE coin (cid STRING PRIMARY KEY, + unit VARCHAR(20)); diff --git a/db-4.8.30/test/scr038/data/varchar_length.sql b/db-4.8.30/test/scr038/data/varchar_length.sql new file mode 100644 index 0000000..2d9da9f --- /dev/null +++ b/db-4.8.30/test/scr038/data/varchar_length.sql @@ -0,0 +1,4 @@ +CREATE DATABASE numismatics; /*+ CACHESIZE = 16m */
+
+CREATE TABLE coin (cid INT(8) PRIMARY KEY,
+ unit VARCHAR(2));
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/varchar_table.sql b/db-4.8.30/test/scr038/data/varchar_table.sql new file mode 100644 index 0000000..eac0404 --- /dev/null +++ b/db-4.8.30/test/scr038/data/varchar_table.sql @@ -0,0 +1,4 @@ +
+CREATE DATABASE numismatics;
+
+CREATE TABLE table1 (att_varchar VARCHAR(20) PRIMARY KEY);
\ No newline at end of file diff --git a/db-4.8.30/test/scr038/data/wrong_create_sequence.sql b/db-4.8.30/test/scr038/data/wrong_create_sequence.sql new file mode 100644 index 0000000..c166460 --- /dev/null +++ b/db-4.8.30/test/scr038/data/wrong_create_sequence.sql @@ -0,0 +1,10 @@ +
+CREATE INDEX unit_index ON coin(unit);
+
+CREATE TABLE coin (cid INT(8) PRIMARY KEY,
+ unit VARCHAR(20),
+ value NUMERIC(8,2), -- just a comment here;
+ mintage_year INT(8),
+ mint_id INT(8));
+
+CREATE DATABASE numismatics;
diff --git a/db-4.8.30/test/scr038/nMakefile b/db-4.8.30/test/scr038/nMakefile new file mode 100644 index 0000000..59926c8 --- /dev/null +++ b/db-4.8.30/test/scr038/nMakefile @@ -0,0 +1,14 @@ +# Makefile for building db_sql generated code on Windows. + +!include <win32.mak> + +bdb_dir = "../../build_windows" + +all: sample.exe + +.c.obj: + $(cc) $(cdebug) $(cflags) $(cvars) /I$(bdb_dir) $*.c + +sample.exe: sample.obj sample_verify.obj + $(link) $(ldebug) $(conflags) -out:sample.exe sample.obj sample_verify.obj $(conlibs) /LIBPATH:$(bdb_dir)/Win32/Debug libdb48d.lib + |