Changeset 27

Show
Ignore:
Timestamp:
05/31/09 11:31:09 (3 years ago)
Author:
fumanchu
Message:

Fixed leading whitespace issues in test.statement.

Location:
trunk/epic
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/epic/epic.sql

    r25 r27  
    212212 
    213213CREATE OR REPLACE FUNCTION test.statement(call text) RETURNS text AS $$ 
     214-- Returns the given SQL string, prepending "SELECT * FROM " if missing. 
    214215DECLARE 
    215216  result    text; 
    216217BEGIN 
    217218  result := rtrim(call, ';'); 
    218   IF NOT result ILIKE 'SELECT%' THEN 
     219  IF NOT result ~* '^[[:space:]]*SELECT[[:space:]]' THEN 
    219220    result := 'SELECT * FROM ' || result; 
    220221  END IF; 
     
    228229 
    229230CREATE OR REPLACE FUNCTION test._ensure_globals() RETURNS boolean AS $$ 
     231-- Creates the global id sequence if it does not already exist. 
    230232BEGIN 
    231233  SET client_min_messages = warning; 
     
    703705--  
    704706--    PERFORM test.assert_rows('SELECT first, last, city FROM table1', 
    705 --                             'SELECT ''Davy'', ''Crockett'', NULL'; 
     707--                             'SELECT ''Davy'', ''Crockett'', NULL'); 
    706708DECLARE 
    707709  rec     record; 
     
    752754  -- Dump the call output into a temp table 
    753755  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. 
    754758    EXECUTE 'CREATE TEMPORARY TABLE _test_assert_column_base AS ' || test.statement(call); 
    755759    SELECT INTO firstname a.attname