[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3412] trunk/sql/modules/test



Revision: 3412
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3412&view=rev
Author:   einhverfr
Date:     2011-07-02 10:46:38 +0000 (Sat, 02 Jul 2011)

Log Message:
-----------

Better performance on system tests by hitting Pg catalogs directly.
Fix to Payments sql tests

Modified Paths:
--------------
    trunk/sql/modules/test/Payment.sql
    trunk/sql/modules/test/System.sql

Modified: trunk/sql/modules/test/Payment.sql
===================================================================
--- trunk/sql/modules/test/Payment.sql	2011-07-02 06:17:47 UTC (rev 3411)
+++ trunk/sql/modules/test/Payment.sql	2011-07-02 10:46:38 UTC (rev 3412)
@@ -21,9 +21,6 @@
 INSERT INTO test_result(test_name, success)
 SELECT 'AP Batch created', (SELECT batch_create('test', 'test', 'ap', now()::date)) IS NOT NULL;
 
-INSERT INTO entity (id, entity_class, name, control_code, country_id)
-VALUES (-101, 1, 'TEST VENDOR', 'TEST 2', 242);
-
 INSERT INTO company (id, legal_name, entity_id)
 VALUES (-101, 'TEST', -101);
 

Modified: trunk/sql/modules/test/System.sql
===================================================================
--- trunk/sql/modules/test/System.sql	2011-07-02 06:17:47 UTC (rev 3411)
+++ trunk/sql/modules/test/System.sql	2011-07-02 10:46:38 UTC (rev 3412)
@@ -63,22 +63,11 @@
 having count(*) > 1;
 
 CREATE TEMPORARY table permissionless_tables AS
-select t.table_catalog, t.table_schema, t.table_type, t.table_name
-from information_schema.tables t
-where t.table_catalog = current_database()
-  and t.table_schema = 'public'
-  and not exists (
-    select *
-    from information_schema.role_table_grants r
-    where r.table_catalog = t.table_catalog
-      and r.table_schema = t.table_schema
-      and r.table_name = t.table_name
-      )
-  and not exists (
-     select *
-     from test_exempt_tables x
-     where x.tablename = t.table_name)
-order by t.table_catalog, t.table_schema, t.table_type, t.table_name;
+SELECT nspname, relname
+  FROM pg_namespace nsp
+  JOIN pg_class rel ON (relkind = 'r' and nsp.oid = rel.relnamespace)
+ WHERE nspname = 'public' AND relacl IS NULL and relname NOT IN 
+       (select tablename from test_exempt_tables);
 
 select * from permissionless_tables;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.