Changeset 27 for trunk/epic
- Timestamp:
- 05/31/09 11:31:09 (3 years ago)
- Location:
- trunk/epic
- Files:
-
- 1 added
- 1 modified
-
epic.sql (modified) (4 diffs)
-
test/test_core.sql (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/epic/epic.sql
r25 r27 212 212 213 213 CREATE OR REPLACE FUNCTION test.statement(call text) RETURNS text AS $$ 214 -- Returns the given SQL string, prepending "SELECT * FROM " if missing. 214 215 DECLARE 215 216 result text; 216 217 BEGIN 217 218 result := rtrim(call, ';'); 218 IF NOT result ILIKE 'SELECT%' THEN219 IF NOT result ~* '^[[:space:]]*SELECT[[:space:]]' THEN 219 220 result := 'SELECT * FROM ' || result; 220 221 END IF; … … 228 229 229 230 CREATE OR REPLACE FUNCTION test._ensure_globals() RETURNS boolean AS $$ 231 -- Creates the global id sequence if it does not already exist. 230 232 BEGIN 231 233 SET client_min_messages = warning; … … 703 705 -- 704 706 -- PERFORM test.assert_rows('SELECT first, last, city FROM table1', 705 -- 'SELECT ''Davy'', ''Crockett'', NULL' ;707 -- 'SELECT ''Davy'', ''Crockett'', NULL'); 706 708 DECLARE 707 709 rec record; … … 752 754 -- Dump the call output into a temp table 753 755 IF colname IS NULL THEN 756 -- No colname; instead, create the temp table and then read the catalog 757 -- to grab the name of the first column. 754 758 EXECUTE 'CREATE TEMPORARY TABLE _test_assert_column_base AS ' || test.statement(call); 755 759 SELECT INTO firstname a.attname
