提交 37526e6e authored 作者: Thomas Mueller's avatar Thomas Mueller

Issue 279: Auto-Server mode: unclear error message when trying to connect using…

Issue 279: Auto-Server mode: unclear error message when trying to connect using AUTO_SERVER if the database is already open without the flag (Connection is broken: "null").
上级 b79844b3
...@@ -18,7 +18,9 @@ Change Log ...@@ -18,7 +18,9 @@ Change Log
<h1>Change Log</h1> <h1>Change Log</h1>
<h2>Next Version (unreleased)</h2> <h2>Next Version (unreleased)</h2>
<ul><li>Issue 238: Can drop a column that has a single-column constraint. <ul><li>Issue 279: Auto-Server mode: unclear error message when trying to connect using AUTO_SERVER
if the database is already open without the flag (Connection is broken: "null").
</li><li>Issue 238: Can drop a column that has a single-column constraint.
</li></ul> </li></ul>
<h2>Version 1.3.150 Beta (2011-01-28)</h2> <h2>Version 1.3.150 Beta (2011-01-28)</h2>
......
...@@ -444,8 +444,11 @@ public class FileLock implements Runnable { ...@@ -444,8 +444,11 @@ public class FileLock implements Runnable {
if (fileName != null) { if (fileName != null) {
try { try {
Properties prop = load(); Properties prop = load();
String serverId = prop.getProperty("server") + "/" + prop.getProperty("id"); String server = prop.getProperty("server");
e = e.addSQL(serverId); if (server != null) {
String serverId = server + "/" + prop.getProperty("id");
e = e.addSQL(serverId);
}
} catch (DbException e2) { } catch (DbException e2) {
// ignore // ignore
} }
......
...@@ -375,10 +375,10 @@ create memory table test(id int); ...@@ -375,10 +375,10 @@ create memory table test(id int);
script nodata nopasswords nosettings; script nodata nopasswords nosettings;
> SCRIPT > SCRIPT
> -------------------------------------------------- > -----------------------------------------------
> -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> CREATE DOMAIN INT AS VARCHAR; > CREATE DOMAIN INT AS VARCHAR;
> CREATE MEMORY TABLE PUBLIC.TEST( ID VARCHAR ); > CREATE MEMORY TABLE PUBLIC.TEST( ID VARCHAR );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> rows: 4 > rows: 4
...@@ -729,7 +729,7 @@ script nopasswords nosettings; ...@@ -729,7 +729,7 @@ script nopasswords nosettings;
> SCRIPT > SCRIPT
> ----------------------------------------------------------------------------------------------------------------------------------------- > -----------------------------------------------------------------------------------------------------------------------------------------
> -- 3 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 3 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT, D DOUBLE, F FLOAT ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT, D DOUBLE, F FLOAT );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> INSERT INTO PUBLIC.TEST(ID, D, F) VALUES (0, POWER(0, -1), POWER(0, -1)), (1, (-POWER(0, -1)), (-POWER(0, -1))), (2, SQRT(-1), SQRT(-1)); > INSERT INTO PUBLIC.TEST(ID, D, F) VALUES (0, POWER(0, -1), POWER(0, -1)), (1, (-POWER(0, -1)), (-POWER(0, -1))), (2, SQRT(-1), SQRT(-1));
> rows: 4 > rows: 4
...@@ -774,8 +774,8 @@ insert into t2 select x from system_range(1, 1000); ...@@ -774,8 +774,8 @@ insert into t2 select x from system_range(1, 1000);
explain select count(*) from t1 where t1.id in ( select t2.id from t2 ); explain select count(*) from t1 where t1.id in ( select t2.id from t2 );
> PLAN > PLAN
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> SELECT COUNT(*) FROM PUBLIC.T1 /* PUBLIC.PRIMARY_KEY_A: ID IN(SELECT DISTINCT T2.ID FROM PUBLIC.T2 /++ PUBLIC.T2.tableScan ++/) */ WHERE T1.ID IN(SELECT DISTINCT T2.ID FROM PUBLIC.T2 /* PUBLIC.T2.tableScan */) > SELECT COUNT(*) FROM PUBLIC.T1 /* PUBLIC.PRIMARY_KEY_A: ID IN(SELECT DISTINCT T2.ID FROM PUBLIC.T2 /++ PUBLIC.T2.tableScan ++/) */ WHERE T1.ID IN( SELECT DISTINCT T2.ID FROM PUBLIC.T2 /* PUBLIC.T2.tableScan */)
> rows: 1 > rows: 1
select count(*) from t1 where t1.id in ( select t2.id from t2 ); select count(*) from t1 where t1.id in ( select t2.id from t2 );
...@@ -1128,8 +1128,8 @@ explain select * from (select dir_num, count(*) as cnt from multi_pages t, b_ho ...@@ -1128,8 +1128,8 @@ explain select * from (select dir_num, count(*) as cnt from multi_pages t, b_ho
where t.bh_id=bh.id and bh.site='Hello' group by dir_num) as x where t.bh_id=bh.id and bh.site='Hello' group by dir_num) as x
where cnt < 1000 order by dir_num asc; where cnt < 1000 order by dir_num asc;
> PLAN > PLAN
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> SELECT X.DIR_NUM, X.CNT FROM (SELECT DIR_NUM, COUNT(*) AS CNT FROM PUBLIC.MULTI_PAGES T /* PUBLIC.MULTI_PAGES.tableScan */ INNER JOIN PUBLIC.B_HOLDING BH /* PUBLIC.PRIMARY_KEY_3: ID = T.BH_ID */ ON 1=1 WHERE (BH.SITE = 'Hello') AND (T.BH_ID = BH.ID) GROUP BY DIR_NUM) X /* SELECT DIR_NUM, COUNT(*) AS CNT FROM PUBLIC.MULTI_PAGES T /++ PUBLIC.MULTI_PAGES.tableScan ++/ INNER JOIN PUBLIC.B_HOLDING BH /++ PUBLIC.PRIMARY_KEY_3: ID = T.BH_ID ++/ ON 1=1 WHERE (BH.SITE = 'Hello') AND (T.BH_ID = BH.ID) GROUP BY DIR_NUM HAVING COUNT(*) <= ?1: CNT < 1000 */ WHERE CNT < 1000 ORDER BY 1 > SELECT X.DIR_NUM, X.CNT FROM ( SELECT DIR_NUM, COUNT(*) AS CNT FROM PUBLIC.MULTI_PAGES T /* PUBLIC.MULTI_PAGES.tableScan */ INNER JOIN PUBLIC.B_HOLDING BH /* PUBLIC.PRIMARY_KEY_3: ID = T.BH_ID */ ON 1=1 WHERE (BH.SITE = 'Hello') AND (T.BH_ID = BH.ID) GROUP BY DIR_NUM ) X /* SELECT DIR_NUM, COUNT(*) AS CNT FROM PUBLIC.MULTI_PAGES T /++ PUBLIC.MULTI_PAGES.tableScan ++/ INNER JOIN PUBLIC.B_HOLDING BH /++ PUBLIC.PRIMARY_KEY_3: ID = T.BH_ID ++/ ON 1=1 WHERE (BH.SITE = 'Hello') AND (T.BH_ID = BH.ID) GROUP BY DIR_NUM HAVING COUNT(*) <= ?1: CNT < 1000 */ WHERE CNT < 1000 ORDER BY 1
> rows (ordered): 1 > rows (ordered): 1
select dir_num, count(*) as cnt from multi_pages t, b_holding bh select dir_num, count(*) as cnt from multi_pages t, b_holding bh
...@@ -1559,8 +1559,8 @@ drop table A, B, C, V; ...@@ -1559,8 +1559,8 @@ drop table A, B, C, V;
explain select * from table(id int = (1, 2), name varchar=('Hello', 'World')); explain select * from table(id int = (1, 2), name varchar=('Hello', 'World'));
> PLAN > PLAN
> ------------------------------------------------------------------------------------------------------ > -----------------------------------------------------------------------------------------------------
> SELECT TABLE.ID, TABLE.NAME FROM TABLE(ID INT=(1, 2), NAME VARCHAR=('Hello', 'World')) /* PUBLIC."" */ > SELECT TABLE.ID, TABLE.NAME FROM TABLE(ID INT=(1, 2), NAME VARCHAR=('Hello', 'World')) /* function */
> rows: 1 > rows: 1
CREATE TABLE TEST(ID INT PRIMARY KEY, FLAG BOOLEAN, NAME VARCHAR); CREATE TABLE TEST(ID INT PRIMARY KEY, FLAG BOOLEAN, NAME VARCHAR);
...@@ -1957,7 +1957,7 @@ script nopasswords nosettings blocksize 10; ...@@ -1957,7 +1957,7 @@ script nopasswords nosettings blocksize 10;
> CALL SYSTEM_COMBINE_BLOB(-1); > CALL SYSTEM_COMBINE_BLOB(-1);
> CREATE ALIAS IF NOT EXISTS SYSTEM_COMBINE_BLOB FOR "org.h2.command.dml.ScriptCommand.combineBlob"; > CREATE ALIAS IF NOT EXISTS SYSTEM_COMBINE_BLOB FOR "org.h2.command.dml.ScriptCommand.combineBlob";
> CREATE ALIAS IF NOT EXISTS SYSTEM_COMBINE_CLOB FOR "org.h2.command.dml.ScriptCommand.combineClob"; > CREATE ALIAS IF NOT EXISTS SYSTEM_COMBINE_CLOB FOR "org.h2.command.dml.ScriptCommand.combineClob";
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, DATA CLOB ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, DATA CLOB );
> CREATE PRIMARY KEY SYSTEM_LOB_STREAM_PRIMARY_KEY ON SYSTEM_LOB_STREAM(ID, PART); > CREATE PRIMARY KEY SYSTEM_LOB_STREAM_PRIMARY_KEY ON SYSTEM_LOB_STREAM(ID, PART);
> CREATE TABLE IF NOT EXISTS SYSTEM_LOB_STREAM(ID INT NOT NULL, PART INT NOT NULL, CDATA VARCHAR, BDATA BINARY); > CREATE TABLE IF NOT EXISTS SYSTEM_LOB_STREAM(ID INT NOT NULL, PART INT NOT NULL, CDATA VARCHAR, BDATA BINARY);
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
...@@ -1965,9 +1965,9 @@ script nopasswords nosettings blocksize 10; ...@@ -1965,9 +1965,9 @@ script nopasswords nosettings blocksize 10;
> DROP ALIAS IF EXISTS SYSTEM_COMBINE_CLOB; > DROP ALIAS IF EXISTS SYSTEM_COMBINE_CLOB;
> DROP TABLE IF EXISTS SYSTEM_LOB_STREAM; > DROP TABLE IF EXISTS SYSTEM_LOB_STREAM;
> INSERT INTO PUBLIC.TEST(ID, DATA) VALUES (1, SYSTEM_COMBINE_CLOB(0)); > INSERT INTO PUBLIC.TEST(ID, DATA) VALUES (1, SYSTEM_COMBINE_CLOB(0));
> INSERT INTO SYSTEM_LOB_STREAM VALUES(0, 0, 'abc ', NULL); > INSERT INTO SYSTEM_LOB_STREAM VALUES(0, 0, 'abc ', NULL);
> INSERT INTO SYSTEM_LOB_STREAM VALUES(0, 1, ' ', NULL); > INSERT INTO SYSTEM_LOB_STREAM VALUES(0, 1, ' ', NULL);
> INSERT INTO SYSTEM_LOB_STREAM VALUES(0, 2, ' ', NULL); > INSERT INTO SYSTEM_LOB_STREAM VALUES(0, 2, ' ', NULL);
> rows: 16 > rows: 16
drop table test; drop table test;
...@@ -2357,9 +2357,9 @@ insert into test values('AA'); ...@@ -2357,9 +2357,9 @@ insert into test values('AA');
script nodata nopasswords nosettings; script nodata nopasswords nosettings;
> SCRIPT > SCRIPT
> ------------------------------------------------------------------------------- > ---------------------------------------------------------------------------
> -- 2 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 2 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> CREATE MEMORY TABLE PUBLIC.TEST( NAME VARCHAR CHECK (NAME = UPPER(NAME)) ); > CREATE MEMORY TABLE PUBLIC.TEST( NAME VARCHAR CHECK (NAME = UPPER(NAME)) );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> rows: 3 > rows: 3
...@@ -2408,13 +2408,13 @@ create domain string_x as string3; ...@@ -2408,13 +2408,13 @@ create domain string_x as string3;
create memory table test(a string, b string1, c string2, d string3); create memory table test(a string, b string1, c string2, d string3);
> ok > ok
insert into test() values(); insert into test(c) values('x');
> update count: 1 > update count: 1
select * from test; select * from test;
> A B C D > A B C D
> - ---- ---- ------- > - ---- - -------
> null null <empty> > null x <empty>
> rows: 1 > rows: 1
select DOMAIN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, PRECISION, SCALE, TYPE_NAME, SELECTIVITY, CHECK_CONSTRAINT, REMARKS, SQL from information_schema.domains; select DOMAIN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, PRECISION, SCALE, TYPE_NAME, SELECTIVITY, CHECK_CONSTRAINT, REMARKS, SQL from information_schema.domains;
...@@ -2431,7 +2431,7 @@ select DOMAIN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, PRECISION, SCALE, TY ...@@ -2431,7 +2431,7 @@ select DOMAIN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, PRECISION, SCALE, TY
script nodata nopasswords nosettings; script nodata nopasswords nosettings;
> SCRIPT > SCRIPT
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ > ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> -- 1 +/- SELECT COUNT(*) FROM PUBLIC.ADDRESS; > -- 1 +/- SELECT COUNT(*) FROM PUBLIC.ADDRESS;
> -- 1 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 1 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> ALTER TABLE PUBLIC.ADDRESS ADD CONSTRAINT PUBLIC.CONSTRAINT_E PRIMARY KEY(ID); > ALTER TABLE PUBLIC.ADDRESS ADD CONSTRAINT PUBLIC.CONSTRAINT_E PRIMARY KEY(ID);
...@@ -2442,8 +2442,8 @@ script nodata nopasswords nosettings; ...@@ -2442,8 +2442,8 @@ script nodata nopasswords nosettings;
> CREATE DOMAIN STRING2 AS VARCHAR NOT NULL; > CREATE DOMAIN STRING2 AS VARCHAR NOT NULL;
> CREATE DOMAIN STRING3 AS VARCHAR DEFAULT '<empty>'; > CREATE DOMAIN STRING3 AS VARCHAR DEFAULT '<empty>';
> CREATE DOMAIN STRING_X AS VARCHAR DEFAULT '<empty>'; > CREATE DOMAIN STRING_X AS VARCHAR DEFAULT '<empty>';
> CREATE MEMORY TABLE PUBLIC.ADDRESS( ID INT NOT NULL, NAME VARCHAR(200) CHECK (POSITION('@', NAME) > 1), NAME2 VARCHAR(200) DEFAULT '@gmail.com' CHECK ((POSITION('@', NAME2) > 1) AND (POSITION('gmail', NAME2) > 1)) ); > CREATE MEMORY TABLE PUBLIC.ADDRESS( ID INT NOT NULL, NAME VARCHAR(200) CHECK (POSITION('@', NAME) > 1), NAME2 VARCHAR(200) DEFAULT '@gmail.com' CHECK ((POSITION('@', NAME2) > 1) AND (POSITION('gmail', NAME2) > 1)) );
> CREATE MEMORY TABLE PUBLIC.TEST( A VARCHAR(255) DEFAULT '', B VARCHAR, C VARCHAR, D VARCHAR DEFAULT '<empty>' ); > CREATE MEMORY TABLE PUBLIC.TEST( A VARCHAR(255) DEFAULT '' NOT NULL, B VARCHAR, C VARCHAR NOT NULL, D VARCHAR DEFAULT '<empty>' );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> rows: 13 > rows: 13
...@@ -2494,9 +2494,9 @@ create memory table a(k10 blob(10k), m20 blob(20m), g30 clob(30g)); ...@@ -2494,9 +2494,9 @@ create memory table a(k10 blob(10k), m20 blob(20m), g30 clob(30g));
script NODATA NOPASSWORDS NOSETTINGS drop; script NODATA NOPASSWORDS NOSETTINGS drop;
> SCRIPT > SCRIPT
> ------------------------------------------------------------------------------------------------------- > -------------------------------------------------------------------------------------------
> -- 0 +/- SELECT COUNT(*) FROM PUBLIC.A; > -- 0 +/- SELECT COUNT(*) FROM PUBLIC.A;
> CREATE MEMORY TABLE PUBLIC.A( K10 BLOB(10240), M20 BLOB(20971520), G30 CLOB(32212254720) ); > CREATE MEMORY TABLE PUBLIC.A( K10 BLOB(10240), M20 BLOB(20971520), G30 CLOB(32212254720) );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> DROP TABLE IF EXISTS PUBLIC.A; > DROP TABLE IF EXISTS PUBLIC.A;
> rows: 4 > rows: 4
...@@ -2901,8 +2901,8 @@ where exists (select 1 from test t4 where t2.id=t4.id); ...@@ -2901,8 +2901,8 @@ where exists (select 1 from test t4 where t2.id=t4.id);
explain select * from test t1 where id in(select id from test t2 where t1.id=t2.id); explain select * from test t1 where id in(select id from test t2 where t1.id=t2.id);
> PLAN > PLAN
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ > -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> SELECT T1.ID, T1.NAME FROM PUBLIC.TEST T1 /* PUBLIC.TEST.tableScan */ WHERE ID IN(SELECT DISTINCT ID FROM PUBLIC.TEST T2 /* PUBLIC.PRIMARY_KEY_2: ID = T1.ID */ WHERE T1.ID = T2.ID) > SELECT T1.ID, T1.NAME FROM PUBLIC.TEST T1 /* PUBLIC.TEST.tableScan */ WHERE ID IN( SELECT DISTINCT ID FROM PUBLIC.TEST T2 /* PUBLIC.PRIMARY_KEY_2: ID = T1.ID */ WHERE T1.ID = T2.ID)
> rows: 1 > rows: 1
select * from test t1 where id in(select id from test t2 where t1.id=t2.id); select * from test t1 where id in(select id from test t2 where t1.id=t2.id);
...@@ -2940,8 +2940,8 @@ select * from test t1 where id in(id); ...@@ -2940,8 +2940,8 @@ select * from test t1 where id in(id);
explain select * from test t1 where id in(select id from test); explain select * from test t1 where id in(select id from test);
> PLAN > PLAN
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> SELECT T1.ID, T1.NAME FROM PUBLIC.TEST T1 /* PUBLIC.PRIMARY_KEY_2: ID IN(SELECT DISTINCT ID FROM PUBLIC.TEST /++ PUBLIC.TEST.tableScan ++/) */ WHERE ID IN(SELECT DISTINCT ID FROM PUBLIC.TEST /* PUBLIC.TEST.tableScan */) > SELECT T1.ID, T1.NAME FROM PUBLIC.TEST T1 /* PUBLIC.PRIMARY_KEY_2: ID IN(SELECT DISTINCT ID FROM PUBLIC.TEST /++ PUBLIC.TEST.tableScan ++/) */ WHERE ID IN( SELECT DISTINCT ID FROM PUBLIC.TEST /* PUBLIC.TEST.tableScan */)
> rows: 1 > rows: 1
select * from test t1 where id in(select id from test); select * from test t1 where id in(select id from test);
...@@ -3506,11 +3506,11 @@ script NOPASSWORDS NOSETTINGS; ...@@ -3506,11 +3506,11 @@ script NOPASSWORDS NOSETTINGS;
> ALTER TABLE PUBLIC.SP2 ADD CONSTRAINT PUBLIC.CONSTRAINT_1417 PRIMARY KEY(S_NO, P_NO); > ALTER TABLE PUBLIC.SP2 ADD CONSTRAINT PUBLIC.CONSTRAINT_1417 PRIMARY KEY(S_NO, P_NO);
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID); > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID);
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_27 FOREIGN KEY(PARENT) REFERENCES PUBLIC.TEST(ID) NOCHECK; > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_27 FOREIGN KEY(PARENT) REFERENCES PUBLIC.TEST(ID) NOCHECK;
> CREATE MEMORY TABLE PUBLIC.P( P_NO VARCHAR(5) NOT NULL, DESCR VARCHAR(16), COLOR VARCHAR(8) ); > CREATE MEMORY TABLE PUBLIC.P( P_NO VARCHAR(5) NOT NULL, DESCR VARCHAR(16), COLOR VARCHAR(8) );
> CREATE MEMORY TABLE PUBLIC.S( S_NO VARCHAR(5) NOT NULL, NAME VARCHAR(16), CITY VARCHAR(16) ); > CREATE MEMORY TABLE PUBLIC.S( S_NO VARCHAR(5) NOT NULL, NAME VARCHAR(16), CITY VARCHAR(16) );
> CREATE MEMORY TABLE PUBLIC.SP1( S_NO VARCHAR(5) NOT NULL, P_NO VARCHAR(5) NOT NULL, QTY INT ); > CREATE MEMORY TABLE PUBLIC.SP1( S_NO VARCHAR(5) NOT NULL, P_NO VARCHAR(5) NOT NULL, QTY INT );
> CREATE MEMORY TABLE PUBLIC.SP2( S_NO VARCHAR(5) NOT NULL, P_NO VARCHAR(5) NOT NULL, QTY INT ); > CREATE MEMORY TABLE PUBLIC.SP2( S_NO VARCHAR(5) NOT NULL, P_NO VARCHAR(5) NOT NULL, QTY INT );
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, PARENT INT ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, PARENT INT );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> rows: 20 > rows: 20
...@@ -3793,7 +3793,7 @@ script NOPASSWORDS NOSETTINGS drop; ...@@ -3793,7 +3793,7 @@ script NOPASSWORDS NOSETTINGS drop;
> -- 0 +/- SELECT COUNT(*) FROM S.TEST; > -- 0 +/- SELECT COUNT(*) FROM S.TEST;
> CREATE FORCE TRIGGER S.TEST_TRIGGER BEFORE INSERT ON S.TEST QUEUE 1024 CALL "org.h2.test.db.TestTriggersConstraints"; > CREATE FORCE TRIGGER S.TEST_TRIGGER BEFORE INSERT ON S.TEST QUEUE 1024 CALL "org.h2.test.db.TestTriggersConstraints";
> CREATE INDEX S.INDEX_ID ON S.TEST(ID); > CREATE INDEX S.INDEX_ID ON S.TEST(ID);
> CREATE MEMORY TABLE S.TEST( ID INT ); > CREATE MEMORY TABLE S.TEST( ID INT );
> CREATE SCHEMA IF NOT EXISTS S AUTHORIZATION SA; > CREATE SCHEMA IF NOT EXISTS S AUTHORIZATION SA;
> CREATE SEQUENCE S.SEQ START WITH 10; > CREATE SEQUENCE S.SEQ START WITH 10;
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
...@@ -3829,7 +3829,7 @@ script NOPASSWORDS NOSETTINGS drop; ...@@ -3829,7 +3829,7 @@ script NOPASSWORDS NOSETTINGS drop;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.ABC FOREIGN KEY(I) REFERENCES PUBLIC.TEST(I) NOCHECK; > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.ABC FOREIGN KEY(I) REFERENCES PUBLIC.TEST(I) NOCHECK;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(I); > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(I);
> CREATE INDEX PUBLIC.IDX_N_ID ON PUBLIC.TEST(NAME, I); > CREATE INDEX PUBLIC.IDX_N_ID ON PUBLIC.TEST(NAME, I);
> CREATE MEMORY TABLE PUBLIC.TEST( I INT NOT NULL, NAME VARCHAR(255), Y INT AS (I + 1) ); > CREATE MEMORY TABLE PUBLIC.TEST( I INT NOT NULL, NAME VARCHAR(255), Y INT AS (I + 1) );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> DROP TABLE IF EXISTS PUBLIC.TEST; > DROP TABLE IF EXISTS PUBLIC.TEST;
> INSERT INTO PUBLIC.TEST(I, NAME, Y) VALUES (1, 'Hello', 2); > INSERT INTO PUBLIC.TEST(I, NAME, Y) VALUES (1, 'Hello', 2);
...@@ -4172,10 +4172,10 @@ create sequence test_seq; ...@@ -4172,10 +4172,10 @@ create sequence test_seq;
script NODATA NOPASSWORDS NOSETTINGS drop; script NODATA NOPASSWORDS NOSETTINGS drop;
> SCRIPT > SCRIPT
> ------------------------------------------------------------------------------ > ---------------------------------------------------------------------------
> -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID); > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID);
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, IM_IE VARCHAR(10) ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, IM_IE VARCHAR(10) );
> CREATE SEQUENCE PUBLIC.TEST_SEQ START WITH 1; > CREATE SEQUENCE PUBLIC.TEST_SEQ START WITH 1;
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> DROP SEQUENCE IF EXISTS PUBLIC.TEST_SEQ; > DROP SEQUENCE IF EXISTS PUBLIC.TEST_SEQ;
...@@ -4281,15 +4281,15 @@ ALTER TABLE TEST ALTER COLUMN PARENTID VARCHAR; ...@@ -4281,15 +4281,15 @@ ALTER TABLE TEST ALTER COLUMN PARENTID VARCHAR;
> ok > ok
ALTER TABLE TEST DROP COLUMN PARENTID; ALTER TABLE TEST DROP COLUMN PARENTID;
> exception > ok
ALTER TABLE TEST DROP COLUMN CHILD_ID; ALTER TABLE TEST DROP COLUMN CHILD_ID;
> ok > ok
SELECT * FROM TEST; SELECT * FROM TEST;
> ID PARENTID > ID
> -- -------- > --
> 0 0 > 0
> rows: 1 > rows: 1
DROP TABLE TEST; DROP TABLE TEST;
...@@ -4860,10 +4860,10 @@ insert into test values(2, 'Cafe', X'cafe'); ...@@ -4860,10 +4860,10 @@ insert into test values(2, 'Cafe', X'cafe');
script simple nopasswords nosettings; script simple nopasswords nosettings;
> SCRIPT > SCRIPT
> ------------------------------------------------------------------------------- > ---------------------------------------------------------------------------
> -- 3 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 3 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID); > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID);
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, C CLOB, B BLOB ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, C CLOB, B BLOB );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> INSERT INTO PUBLIC.TEST(ID, C, B) VALUES(0, NULL, NULL); > INSERT INTO PUBLIC.TEST(ID, C, B) VALUES(0, NULL, NULL);
> INSERT INTO PUBLIC.TEST(ID, C, B) VALUES(1, '', X''); > INSERT INTO PUBLIC.TEST(ID, C, B) VALUES(1, '', X'');
...@@ -5313,7 +5313,7 @@ SCRIPT NOPASSWORDS NOSETTINGS; ...@@ -5313,7 +5313,7 @@ SCRIPT NOPASSWORDS NOSETTINGS;
> --------------------------------------------------------------------------- > ---------------------------------------------------------------------------
> -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID); > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID);
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> rows: 4 > rows: 4
...@@ -5394,13 +5394,13 @@ SELECT * FROM TEST_SEQ ORDER BY ID; ...@@ -5394,13 +5394,13 @@ SELECT * FROM TEST_SEQ ORDER BY ID;
SCRIPT SIMPLE NOPASSWORDS NOSETTINGS; SCRIPT SIMPLE NOPASSWORDS NOSETTINGS;
> SCRIPT > SCRIPT
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ > --------------------------------------------------------------------------------------------------------------------------------------------------------------
> -- 1 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 1 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> -- 4 +/- SELECT COUNT(*) FROM PUBLIC.TEST_SEQ; > -- 4 +/- SELECT COUNT(*) FROM PUBLIC.TEST_SEQ;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID); > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID);
> CREATE INDEX PUBLIC.IDXNAME ON PUBLIC.TEST(NAME); > CREATE INDEX PUBLIC.IDXNAME ON PUBLIC.TEST(NAME);
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, NAME VARCHAR(255) DEFAULT 1, CREATEDATE VARCHAR(255) DEFAULT '2001-01-01' NOT NULL, MODIFY_DATE TIMESTAMP ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, NAME VARCHAR(255) DEFAULT 1, CREATEDATE VARCHAR(255) DEFAULT '2001-01-01' NOT NULL, MODIFY_DATE TIMESTAMP );
> CREATE MEMORY TABLE PUBLIC.TEST_SEQ( ID INT DEFAULT 20 NOT NULL, DATA VARCHAR ); > CREATE MEMORY TABLE PUBLIC.TEST_SEQ( ID INT DEFAULT 20 NOT NULL, DATA VARCHAR );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> INSERT INTO PUBLIC.TEST(ID, NAME, CREATEDATE, MODIFY_DATE) VALUES(1, 'Hi', '2001-01-01', NULL); > INSERT INTO PUBLIC.TEST(ID, NAME, CREATEDATE, MODIFY_DATE) VALUES(1, 'Hi', '2001-01-01', NULL);
> INSERT INTO PUBLIC.TEST_SEQ(ID, DATA) VALUES(-1, '-1'); > INSERT INTO PUBLIC.TEST_SEQ(ID, DATA) VALUES(-1, '-1');
...@@ -5429,10 +5429,10 @@ DROP TABLE TEST_SEQ; ...@@ -5429,10 +5429,10 @@ DROP TABLE TEST_SEQ;
SCRIPT NOPASSWORDS NOSETTINGS; SCRIPT NOPASSWORDS NOSETTINGS;
> SCRIPT > SCRIPT
> --------------------------------------------------------------------------------------------------------------------------------------------- > ---------------------------------------------------------------------------------------------------------------------------------
> -- 1 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 1 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID); > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID);
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, CREATEDATE VARCHAR(255) DEFAULT '2001-01-01' NOT NULL, MODIFY_DATE TIMESTAMP ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, CREATEDATE VARCHAR(255) DEFAULT '2001-01-01' NOT NULL, MODIFY_DATE TIMESTAMP );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> INSERT INTO PUBLIC.TEST(ID, CREATEDATE, MODIFY_DATE) VALUES (1, '2001-01-01', NULL); > INSERT INTO PUBLIC.TEST(ID, CREATEDATE, MODIFY_DATE) VALUES (1, '2001-01-01', NULL);
> rows: 5 > rows: 5
...@@ -5442,10 +5442,10 @@ ALTER TABLE TEST ADD NAME VARCHAR(255) NULL BEFORE CREATEDATE; ...@@ -5442,10 +5442,10 @@ ALTER TABLE TEST ADD NAME VARCHAR(255) NULL BEFORE CREATEDATE;
SCRIPT NOPASSWORDS NOSETTINGS; SCRIPT NOPASSWORDS NOSETTINGS;
> SCRIPT > SCRIPT
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------- > ----------------------------------------------------------------------------------------------------------------------------------------------------
> -- 1 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 1 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID); > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID);
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, NAME VARCHAR(255), CREATEDATE VARCHAR(255) DEFAULT '2001-01-01' NOT NULL, MODIFY_DATE TIMESTAMP ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, NAME VARCHAR(255), CREATEDATE VARCHAR(255) DEFAULT '2001-01-01' NOT NULL, MODIFY_DATE TIMESTAMP );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> INSERT INTO PUBLIC.TEST(ID, NAME, CREATEDATE, MODIFY_DATE) VALUES (1, NULL, '2001-01-01', NULL); > INSERT INTO PUBLIC.TEST(ID, NAME, CREATEDATE, MODIFY_DATE) VALUES (1, NULL, '2001-01-01', NULL);
> rows: 5 > rows: 5
...@@ -5475,7 +5475,7 @@ SCRIPT NOPASSWORDS NOSETTINGS; ...@@ -5475,7 +5475,7 @@ SCRIPT NOPASSWORDS NOSETTINGS;
> --------------------------------------------------------------------------- > ---------------------------------------------------------------------------
> -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID); > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID);
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, NAME VARCHAR ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, NAME VARCHAR );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> rows: 4 > rows: 4
...@@ -5862,14 +5862,14 @@ EXPLAIN PLAN FOR SELECT * FROM TEST T1 WHERE ID IN(1, 2); ...@@ -5862,14 +5862,14 @@ EXPLAIN PLAN FOR SELECT * FROM TEST T1 WHERE ID IN(1, 2);
EXPLAIN PLAN FOR SELECT * FROM TEST T1 WHERE ID IN(SELECT ID FROM TEST); EXPLAIN PLAN FOR SELECT * FROM TEST T1 WHERE ID IN(SELECT ID FROM TEST);
> PLAN > PLAN
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> SELECT T1.ID, T1.NAME FROM PUBLIC.TEST T1 /* PUBLIC.PRIMARY_KEY_2: ID IN(SELECT DISTINCT ID FROM PUBLIC.TEST /++ PUBLIC.TEST.tableScan ++/) */ WHERE ID IN(SELECT DISTINCT ID FROM PUBLIC.TEST /* PUBLIC.TEST.tableScan */) > SELECT T1.ID, T1.NAME FROM PUBLIC.TEST T1 /* PUBLIC.PRIMARY_KEY_2: ID IN(SELECT DISTINCT ID FROM PUBLIC.TEST /++ PUBLIC.TEST.tableScan ++/) */ WHERE ID IN( SELECT DISTINCT ID FROM PUBLIC.TEST /* PUBLIC.TEST.tableScan */)
> rows: 1 > rows: 1
EXPLAIN PLAN FOR SELECT * FROM TEST T1 WHERE ID NOT IN(SELECT ID FROM TEST); EXPLAIN PLAN FOR SELECT * FROM TEST T1 WHERE ID NOT IN(SELECT ID FROM TEST);
> PLAN > PLAN
> -------------------------------------------------------------------------------------------------------------------------------------------------------- > ---------------------------------------------------------------------------------------------------------------------------------------------------------
> SELECT T1.ID, T1.NAME FROM PUBLIC.TEST T1 /* PUBLIC.TEST.tableScan */ WHERE NOT (ID IN(SELECT DISTINCT ID FROM PUBLIC.TEST /* PUBLIC.TEST.tableScan */)) > SELECT T1.ID, T1.NAME FROM PUBLIC.TEST T1 /* PUBLIC.TEST.tableScan */ WHERE NOT (ID IN( SELECT DISTINCT ID FROM PUBLIC.TEST /* PUBLIC.TEST.tableScan */))
> rows: 1 > rows: 1
EXPLAIN PLAN FOR SELECT CAST(ID AS VARCHAR(255)) FROM TEST; EXPLAIN PLAN FOR SELECT CAST(ID AS VARCHAR(255)) FROM TEST;
...@@ -7018,7 +7018,7 @@ SCRIPT SIMPLE NOPASSWORDS NOSETTINGS; ...@@ -7018,7 +7018,7 @@ SCRIPT SIMPLE NOPASSWORDS NOSETTINGS;
> SCRIPT > SCRIPT
> ---------------------------------------------------------------------------------------------------------------------------------- > ----------------------------------------------------------------------------------------------------------------------------------
> -- 4 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 4 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT, XT TIME, XD DATE, XTS TIMESTAMP ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT, XT TIME, XD DATE, XTS TIMESTAMP );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> INSERT INTO PUBLIC.TEST(ID, XT, XD, XTS) VALUES(0, TIME '00:00:00', DATE '0001-02-03', TIMESTAMP '0002-03-04 00:00:00.0'); > INSERT INTO PUBLIC.TEST(ID, XT, XD, XTS) VALUES(0, TIME '00:00:00', DATE '0001-02-03', TIMESTAMP '0002-03-04 00:00:00.0');
> INSERT INTO PUBLIC.TEST(ID, XT, XD, XTS) VALUES(1, TIME '01:02:03', DATE '0004-05-06', TIMESTAMP '0007-08-09 00:01:02.0'); > INSERT INTO PUBLIC.TEST(ID, XT, XD, XTS) VALUES(1, TIME '01:02:03', DATE '0004-05-06', TIMESTAMP '0007-08-09 00:01:02.0');
...@@ -7489,9 +7489,9 @@ insert into t values(1000000016, 16); ...@@ -7489,9 +7489,9 @@ insert into t values(1000000016, 16);
> update count: 1 > update count: 1
select * from s; select * from s;
> S_PX S_SX V_PX V_SX S_PY S_SY V_PY V_SY > S_PX S_SX V_PX V_SX S_PY S_SY V_PY V_SY
> ----------------- ----------------- ------------------ ---- ----------------- ----------------- ------------------ ---- > ----------------- ----------------- ----------------- ------------------ ----------------- ----------------- ----- ------------------
> 4.874423042781576 5.449770637375485 23.759999999999998 29.7 4.874423042781576 5.449770637375485 23.759999999999998 29.7 > 4.874423036912116 5.449770630813229 23.75999994277954 29.699999928474426 4.874423042781577 5.449770637375485 23.76 29.700000000000003
> rows: 1 > rows: 1
select stddev_pop(distinct x) s_px, stddev_samp(distinct x) s_sx, var_pop(distinct x) v_px, var_samp(distinct x) v_sx, select stddev_pop(distinct x) s_px, stddev_samp(distinct x) s_sx, var_pop(distinct x) v_px, var_samp(distinct x) v_sx,
...@@ -7920,8 +7920,8 @@ SCRIPT NOPASSWORDS NOSETTINGS; ...@@ -7920,8 +7920,8 @@ SCRIPT NOPASSWORDS NOSETTINGS;
> -- 0 +/- SELECT COUNT(*) FROM PUBLIC.PARENT; > -- 0 +/- SELECT COUNT(*) FROM PUBLIC.PARENT;
> ALTER TABLE PUBLIC.CHILD ADD CONSTRAINT PUBLIC.CONSTRAINT_3 FOREIGN KEY(PARENT_ID) REFERENCES PUBLIC.PARENT(ID) NOCHECK; > ALTER TABLE PUBLIC.CHILD ADD CONSTRAINT PUBLIC.CONSTRAINT_3 FOREIGN KEY(PARENT_ID) REFERENCES PUBLIC.PARENT(ID) NOCHECK;
> ALTER TABLE PUBLIC.PARENT ADD CONSTRAINT PUBLIC.CONSTRAINT_8 PRIMARY KEY(ID); > ALTER TABLE PUBLIC.PARENT ADD CONSTRAINT PUBLIC.CONSTRAINT_8 PRIMARY KEY(ID);
> CREATE MEMORY TABLE PUBLIC.CHILD( ID INT, PARENT_ID INT ); > CREATE MEMORY TABLE PUBLIC.CHILD( ID INT, PARENT_ID INT );
> CREATE MEMORY TABLE PUBLIC.PARENT( ID INT NOT NULL ); > CREATE MEMORY TABLE PUBLIC.PARENT( ID INT NOT NULL );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> rows: 7 > rows: 7
...@@ -7981,7 +7981,7 @@ SCRIPT NOPASSWORDS NOSETTINGS; ...@@ -7981,7 +7981,7 @@ SCRIPT NOPASSWORDS NOSETTINGS;
> ---------------------------------------------------------------------------------------------------------- > ----------------------------------------------------------------------------------------------------------
> -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.C1 FOREIGN KEY(A_INT) REFERENCES PUBLIC.TEST(B_INT) NOCHECK; > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.C1 FOREIGN KEY(A_INT) REFERENCES PUBLIC.TEST(B_INT) NOCHECK;
> CREATE MEMORY TABLE PUBLIC.TEST( A_INT INT NOT NULL, B_INT INT NOT NULL ); > CREATE MEMORY TABLE PUBLIC.TEST( A_INT INT NOT NULL, B_INT INT NOT NULL );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> rows: 4 > rows: 4
...@@ -8133,8 +8133,8 @@ SCRIPT NOPASSWORDS NOSETTINGS; ...@@ -8133,8 +8133,8 @@ SCRIPT NOPASSWORDS NOSETTINGS;
> ALTER TABLE PUBLIC.B_TEST ADD CONSTRAINT PUBLIC.C3 FOREIGN KEY(B_INT) REFERENCES PUBLIC.A_TEST(A_INT) ON DELETE SET DEFAULT ON UPDATE SET DEFAULT NOCHECK; > ALTER TABLE PUBLIC.B_TEST ADD CONSTRAINT PUBLIC.C3 FOREIGN KEY(B_INT) REFERENCES PUBLIC.A_TEST(A_INT) ON DELETE SET DEFAULT ON UPDATE SET DEFAULT NOCHECK;
> ALTER TABLE PUBLIC.B_TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_76 CHECK(LENGTH(B_VARCHAR) > 1) NOCHECK; > ALTER TABLE PUBLIC.B_TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_76 CHECK(LENGTH(B_VARCHAR) > 1) NOCHECK;
> ALTER TABLE PUBLIC.B_TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_760 PRIMARY KEY(B_INT); > ALTER TABLE PUBLIC.B_TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_760 PRIMARY KEY(B_INT);
> CREATE MEMORY TABLE PUBLIC.A_TEST( A_INT INT NOT NULL, A_VARCHAR VARCHAR(255) DEFAULT 'x', A_DATE DATE, A_DECIMAL DECIMAL(10, 2) ); > CREATE MEMORY TABLE PUBLIC.A_TEST( A_INT INT NOT NULL, A_VARCHAR VARCHAR(255) DEFAULT 'x', A_DATE DATE, A_DECIMAL DECIMAL(10, 2) );
> CREATE MEMORY TABLE PUBLIC.B_TEST( B_INT INT DEFAULT -1 NOT NULL, B_VARCHAR VARCHAR(255) DEFAULT NULL ); > CREATE MEMORY TABLE PUBLIC.B_TEST( B_INT INT DEFAULT -1 NOT NULL, B_VARCHAR VARCHAR(255) DEFAULT NULL );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> INSERT INTO PUBLIC.B_TEST(B_INT, B_VARCHAR) VALUES (-1, 'XX'); > INSERT INTO PUBLIC.B_TEST(B_INT, B_VARCHAR) VALUES (-1, 'XX');
> rows: 14 > rows: 14
...@@ -8231,9 +8231,9 @@ SCRIPT SIMPLE NOPASSWORDS NOSETTINGS; ...@@ -8231,9 +8231,9 @@ SCRIPT SIMPLE NOPASSWORDS NOSETTINGS;
> ALTER TABLE PUBLIC.CHILD ADD CONSTRAINT PUBLIC.PARENT_CHILD FOREIGN KEY(PARENTID, FAMILY_ID) REFERENCES PUBLIC.PARENT(ID, FAMILY_ID) ON DELETE SET NULL ON UPDATE CASCADE NOCHECK; > ALTER TABLE PUBLIC.CHILD ADD CONSTRAINT PUBLIC.PARENT_CHILD FOREIGN KEY(PARENTID, FAMILY_ID) REFERENCES PUBLIC.PARENT(ID, FAMILY_ID) ON DELETE SET NULL ON UPDATE CASCADE NOCHECK;
> ALTER TABLE PUBLIC.PARENT ADD CONSTRAINT PUBLIC.PARENT_FAMILY FOREIGN KEY(FAMILY_ID) REFERENCES PUBLIC.FAMILY(ID) NOCHECK; > ALTER TABLE PUBLIC.PARENT ADD CONSTRAINT PUBLIC.PARENT_FAMILY FOREIGN KEY(FAMILY_ID) REFERENCES PUBLIC.FAMILY(ID) NOCHECK;
> CREATE INDEX PUBLIC.FAMILY_ID_NAME ON PUBLIC.FAMILY(ID, NAME); > CREATE INDEX PUBLIC.FAMILY_ID_NAME ON PUBLIC.FAMILY(ID, NAME);
> CREATE MEMORY TABLE PUBLIC.CHILD( ID INT, PARENTID INT, FAMILY_ID INT, NAME VARCHAR(20) ); > CREATE MEMORY TABLE PUBLIC.CHILD( ID INT, PARENTID INT, FAMILY_ID INT, NAME VARCHAR(20) );
> CREATE MEMORY TABLE PUBLIC.FAMILY( ID INT, NAME VARCHAR(20) ); > CREATE MEMORY TABLE PUBLIC.FAMILY( ID INT, NAME VARCHAR(20) );
> CREATE MEMORY TABLE PUBLIC.PARENT( ID INT, FAMILY_ID INT, NAME VARCHAR(20) ); > CREATE MEMORY TABLE PUBLIC.PARENT( ID INT, FAMILY_ID INT, NAME VARCHAR(20) );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> INSERT INTO PUBLIC.CHILD(ID, PARENTID, FAMILY_ID, NAME) VALUES(100, 3, 1, 'Simon'); > INSERT INTO PUBLIC.CHILD(ID, PARENTID, FAMILY_ID, NAME) VALUES(100, 3, 1, 'Simon');
> INSERT INTO PUBLIC.CHILD(ID, PARENTID, FAMILY_ID, NAME) VALUES(101, 3, 1, 'Sabine'); > INSERT INTO PUBLIC.CHILD(ID, PARENTID, FAMILY_ID, NAME) VALUES(101, 3, 1, 'Sabine');
...@@ -8255,9 +8255,9 @@ SCRIPT SIMPLE NOPASSWORDS NOSETTINGS; ...@@ -8255,9 +8255,9 @@ SCRIPT SIMPLE NOPASSWORDS NOSETTINGS;
> ALTER TABLE PUBLIC.CHILD ADD CONSTRAINT PUBLIC.CONSTRAINT_3 UNIQUE(ID, PARENTID); > ALTER TABLE PUBLIC.CHILD ADD CONSTRAINT PUBLIC.CONSTRAINT_3 UNIQUE(ID, PARENTID);
> ALTER TABLE PUBLIC.PARENT ADD CONSTRAINT PUBLIC.PARENT_FAMILY FOREIGN KEY(FAMILY_ID) REFERENCES PUBLIC.FAMILY(ID) NOCHECK; > ALTER TABLE PUBLIC.PARENT ADD CONSTRAINT PUBLIC.PARENT_FAMILY FOREIGN KEY(FAMILY_ID) REFERENCES PUBLIC.FAMILY(ID) NOCHECK;
> CREATE INDEX PUBLIC.FAMILY_ID_NAME ON PUBLIC.FAMILY(ID, NAME); > CREATE INDEX PUBLIC.FAMILY_ID_NAME ON PUBLIC.FAMILY(ID, NAME);
> CREATE MEMORY TABLE PUBLIC.CHILD( ID INT, PARENTID INT, FAMILY_ID INT, NAME VARCHAR(20) ); > CREATE MEMORY TABLE PUBLIC.CHILD( ID INT, PARENTID INT, FAMILY_ID INT, NAME VARCHAR(20) );
> CREATE MEMORY TABLE PUBLIC.FAMILY( ID INT, NAME VARCHAR(20) ); > CREATE MEMORY TABLE PUBLIC.FAMILY( ID INT, NAME VARCHAR(20) );
> CREATE MEMORY TABLE PUBLIC.PARENT( ID INT, FAMILY_ID INT, NAME VARCHAR(20) ); > CREATE MEMORY TABLE PUBLIC.PARENT( ID INT, FAMILY_ID INT, NAME VARCHAR(20) );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> INSERT INTO PUBLIC.CHILD(ID, PARENTID, FAMILY_ID, NAME) VALUES(100, 3, 1, 'Simon'); > INSERT INTO PUBLIC.CHILD(ID, PARENTID, FAMILY_ID, NAME) VALUES(100, 3, 1, 'Simon');
> INSERT INTO PUBLIC.CHILD(ID, PARENTID, FAMILY_ID, NAME) VALUES(101, 3, 1, 'Sabine'); > INSERT INTO PUBLIC.CHILD(ID, PARENTID, FAMILY_ID, NAME) VALUES(101, 3, 1, 'Sabine');
...@@ -8333,7 +8333,7 @@ SCRIPT NOPASSWORDS NOSETTINGS; ...@@ -8333,7 +8333,7 @@ SCRIPT NOPASSWORDS NOSETTINGS;
> ------------------------------------------------------------------------------------------------------------ > ------------------------------------------------------------------------------------------------------------
> -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 FOREIGN KEY(B) REFERENCES PUBLIC.TEST(A) NOCHECK; > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 FOREIGN KEY(B) REFERENCES PUBLIC.TEST(A) NOCHECK;
> CREATE MEMORY TABLE PUBLIC.TEST( A INT, B INT ); > CREATE MEMORY TABLE PUBLIC.TEST( A INT, B INT );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> rows: 4 > rows: 4
...@@ -8379,13 +8379,13 @@ ALTER INDEX IDX_ID RENAME TO IDX_ID2; ...@@ -8379,13 +8379,13 @@ ALTER INDEX IDX_ID RENAME TO IDX_ID2;
SCRIPT NOPASSWORDS NOSETTINGS; SCRIPT NOPASSWORDS NOSETTINGS;
> SCRIPT > SCRIPT
> ------------------------------------------------------------------------------ > ---------------------------------------------------------------------------
> -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST2; > -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST2;
> -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 0 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID); > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID);
> CREATE INDEX PUBLIC.IDX_ID2 ON PUBLIC.TEST2(ID); > CREATE INDEX PUBLIC.IDX_ID2 ON PUBLIC.TEST2(ID);
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, NAME VARCHAR(255) ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, NAME VARCHAR(255) );
> CREATE MEMORY TABLE PUBLIC.TEST2( ID INT ); > CREATE MEMORY TABLE PUBLIC.TEST2( ID INT );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> CREATE USER IF NOT EXISTS TEST PASSWORD ''; > CREATE USER IF NOT EXISTS TEST PASSWORD '';
> CREATE USER IF NOT EXISTS TEST2 PASSWORD ''; > CREATE USER IF NOT EXISTS TEST2 PASSWORD '';
...@@ -8561,7 +8561,7 @@ script nopasswords nosettings; ...@@ -8561,7 +8561,7 @@ script nopasswords nosettings;
> ------------------------------------------------------------------------------------------------------------------------------------------------------------- > -------------------------------------------------------------------------------------------------------------------------------------------------------------
> -- 1 +/- SELECT COUNT(*) FROM PUBLIC.TEST; > -- 1 +/- SELECT COUNT(*) FROM PUBLIC.TEST;
> ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID); > ALTER TABLE PUBLIC.TEST ADD CONSTRAINT PUBLIC.CONSTRAINT_2 PRIMARY KEY(ID);
> CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, NAME VARCHAR(255) ); > CREATE MEMORY TABLE PUBLIC.TEST( ID INT NOT NULL, NAME VARCHAR(255) );
> CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN; > CREATE USER IF NOT EXISTS SA PASSWORD '' ADMIN;
> INSERT INTO PUBLIC.TEST(ID, NAME) VALUES (2, STRINGDECODE('abcsond\u00e4rzeich\u00e4 \u56ce \u00f6\u00e4\u00fc\u00d6\u00c4\u00dc\u00e9\u00e8\u00e0\u00f1!')); > INSERT INTO PUBLIC.TEST(ID, NAME) VALUES (2, STRINGDECODE('abcsond\u00e4rzeich\u00e4 \u56ce \u00f6\u00e4\u00fc\u00d6\u00c4\u00dc\u00e9\u00e8\u00e0\u00f1!'));
> rows: 5 > rows: 5
...@@ -8927,9 +8927,9 @@ select ltrim(null) en, '>' || ltrim('a') || '<' ea, '>' || ltrim(' a ') || '<' e ...@@ -8927,9 +8927,9 @@ select ltrim(null) en, '>' || ltrim('a') || '<' ea, '>' || ltrim(' a ') || '<' e
> rows: 1 > rows: 1
select TRIM(BOTH '_' FROM '__A__') A, TRIM(LEADING FROM ' B ') BS, TRIM(TRAILING 'x' FROM 'xAx') XA from test; select TRIM(BOTH '_' FROM '__A__') A, TRIM(LEADING FROM ' B ') BS, TRIM(TRAILING 'x' FROM 'xAx') XA from test;
> A BS XA > A BS XA
> - ----- -- > - -- --
> A B xA > A B xA
> rows: 1 > rows: 1
select rtrim(null) en, '>' || rtrim('a') || '<' ea, '>' || rtrim(' a ') || '<' es from test; select rtrim(null) en, '>' || rtrim('a') || '<' ea, '>' || rtrim(' a ') || '<' es from test;
...@@ -8974,8 +8974,8 @@ soundex('VanDeusen') V532, soundex('Ashcraft') A261 from test; ...@@ -8974,8 +8974,8 @@ soundex('VanDeusen') V532, soundex('Ashcraft') A261 from test;
select space(null) en, '>' || space(1) || '<' es, '>' || space(3) || '<' e2 from test; select space(null) en, '>' || space(1) || '<' es, '>' || space(3) || '<' e2 from test;
> EN ES E2 > EN ES E2
> ---- --- ----- > ---- --- ---
> null > < > < > null > < > <
> rows: 1 > rows: 1
select substr(null, null) en, substr(null, null, null) e1, substr('bob', 2) e_ob, substr('bob', 2, 1) eo from test; select substr(null, null) en, substr(null, null, null) e1, substr('bob', 2) e_ob, substr('bob', 2, 1) eo from test;
......
...@@ -13,6 +13,7 @@ import java.sql.ResultSet; ...@@ -13,6 +13,7 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import org.h2.api.DatabaseEventListener; import org.h2.api.DatabaseEventListener;
import org.h2.constant.ErrorCode;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.tools.Server; import org.h2.tools.Server;
...@@ -51,6 +52,7 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener ...@@ -51,6 +52,7 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener
} }
public void test() throws Exception { public void test() throws Exception {
testWrongUrl();
autoServer = true; autoServer = true;
testReconnect(); testReconnect();
autoServer = false; autoServer = false;
...@@ -58,6 +60,38 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener ...@@ -58,6 +60,38 @@ public class TestAutoReconnect extends TestBase implements DatabaseEventListener
deleteDb("autoReconnect"); deleteDb("autoReconnect");
} }
private void testWrongUrl() throws Exception {
deleteDb("autoReconnect");
Server tcp = Server.createTcpServer().start();
try {
Connection conn = getConnection("jdbc:h2:" + getBaseDir() + "/autoReconnect;AUTO_SERVER=TRUE");
try {
getConnection("jdbc:h2:" + getBaseDir() + "/autoReconnect;OPEN_NEW=TRUE");
fail();
} catch (SQLException e) {
assertEquals(ErrorCode.DATABASE_ALREADY_OPEN_1, e.getErrorCode());
}
try {
getConnection("jdbc:h2:" + getBaseDir() + "/autoReconnect;OPEN_NEW=TRUE");
fail();
} catch (SQLException e) {
assertEquals(ErrorCode.DATABASE_ALREADY_OPEN_1, e.getErrorCode());
}
conn.close();
conn = getConnection("jdbc:h2:tcp://localhost/" + getBaseDir() + "/autoReconnect");
try {
getConnection("jdbc:h2:" + getBaseDir() + "/autoReconnect;AUTO_SERVER=TRUE;OPEN_NEW=TRUE");
fail();
} catch (SQLException e) {
assertEquals(ErrorCode.DATABASE_ALREADY_OPEN_1, e.getErrorCode());
}
conn.close();
} finally {
tcp.stop();
}
}
private void testReconnect() throws Exception { private void testReconnect() throws Exception {
deleteDb("autoReconnect"); deleteDb("autoReconnect");
if (autoServer) { if (autoServer) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论