forked from babelfish-for-postgresql/babelfish_extensions
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support PRINT NULL and PRINT <empty string> (babelfish-for-postgresql…
…#2199) This PR introduces support for printing NULL and <empty string>. When the argument to PRINT is NULL or an empty string, a single space should be printed. However Babelfish currently prints <NULL> and an empty string, respectively. Signed-off-by: Rob Verschoor [email protected]
- Loading branch information
1 parent
c4d55c3
commit 0e3fd2c
Showing
8 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
drop procedure p1_print_null | ||
go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
create procedure p1_print_null as | ||
declare @v varchar = null | ||
print null | ||
print @v | ||
print '' | ||
set @v = '' | ||
print @v | ||
print ' ' | ||
print ' ' | ||
go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
-- Since the JDBC tests do not capture output from PRINT statements, these tests actually don't do anything | ||
-- Keeping them for when then moment comes that PRINT tests are supported | ||
-- prints a single space: | ||
print null | ||
go | ||
|
||
-- prints a single space: | ||
declare @v varchar = null | ||
print @v | ||
go | ||
-- prints a single space: | ||
print '' | ||
go | ||
|
||
-- prints a single space: | ||
declare @v varchar = '' | ||
print @v | ||
go | ||
|
||
-- prints a single space: | ||
print ' ' | ||
go | ||
|
||
-- prints two spaces: | ||
print ' ' | ||
go | ||
|
||
-- same set of tests as above, but inside a stored proc: | ||
exec p1_print_null | ||
go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
drop procedure p1_print_null | ||
go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
create procedure p1_print_null as | ||
declare @v varchar = null | ||
print null | ||
print @v | ||
print '' | ||
set @v = '' | ||
print @v | ||
print ' ' | ||
print ' ' | ||
go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
-- Since the JDBC tests do not capture output from PRINT statements, these tests actually don't do anything | ||
-- Keeping them for when then moment comes that PRINT tests are supported | ||
|
||
-- prints a single space: | ||
print null | ||
go | ||
|
||
-- prints a single space: | ||
declare @v varchar = null | ||
print @v | ||
go | ||
-- prints a single space: | ||
print '' | ||
go | ||
|
||
-- prints a single space: | ||
declare @v varchar = '' | ||
print @v | ||
go | ||
|
||
-- prints a single space: | ||
print ' ' | ||
go | ||
|
||
-- prints two spaces: | ||
print ' ' | ||
go | ||
|
||
-- same set of tests as above, but inside a stored proc: | ||
exec p1_print_null | ||
go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters