Skip to content

Commit

Permalink
adddressing comments
Browse files Browse the repository at this point in the history
Signed-off-by: yashneet vinayak <yashneet@amazon.com>
  • Loading branch information
yashneet vinayak committed Feb 13, 2025
1 parent 1286899 commit 2df9e5d
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
SELECT set_config('search_path', 'sys, '|| current_setting('search_path'), false);

CREATE OR REPLACE FUNCTION sys.varbinary2datetime(sys.BBF_VARBINARY)
RETURNS DATETIME
RETURNS sys.DATETIME
AS 'babelfishpg_common', 'varbinary_datetime'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

CREATE CAST (sys.BBF_VARBINARY AS DATETIME)
CREATE CAST (sys.BBF_VARBINARY AS sys.DATETIME)
WITH FUNCTION sys.varbinary2datetime(sys.BBF_VARBINARY) AS IMPLICIT;

-- Reset search_path to not affect any subsequent scripts
Expand Down
2 changes: 2 additions & 0 deletions test/JDBC/expected/babel_datetime-vu-cleanup.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ drop view babel_datetime_vu_view2
go
drop procedure babel_datetime_vu_procedure
go
drop function babel_datetime_vu_function1
go
8 changes: 8 additions & 0 deletions test/JDBC/expected/babel_datetime-vu-prepare.out
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,11 @@ BEGIN
select cast(0x00008EE700C5C100 as datetime)
END;
GO

CREATE FUNCTION babel_datetime_vu_function1 (@inputdate DATETIME)
RETURNS varchar(50)
AS
BEGIN
RETURN @inputdate
END
GO
8 changes: 8 additions & 0 deletions test/JDBC/expected/babel_datetime-vu-verify.out
Original file line number Diff line number Diff line change
Expand Up @@ -888,3 +888,11 @@ datetime
2000-02-29 12:00:00.0
~~END~~


SELECT babel_datetime_vu_function1(0x0000B02200EF28C1)
GO
~~START~~
varchar
2023-06-15 14:30:45.123
~~END~~

2 changes: 2 additions & 0 deletions test/JDBC/input/babel_datetime-vu-cleanup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ drop view babel_datetime_vu_view2
go
drop procedure babel_datetime_vu_procedure
go
drop function babel_datetime_vu_function1
go
10 changes: 9 additions & 1 deletion test/JDBC/input/babel_datetime-vu-prepare.sql
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,12 @@ AS
BEGIN
select cast(0x00008EE700C5C100 as datetime)
END;
GO
GO

CREATE FUNCTION babel_datetime_vu_function1 (@inputdate DATETIME)
RETURNS varchar(50)
AS
BEGIN
RETURN @inputdate
END
GO
3 changes: 3 additions & 0 deletions test/JDBC/input/babel_datetime-vu-verify.sql
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,6 @@ GO

EXEC babel_datetime_vu_procedure
GO

SELECT babel_datetime_vu_function1(0x0000B02200EF28C1)
GO

0 comments on commit 2df9e5d

Please sign in to comment.