[PATCHES] test: untyped literal in CASE test expr

2005-01-16 Thread Neil Conway
This trivial patch adds a regression test for CASE expressions that use
an untyped literal in the CASE's test expression. This adds test
coverage for a bug that was fixed by Tom on Jan. 12

I intend to apply this once 8.0.0 is out the door, barring any
objections.

-Neil

Index: src/test/regress/expected/case.out
===
RCS file: /var/lib/cvs/pgsql/src/test/regress/expected/case.out,v
retrieving revision 1.7
diff -c -r1.7 case.out
*** src/test/regress/expected/case.out	1 Dec 2004 19:00:55 -	1.7
--- src/test/regress/expected/case.out	17 Jan 2005 02:51:17 -
***
*** 72,77 
--- 72,84 
   6   | 6
  (1 row)
  
+ -- Test for cases involving untyped literals in test expression
+ SELECT CASE 'a' WHEN 'a' THEN 1 ELSE 2 END;
+  case 
+ --
+ 1
+ (1 row)
+ 
  --
  -- Examples of targets involving tables
  --
Index: src/test/regress/sql/case.sql
===
RCS file: /var/lib/cvs/pgsql/src/test/regress/sql/case.sql,v
retrieving revision 1.4
diff -c -r1.4 case.sql
*** src/test/regress/sql/case.sql	6 Jan 2000 06:41:55 -	1.4
--- src/test/regress/sql/case.sql	17 Jan 2005 02:49:33 -
***
*** 58,63 
--- 58,66 
  ELSE 7
END AS "Two WHEN with default";
  
+ -- Test for cases involving untyped literals in test expression
+ SELECT CASE 'a' WHEN 'a' THEN 1 ELSE 2 END;
+ 
  --
  -- Examples of targets involving tables
  --

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [PATCHES] test: untyped literal in CASE test expr

2005-01-16 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> writes:
> This trivial patch adds a regression test for CASE expressions that use
> an untyped literal in the CASE's test expression. This adds test
> coverage for a bug that was fixed by Tom on Jan. 12
> I intend to apply this once 8.0.0 is out the door, barring any
> objections.

I had intended to put in something like that myself, but forgot.  Feel
free to apply now.

regards, tom lane

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] test: untyped literal in CASE test expr

2005-01-16 Thread Neil Conway
On Sun, 2005-01-16 at 22:31 -0500, Tom Lane wrote:
> I had intended to put in something like that myself, but forgot.  Feel
> free to apply now.

Applied.

-Neil



---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster