Changeset: eee085d75277 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=eee085d75277
Added Files:
        geom/sql/Tests/pg_regression/Tests/ctors.sql
        geom/sql/Tests/pg_regression/Tests/long_xact.sql
Modified Files:
        geom/sql/Tests/pg_regression/Tests/All
Branch: geo
Log Message:

pg_regress: ctors + long_xact test file


diffs (108 lines):

diff --git a/geom/sql/Tests/pg_regression/Tests/All 
b/geom/sql/Tests/pg_regression/Tests/All
--- a/geom/sql/Tests/pg_regression/Tests/All
+++ b/geom/sql/Tests/pg_regression/Tests/All
@@ -40,4 +40,10 @@
 
 #legacy #It is PostGIS specific to make sure that it is compatible with oldre 
PostGIS versions
 
+#long_xact #Tests PostGIS transactions
+
+#ctors #Unknown Functions: st_3dmakebox
+       #ST_MakeLine gives different results compared to PostGIS
+
+
 removeTmpFiles
diff --git a/geom/sql/Tests/pg_regression/Tests/ctors.sql 
b/geom/sql/Tests/pg_regression/Tests/ctors.sql
new file mode 100644
--- /dev/null
+++ b/geom/sql/Tests/pg_regression/Tests/ctors.sql
@@ -0,0 +1,23 @@
+SELECT ST_SRID(ST_Collect(ST_GeomFromText('POINT(0 0)', 32749), 
ST_GeomFromText('POINT(1 1)', 32749)));
+
+SELECT ST_Collect(ST_GeomFromText('POINT(0 0)', 32749), 
ST_GeomFromText('POINT(1 1)', 32740));
+
+select ST_asewkt(ST_makeline(ST_GeomFromText('POINT(0 0)', 3), 
ST_GeomFromText('POINT(1 1)', 3)));
+select ST_makeline(ST_GeomFromText('POINT(0 0)'), ST_GeomFromText('POINT(1 
1)', 3));
+
+select 'ST_MakeLine1', ST_AsText(ST_MakeLine(
+ ST_GeomFromText('POINT(0 0)'),
+ ST_GeomFromText('LINESTRING(1 1, 10 0)')));
+
+select 'ST_MakeLine_agg1', ST_AsText(ST_MakeLine(g)) from (
+ values (ST_GeomFromText('POINT(0 0)')),
+        (ST_GeomFromText('LINESTRING(1 1, 10 0)')),
+        (ST_GeomFromText('LINESTRING(10 0, 20 20)')),
+        (ST_GeomFromText('POINT(40 4)'))
+) as foo(g);
+
+select ST_makebox2d(ST_GeomFromText('POINT(0 0)', 3), ST_GeomFromText('POINT(1 
1)', 3));
+select ST_makebox2d(ST_GeomFromText('POINT(0 0)'), ST_GeomFromText('POINT(1 
1)', 3));
+
+select ST_3DMakeBox(ST_GeomFromText('POINT(0 0)', 3), ST_GeomFromText('POINT(1 
1)', 3));
+select ST_3DMakeBox(ST_GeomFromText('POINT(0 0)'), ST_GeomFromText('POINT(1 
1)', 3));
diff --git a/geom/sql/Tests/pg_regression/Tests/long_xact.sql 
b/geom/sql/Tests/pg_regression/Tests/long_xact.sql
new file mode 100644
--- /dev/null
+++ b/geom/sql/Tests/pg_regression/Tests/long_xact.sql
@@ -0,0 +1,61 @@
+
+SELECT EnableLongTransactions();
+
+CREATE TABLE test_locks (id numeric, state varchar);
+INSERT INTO test_locks(id) VALUES (1);
+INSERT INTO test_locks(id) VALUES (2);
+INSERT INTO test_locks(id) VALUES (3);
+
+-- Enable locks checking on the table
+SELECT CheckAuth('test_locks', 'id');
+
+-- this has no lock
+UPDATE test_locks SET state = 'nolocks';
+
+-- place the lock
+SELECT LockRow('test_locks', '1', 'auth1', now()::timestamp+'00:01');
+SELECT LockRow('test_locks', '2', 'auth2', now()::timestamp+'00:01');
+
+-- this should fail due to missing auth
+UPDATE test_locks SET state = 'unauthorized' where id = 1;
+
+BEGIN;
+
+       -- Add authorization for row 1
+       SELECT AddAuth('auth1');
+
+       -- we're authorized for row 1
+       UPDATE test_locks SET state = 'authorized' where id = 1;
+END;
+
+-- Out of transaction we're no more authorized for row 1
+UPDATE test_locks SET state = 'unauthorized' where id = 1;
+
+BEGIN;
+
+       -- Add authorization for row 2
+       SELECT AddAuth('auth2');
+
+       -- we're authorized for row 2
+       UPDATE test_locks SET state = 'authorized' where id = 2;
+END;
+
+
+BEGIN;
+
+       -- Add authorization for row 2
+       SELECT AddAuth('auth2');
+
+       -- we're *not* authorized for row 1
+       UPDATE test_locks SET state = 'unauthorized' where id = 1;
+END;
+
+UPDATE test_locks SET state = 'unauthorized' where id = 2;
+UPDATE test_locks SET state = 'unauthorized' where id = 1;
+
+SELECT * from test_locks;
+
+DROP TABLE test_locks;
+
+SELECT DisableLongTransactions();
+
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to