From 178efcef20c90ae4019d11b0130b324958ffc23d Mon Sep 17 00:00:00 2001 From: totaj Date: Sat, 16 Sep 2023 16:37:45 +0800 Subject: [PATCH] Support ERROR_FOR_DIVISION_BY_ZERO. --- .../b_compatibility_time_funcs3.out | 2 +- .../expected/case_sensitive_test/temp.out | 1005 +++++++++- .../case_sensitive_test_backquote/temp.out | 1005 +++++++++- .../m_type_create_proc.out | 25 +- contrib/dolphin/expected/db_b_parser3.out | 1727 ++++++++++++++++- .../json_operator_test.out | 656 ++++++- .../numeric_operator_test_min.out | 1 + .../string_operator_test.out | 22 - .../dolphin/expected/pl_debugger_client.out | 4 +- .../dolphin/expected/pl_debugger_server.out | 4 +- .../dolphin/expected/test_mysql_operator.out | 5 +- .../include/plugin_commands/mysqlmode.h | 18 +- .../dolphin/output/dump_dumpall_test.source | 6 +- contrib/dolphin/plugin_postgres.cpp | 5 +- contrib/dolphin/plugin_utils/adt/cash.cpp | 54 +- contrib/dolphin/plugin_utils/adt/float.cpp | 34 +- contrib/dolphin/plugin_utils/adt/int.cpp | 31 +- contrib/dolphin/plugin_utils/adt/int16.cpp | 4 + contrib/dolphin/plugin_utils/adt/int8.cpp | 24 + contrib/dolphin/plugin_utils/adt/numeric.cpp | 223 ++- .../dolphin/plugin_utils/adt/timestamp.cpp | 7 +- .../plugin_vector/vecprimitive/numeric.inl | 27 + .../plugin_vector/vecprimitive/varchar.inl | 2 +- .../rollback_script/dolphin--2.0--1.1.sql | 17 +- .../m_type_create_proc.sql | 1 + contrib/dolphin/sql/db_b_parser3.sql | 399 ++++ .../numeric_operator_test_min.sql | 2 +- .../upgrade_script/dolphin--1.1--2.0.sql | 17 +- 28 files changed, 5063 insertions(+), 264 deletions(-) diff --git a/contrib/dolphin/expected/builtin_funcs/b_compatibility_time_funcs3.out b/contrib/dolphin/expected/builtin_funcs/b_compatibility_time_funcs3.out index 56ffe8c2a..cdeb6ba28 100644 --- a/contrib/dolphin/expected/builtin_funcs/b_compatibility_time_funcs3.out +++ b/contrib/dolphin/expected/builtin_funcs/b_compatibility_time_funcs3.out @@ -402,7 +402,7 @@ CONTEXT: referenced column: to_seconds select to_seconds(time'-838:59:59'); to_seconds ------------- - 63859366801 + 63859453201 (1 row) drop schema b_time_funcs3 cascade; diff --git a/contrib/dolphin/expected/case_sensitive_test/temp.out b/contrib/dolphin/expected/case_sensitive_test/temp.out index c19cb2aca..e08249f64 100644 --- a/contrib/dolphin/expected/case_sensitive_test/temp.out +++ b/contrib/dolphin/expected/case_sensitive_test/temp.out @@ -288,7 +288,1010 @@ select relname, relpages, reltuples from pg_class where relname = 'temp_col2'; Analyze temp_col2; --Use select a/0 from test_temp1; -ERROR: division by zero + ?column? +---------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +(1000 rows) + select * from test_temp1 order by 1 limit 30; a | b ----+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/contrib/dolphin/expected/case_sensitive_test_backquote/temp.out b/contrib/dolphin/expected/case_sensitive_test_backquote/temp.out index 11c221283..9945bb59b 100644 --- a/contrib/dolphin/expected/case_sensitive_test_backquote/temp.out +++ b/contrib/dolphin/expected/case_sensitive_test_backquote/temp.out @@ -284,7 +284,1010 @@ select `relname`, `relpages`, `reltuples` from `pg_class` where `relname` = '`te Analyze `temp_col2`; --Use select `a`/0 from `test_temp1`; -ERROR: division by zero + ?column? +---------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +(1000 rows) + select * from `test_temp1` order by 1 limit 30; a | b ----+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/contrib/dolphin/expected/create_function_test/m_type_create_proc.out b/contrib/dolphin/expected/create_function_test/m_type_create_proc.out index 84410d3c4..ffbbd71eb 100644 --- a/contrib/dolphin/expected/create_function_test/m_type_create_proc.out +++ b/contrib/dolphin/expected/create_function_test/m_type_create_proc.out @@ -6,6 +6,7 @@ CREATE ROLE us2 IDENTIFIED BY 'Aa@123456'; NOTICE: The iteration value of password is not recommended.Setting the iteration value too small reduces the security of the password, and setting it too large results in performance degradation. GRANT ALL ON SCHEMA m_create_proc_type TO us2; SET ROLE us2 PASSWORD 'Aa@123456'; +set dolphin.sql_mode = 'sql_mode_strict,pipes_as_concat,ansi_quotes,no_zero_date,error_for_division_by_zero'; --test create procedure delimiter // CREATE PROCEDURE p() @@ -170,18 +171,18 @@ CREATE PROCEDURE testpro_m6(a int) end// delimiter ; show create procedure testpro_m6; - Procedure | Create Procedure | sql_mode | character_set_client | collation_connection | Database Collation -------------+---------------------------------------------------------------------+------------------------------------------------------------------------------------------------------+----------------------+----------------------+-------------------- - testpro_m6 | CREATE DEFINER = us2 PROCEDURE m_create_proc_type.testpro_m6(a int)+| sql_mode_strict,sql_mode_full_group,pipes_as_concat,ansi_quotes,no_zero_date,pad_char_to_full_length | UTF8 | en_US.UTF-8 | en_US.UTF-8 - | BEGIN declare b int; +| | | | - | declare c int; +| | | | - | b:= 9; +| | | | - | insert into test values (a + b); +| | | | - | begin +| | | | - | insert into test values (a + b); +| | | | - | end; +| | | | - | end; +| | | | - | | | | | + Procedure | Create Procedure | sql_mode | character_set_client | collation_connection | Database Collation +------------+---------------------------------------------------------------------+-------------------------------------------------------------------------------------+----------------------+----------------------+-------------------- + testpro_m6 | CREATE DEFINER = us2 PROCEDURE m_create_proc_type.testpro_m6(a int)+| sql_mode_strict,pipes_as_concat,ansi_quotes,no_zero_date,error_for_division_by_zero | UTF8 | en_US.UTF-8 | en_US.UTF-8 + | BEGIN declare b int; +| | | | + | declare c int; +| | | | + | b:= 9; +| | | | + | insert into test values (a + b); +| | | | + | begin +| | | | + | insert into test values (a + b); +| | | | + | end; +| | | | + | end; +| | | | + | | | | | (1 row) delimiter // diff --git a/contrib/dolphin/expected/db_b_parser3.out b/contrib/dolphin/expected/db_b_parser3.out index da422d80b..5aa3ca3c1 100644 --- a/contrib/dolphin/expected/db_b_parser3.out +++ b/contrib/dolphin/expected/db_b_parser3.out @@ -122,8 +122,11 @@ select 8 div 3; (1 row) select 8 div 0; -ERROR: division by zero -CONTEXT: referenced column: div + div +----- + +(1 row) + select 8div 3, 8div 3div2, 8div 3div 2; div | div2 | div -----+------+----- @@ -169,8 +172,11 @@ WARNING: invalid input syntax for type numeric: "-12.3abc" LINE 1: select '-12.3abc' div 0; ^ CONTEXT: referenced column: div -ERROR: division by zero -CONTEXT: referenced column: div + div +----- + +(1 row) + select '-12.3abc' div 5; WARNING: invalid input syntax for type numeric: "-12.3abc" LINE 1: select '-12.3abc' div 5; @@ -216,15 +222,21 @@ WARNING: invalid input syntax for type numeric: "-12.3abc" LINE 1: select '-12.3abc' div false; ^ CONTEXT: referenced column: div -ERROR: division by zero -CONTEXT: referenced column: div + div +----- + +(1 row) + select '-12.3abc' div 'null'; WARNING: invalid input syntax for type numeric: "-12.3abc" LINE 1: select '-12.3abc' div 'null'; ^ CONTEXT: referenced column: div -ERROR: division by zero -CONTEXT: referenced column: div + div +----- + +(1 row) + select 123456 div 5 div 4; div ------ @@ -242,6 +254,1693 @@ select 8 div 3 where 100 div 3 div 4 > 0; 2 (1 row) +set dolphin.b_compatibility_mode to on; +create table tmp_res(a int); +create table div_test( +c1 int1, +c2 int2, +c3 int4, +c4 int8, +c5 uint1, +c6 uint2, +c7 uint4, +c8 uint8, +c9 float, +c10 double, +c11 numeric, +c12 bit, +c13 binary, +c14 interval, +c15 json); +insert into div_test values(0,0,0,0,0,0,0,0,0,0,0,b'0',0,0,'{"0":"0"}'); +-- strict mode only, no warning and error +set dolphin.sql_mode = 'sql_mode_strict'; +select c1/c1 from div_test; + ?column? +---------- + +(1 row) + +select c1/c2 from div_test; + ?column? +---------- + +(1 row) + +select c1/c3 from div_test; + ?column? +---------- + +(1 row) + +select c1/c4 from div_test; + ?column? +---------- + +(1 row) + +select c1/c5 from div_test; + ?column? +---------- + +(1 row) + +select c1/c6 from div_test; + ?column? +---------- + +(1 row) + +select c1/c7 from div_test; + ?column? +---------- + +(1 row) + +select c1/c8 from div_test; + ?column? +---------- + +(1 row) + +select c1/c9 from div_test; + ?column? +---------- + +(1 row) + +select c1/c10 from div_test; + ?column? +---------- + +(1 row) + +select c1/c11 from div_test; + ?column? +---------- + +(1 row) + +select c1/c12 from div_test; + ?column? +---------- + +(1 row) + +select c1/c13 from div_test; + ?column? +---------- + +(1 row) + +select c1/c14 from div_test; + ?column? +---------- + +(1 row) + +select c1/c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" + ?column? +---------- + +(1 row) + +select c1 mod c1 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c2 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c3 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c4 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c5 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c6 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c7 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c8 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c9 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c10 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c11 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c12 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c13 from div_test; +ERROR: function pg_catalog.b_mod(tinyint, `binary`) does not exist +LINE 1: select c1 mod c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: b_mod +select c1 mod c14 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c15 from div_test; +ERROR: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: b_mod +select c1 div c1 from div_test; + div +----- + +(1 row) + +select c1 div c2 from div_test; + div +----- + +(1 row) + +select c1 div c3 from div_test; + div +----- + +(1 row) + +select c1 div c4 from div_test; + div +----- + +(1 row) + +select c1 div c5 from div_test; + div +----- + +(1 row) + +select c1 div c6 from div_test; + div +----- + +(1 row) + +select c1 div c7 from div_test; + div +----- + +(1 row) + +select c1 div c8 from div_test; + div +----- + +(1 row) + +select c1 div c9 from div_test; + div +----- + +(1 row) + +select c1 div c10 from div_test; + div +----- + +(1 row) + +select c1 div c11 from div_test; + div +----- + +(1 row) + +select c1 div c12 from div_test; + div +----- + +(1 row) + +select c1 div c13 from div_test; +ERROR: function pg_catalog.div(tinyint, `binary`) does not exist +LINE 1: select c1 div c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: div +select c1 div c14 from div_test; + div +----- + +(1 row) + +select c1 div c15 from div_test; +ERROR: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function `div`(anyelement,json) line 3 at RETURN +referenced column: div +insert into tmp_res select c1/c1 from div_test; +insert into tmp_res select c1/c2 from div_test; +insert into tmp_res select c1/c3 from div_test; +insert into tmp_res select c1/c4 from div_test; +insert into tmp_res select c1/c5 from div_test; +insert into tmp_res select c1/c6 from div_test; +insert into tmp_res select c1/c7 from div_test; +insert into tmp_res select c1/c8 from div_test; +insert into tmp_res select c1/c9 from div_test; +insert into tmp_res select c1/c10 from div_test; +insert into tmp_res select c1/c11 from div_test; +insert into tmp_res select c1/c12 from div_test; +insert into tmp_res select c1/c13 from div_test; +insert into tmp_res select c1/c14 from div_test; +insert into tmp_res select c1/c15 from div_test; +ERROR: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c1 from div_test; +insert into tmp_res select c1 mod c2 from div_test; +insert into tmp_res select c1 mod c3 from div_test; +insert into tmp_res select c1 mod c4 from div_test; +insert into tmp_res select c1 mod c5 from div_test; +insert into tmp_res select c1 mod c6 from div_test; +insert into tmp_res select c1 mod c7 from div_test; +insert into tmp_res select c1 mod c8 from div_test; +insert into tmp_res select c1 mod c9 from div_test; +insert into tmp_res select c1 mod c10 from div_test; +insert into tmp_res select c1 mod c11 from div_test; +insert into tmp_res select c1 mod c12 from div_test; +insert into tmp_res select c1 mod c13 from div_test; +ERROR: function pg_catalog.b_mod(tinyint, `binary`) does not exist +LINE 1: insert into tmp_res select c1 mod c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: b_mod +insert into tmp_res select c1 mod c14 from div_test; +insert into tmp_res select c1 mod c15 from div_test; +ERROR: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: b_mod +insert into tmp_res select c1 div c1 from div_test; +insert into tmp_res select c1 div c2 from div_test; +insert into tmp_res select c1 div c3 from div_test; +insert into tmp_res select c1 div c4 from div_test; +insert into tmp_res select c1 div c5 from div_test; +insert into tmp_res select c1 div c6 from div_test; +insert into tmp_res select c1 div c7 from div_test; +insert into tmp_res select c1 div c8 from div_test; +insert into tmp_res select c1 div c9 from div_test; +insert into tmp_res select c1 div c10 from div_test; +insert into tmp_res select c1 div c11 from div_test; +insert into tmp_res select c1 div c12 from div_test; +insert into tmp_res select c1 div c13 from div_test; +ERROR: function pg_catalog.div(tinyint, `binary`) does not exist +LINE 1: insert into tmp_res select c1 div c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: div +insert into tmp_res select c1 div c14 from div_test; +insert into tmp_res select c1 div c15 from div_test; +ERROR: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function `div`(anyelement,json) line 3 at RETURN +referenced column: div +-- non-strict mode and non-err_division_by_zero, no warning and error +set dolphin.sql_mode = ''; +select c1/c1 from div_test; + ?column? +---------- + +(1 row) + +select c1/c2 from div_test; + ?column? +---------- + +(1 row) + +select c1/c3 from div_test; + ?column? +---------- + +(1 row) + +select c1/c4 from div_test; + ?column? +---------- + +(1 row) + +select c1/c5 from div_test; + ?column? +---------- + +(1 row) + +select c1/c6 from div_test; + ?column? +---------- + +(1 row) + +select c1/c7 from div_test; + ?column? +---------- + +(1 row) + +select c1/c8 from div_test; + ?column? +---------- + +(1 row) + +select c1/c9 from div_test; + ?column? +---------- + +(1 row) + +select c1/c10 from div_test; + ?column? +---------- + +(1 row) + +select c1/c11 from div_test; + ?column? +---------- + +(1 row) + +select c1/c12 from div_test; + ?column? +---------- + +(1 row) + +select c1/c13 from div_test; + ?column? +---------- + +(1 row) + +select c1/c14 from div_test; + ?column? +---------- + +(1 row) + +select c1/c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" + ?column? +---------- + +(1 row) + +select c1 mod c1 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c2 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c3 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c4 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c5 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c6 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c7 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c8 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c9 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c10 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c11 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c12 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c13 from div_test; +ERROR: function pg_catalog.b_mod(tinyint, `binary`) does not exist +LINE 1: select c1 mod c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: b_mod +select c1 mod c14 from div_test; + b_mod +------- + +(1 row) + +select c1 mod c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 div c1 from div_test; + div +----- + +(1 row) + +select c1 div c2 from div_test; + div +----- + +(1 row) + +select c1 div c3 from div_test; + div +----- + +(1 row) + +select c1 div c4 from div_test; + div +----- + +(1 row) + +select c1 div c5 from div_test; + div +----- + +(1 row) + +select c1 div c6 from div_test; + div +----- + +(1 row) + +select c1 div c7 from div_test; + div +----- + +(1 row) + +select c1 div c8 from div_test; + div +----- + +(1 row) + +select c1 div c9 from div_test; + div +----- + +(1 row) + +select c1 div c10 from div_test; + div +----- + +(1 row) + +select c1 div c11 from div_test; + div +----- + +(1 row) + +select c1 div c12 from div_test; + div +----- + +(1 row) + +select c1 div c13 from div_test; +ERROR: function pg_catalog.div(tinyint, `binary`) does not exist +LINE 1: select c1 div c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: div +select c1 div c14 from div_test; + div +----- + +(1 row) + +select c1 div c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function `div`(anyelement,json) line 3 at RETURN +referenced column: div + div +----- + +(1 row) + +insert into tmp_res select c1/c1 from div_test; +insert into tmp_res select c1/c2 from div_test; +insert into tmp_res select c1/c3 from div_test; +insert into tmp_res select c1/c4 from div_test; +insert into tmp_res select c1/c5 from div_test; +insert into tmp_res select c1/c6 from div_test; +insert into tmp_res select c1/c7 from div_test; +insert into tmp_res select c1/c8 from div_test; +insert into tmp_res select c1/c9 from div_test; +insert into tmp_res select c1/c10 from div_test; +insert into tmp_res select c1/c11 from div_test; +insert into tmp_res select c1/c12 from div_test; +insert into tmp_res select c1/c13 from div_test; +insert into tmp_res select c1/c14 from div_test; +insert into tmp_res select c1/c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c1 from div_test; +insert into tmp_res select c1 mod c2 from div_test; +insert into tmp_res select c1 mod c3 from div_test; +insert into tmp_res select c1 mod c4 from div_test; +insert into tmp_res select c1 mod c5 from div_test; +insert into tmp_res select c1 mod c6 from div_test; +insert into tmp_res select c1 mod c7 from div_test; +insert into tmp_res select c1 mod c8 from div_test; +insert into tmp_res select c1 mod c9 from div_test; +insert into tmp_res select c1 mod c10 from div_test; +insert into tmp_res select c1 mod c11 from div_test; +insert into tmp_res select c1 mod c12 from div_test; +insert into tmp_res select c1 mod c13 from div_test; +ERROR: function pg_catalog.b_mod(tinyint, `binary`) does not exist +LINE 1: insert into tmp_res select c1 mod c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: b_mod +insert into tmp_res select c1 mod c14 from div_test; +insert into tmp_res select c1 mod c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: b_mod +insert into tmp_res select c1 div c1 from div_test; +insert into tmp_res select c1 div c2 from div_test; +insert into tmp_res select c1 div c3 from div_test; +insert into tmp_res select c1 div c4 from div_test; +insert into tmp_res select c1 div c5 from div_test; +insert into tmp_res select c1 div c6 from div_test; +insert into tmp_res select c1 div c7 from div_test; +insert into tmp_res select c1 div c8 from div_test; +insert into tmp_res select c1 div c9 from div_test; +insert into tmp_res select c1 div c10 from div_test; +insert into tmp_res select c1 div c11 from div_test; +insert into tmp_res select c1 div c12 from div_test; +insert into tmp_res select c1 div c13 from div_test; +ERROR: function pg_catalog.div(tinyint, `binary`) does not exist +LINE 1: insert into tmp_res select c1 div c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: div +insert into tmp_res select c1 div c14 from div_test; +insert into tmp_res select c1 div c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function `div`(anyelement,json) line 3 at RETURN +referenced column: div +-- strict mode and err_division_by_zero, select warning, insert error +set dolphin.sql_mode = 'sql_mode_strict,ERROR_FOR_DIVISION_BY_ZERO'; +select c1/c1 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c2 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c3 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c4 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c5 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c6 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c7 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c8 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c9 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c10 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c11 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c12 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c13 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c14 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1 mod c1 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c2 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c3 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c4 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c5 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c6 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c7 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c8 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c9 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c10 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c11 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c12 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c13 from div_test; +ERROR: function pg_catalog.b_mod(tinyint, `binary`) does not exist +LINE 1: select c1 mod c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: b_mod +select c1 mod c14 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c15 from div_test; +ERROR: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: b_mod +select c1 div c1 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c2 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c3 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c4 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c5 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c6 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c7 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c8 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c9 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c10 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c11 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c12 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c13 from div_test; +ERROR: function pg_catalog.div(tinyint, `binary`) does not exist +LINE 1: select c1 div c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: div +select c1 div c14 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c15 from div_test; +ERROR: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function `div`(anyelement,json) line 3 at RETURN +referenced column: div +insert into tmp_res select c1/c1 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c2 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c3 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c4 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c5 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c6 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c7 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c8 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c9 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c10 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c11 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c12 from div_test; +ERROR: division by zero +insert into tmp_res select c1/c13 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c14 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c15 from div_test; +ERROR: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c1 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c2 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c3 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c4 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c5 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c6 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c7 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c8 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c9 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c10 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c11 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c12 from div_test; +ERROR: division by zero +CONTEXT: referenced column: b_mod +insert into tmp_res select c1 mod c13 from div_test; +ERROR: function pg_catalog.b_mod(tinyint, `binary`) does not exist +LINE 1: insert into tmp_res select c1 mod c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: b_mod +insert into tmp_res select c1 mod c14 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c15 from div_test; +ERROR: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: b_mod +insert into tmp_res select c1 div c1 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c2 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c3 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c4 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c5 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c6 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c7 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c8 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c9 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c10 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c11 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c12 from div_test; +ERROR: division by zero +CONTEXT: referenced column: div +insert into tmp_res select c1 div c13 from div_test; +ERROR: function pg_catalog.div(tinyint, `binary`) does not exist +LINE 1: insert into tmp_res select c1 div c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: div +insert into tmp_res select c1 div c14 from div_test; +ERROR: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c15 from div_test; +ERROR: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function `div`(anyelement,json) line 3 at RETURN +referenced column: div +-- non-strict mode and err_division_by_zero, select warning, insert warning +set dolphin.sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO'; +select c1/c1 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c2 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c3 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c4 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c5 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c6 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c7 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c8 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c9 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c10 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c11 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c12 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c13 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c14 from div_test; +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1/c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" +WARNING: division by zero + ?column? +---------- + +(1 row) + +select c1 mod c1 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c2 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c3 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c4 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c5 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c6 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c7 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c8 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c9 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c10 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c11 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c12 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c13 from div_test; +ERROR: function pg_catalog.b_mod(tinyint, `binary`) does not exist +LINE 1: select c1 mod c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: b_mod +select c1 mod c14 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 mod c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: b_mod +WARNING: division by zero +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: b_mod + b_mod +------- + +(1 row) + +select c1 div c1 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c2 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c3 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c4 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c5 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c6 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c7 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c8 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c9 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c10 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c11 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c12 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c13 from div_test; +ERROR: function pg_catalog.div(tinyint, `binary`) does not exist +LINE 1: select c1 div c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: div +select c1 div c14 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div + div +----- + +(1 row) + +select c1 div c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function `div`(anyelement,json) line 3 at RETURN +referenced column: div +WARNING: division by zero +CONTEXT: PL/pgSQL function `div`(anyelement,json) line 3 at RETURN +referenced column: div + div +----- + +(1 row) + +insert into tmp_res select c1/c1 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c2 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c3 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c4 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c5 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c6 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c7 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c8 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c9 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c10 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c11 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c12 from div_test; +WARNING: division by zero +insert into tmp_res select c1/c13 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c14 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1/c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: referenced column: a +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c1 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c2 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c3 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c4 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c5 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c6 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c7 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c8 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c9 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c10 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c11 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c12 from div_test; +WARNING: division by zero +CONTEXT: referenced column: b_mod +insert into tmp_res select c1 mod c13 from div_test; +ERROR: function pg_catalog.b_mod(tinyint, `binary`) does not exist +LINE 1: insert into tmp_res select c1 mod c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: b_mod +insert into tmp_res select c1 mod c14 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 mod c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: b_mod +WARNING: division by zero +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: b_mod +insert into tmp_res select c1 div c1 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c2 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c3 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c4 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c5 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c6 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c7 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c8 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c9 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c10 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c11 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c12 from div_test; +WARNING: division by zero +CONTEXT: referenced column: div +insert into tmp_res select c1 div c13 from div_test; +ERROR: function pg_catalog.div(tinyint, `binary`) does not exist +LINE 1: insert into tmp_res select c1 div c13 from div_test; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. +CONTEXT: referenced column: div +insert into tmp_res select c1 div c14 from div_test; +WARNING: division by zero +CONTEXT: referenced column: a +insert into tmp_res select c1 div c15 from div_test; +WARNING: invalid input syntax for type double precision: "{"0":"0"}" +CONTEXT: PL/pgSQL function `div`(anyelement,json) line 3 at RETURN +referenced column: div +WARNING: division by zero +CONTEXT: PL/pgSQL function `div`(anyelement,json) line 3 at RETURN +referenced column: div +select count(*) from tmp_res; + count +------- + 126 +(1 row) + +select count(*) from tmp_res where a is null; + count +------- + 126 +(1 row) + +drop table tmp_res; +drop table div_test; --测试点三:验证mod操作符 select 8mod3;--返回mod3 8 mod3 @@ -262,6 +1961,9 @@ select 8 mod 3; (1 row) select 8 mod 0; +WARNING: division by zero +CONTEXT: SQL function "b_mod" statement 1 +referenced column: b_mod b_mod ------- @@ -312,6 +2014,9 @@ WARNING: invalid input syntax for type numeric: "-12.3abc" LINE 1: select '-12.3abc' mod 0; ^ CONTEXT: referenced column: b_mod +WARNING: division by zero +CONTEXT: SQL function "b_mod" statement 1 +referenced column: b_mod b_mod ------- @@ -362,6 +2067,9 @@ WARNING: invalid input syntax for type numeric: "-12.3abc" LINE 1: select '-12.3abc' mod false; ^ CONTEXT: referenced column: b_mod +WARNING: division by zero +CONTEXT: SQL function "b_mod" statement 1 +referenced column: b_mod b_mod ------- @@ -372,6 +2080,9 @@ WARNING: invalid input syntax for type numeric: "-12.3abc" LINE 1: select '-12.3abc' mod 'null'; ^ CONTEXT: referenced column: b_mod +WARNING: division by zero +CONTEXT: SQL function "b_mod" statement 1 +referenced column: b_mod b_mod ------- diff --git a/contrib/dolphin/expected/operator_compatibility_test/json_operator_test.out b/contrib/dolphin/expected/operator_compatibility_test/json_operator_test.out index 8831c061d..8d099b98e 100644 --- a/contrib/dolphin/expected/operator_compatibility_test/json_operator_test.out +++ b/contrib/dolphin/expected/operator_compatibility_test/json_operator_test.out @@ -2206,8 +2206,6 @@ CONTEXT: referenced column: int1*json UPDATE test_json_type, test_json_table SET test_json_type.`int1/json` = test_json_table.`int1` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: int1/json -ERROR: division by zero -CONTEXT: referenced column: int1/json UPDATE test_json_type, test_json_table SET test_json_type.`int1%json` = test_json_table.`int1` % test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: int1%json @@ -2229,7 +2227,13 @@ CONTEXT: referenced column: int1&json UPDATE test_json_type, test_json_table SET test_json_type.`int1||json` = test_json_table.`int1` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`int1&&json` = test_json_table.`int1` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`int1_div_json` = test_json_table.`int1` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: int1_div_json UPDATE test_json_type, test_json_table SET test_json_type.`int1_mod_json` = test_json_table.`int1` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: int1_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`int1_xor_json` = test_json_table.`int1` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2249,8 +2253,6 @@ CONTEXT: referenced column: uint1*json UPDATE test_json_type, test_json_table SET test_json_type.`uint1/json` = test_json_table.`uint1` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: uint1/json -ERROR: division by zero -CONTEXT: referenced column: uint1/json UPDATE test_json_type, test_json_table SET test_json_type.`uint1%json` = test_json_table.`uint1` % test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: uint1%json @@ -2272,7 +2274,13 @@ CONTEXT: referenced column: uint1&json UPDATE test_json_type, test_json_table SET test_json_type.`uint1||json` = test_json_table.`uint1` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`uint1&&json` = test_json_table.`uint1` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`uint1_div_json` = test_json_table.`uint1` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: uint1_div_json UPDATE test_json_type, test_json_table SET test_json_type.`uint1_mod_json` = test_json_table.`uint1` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: uint1_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`uint1_xor_json` = test_json_table.`uint1` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2292,8 +2300,6 @@ CONTEXT: referenced column: int2*json UPDATE test_json_type, test_json_table SET test_json_type.`int2/json` = test_json_table.`int2` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: int2/json -ERROR: division by zero -CONTEXT: referenced column: int2/json UPDATE test_json_type, test_json_table SET test_json_type.`int2%json` = test_json_table.`int2` % test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: int2%json @@ -2315,7 +2321,13 @@ CONTEXT: referenced column: int2&json UPDATE test_json_type, test_json_table SET test_json_type.`int2||json` = test_json_table.`int2` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`int2&&json` = test_json_table.`int2` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`int2_div_json` = test_json_table.`int2` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: int2_div_json UPDATE test_json_type, test_json_table SET test_json_type.`int2_mod_json` = test_json_table.`int2` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: int2_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`int2_xor_json` = test_json_table.`int2` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2335,8 +2347,6 @@ CONTEXT: referenced column: uint2*json UPDATE test_json_type, test_json_table SET test_json_type.`uint2/json` = test_json_table.`uint2` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: uint2/json -ERROR: division by zero -CONTEXT: referenced column: uint2/json UPDATE test_json_type, test_json_table SET test_json_type.`uint2%json` = test_json_table.`uint2` % test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: uint2%json @@ -2358,7 +2368,13 @@ CONTEXT: referenced column: uint2&json UPDATE test_json_type, test_json_table SET test_json_type.`uint2||json` = test_json_table.`uint2` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`uint2&&json` = test_json_table.`uint2` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`uint2_div_json` = test_json_table.`uint2` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: uint2_div_json UPDATE test_json_type, test_json_table SET test_json_type.`uint2_mod_json` = test_json_table.`uint2` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: uint2_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`uint2_xor_json` = test_json_table.`uint2` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2378,8 +2394,6 @@ CONTEXT: referenced column: int4*json UPDATE test_json_type, test_json_table SET test_json_type.`int4/json` = test_json_table.`int4` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: int4/json -ERROR: division by zero -CONTEXT: referenced column: int4/json UPDATE test_json_type, test_json_table SET test_json_type.`int4%json` = test_json_table.`int4` % test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: int4%json @@ -2401,7 +2415,13 @@ CONTEXT: referenced column: int4&json UPDATE test_json_type, test_json_table SET test_json_type.`int4||json` = test_json_table.`int4` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`int4&&json` = test_json_table.`int4` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`int4_div_json` = test_json_table.`int4` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: int4_div_json UPDATE test_json_type, test_json_table SET test_json_type.`int4_mod_json` = test_json_table.`int4` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: int4_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`int4_xor_json` = test_json_table.`int4` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2421,8 +2441,6 @@ CONTEXT: referenced column: uint4*json UPDATE test_json_type, test_json_table SET test_json_type.`uint4/json` = test_json_table.`uint4` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: uint4/json -ERROR: division by zero -CONTEXT: referenced column: uint4/json UPDATE test_json_type, test_json_table SET test_json_type.`uint4%json` = test_json_table.`uint4` % test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: uint4%json @@ -2444,7 +2462,13 @@ CONTEXT: referenced column: uint4&json UPDATE test_json_type, test_json_table SET test_json_type.`uint4||json` = test_json_table.`uint4` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`uint4&&json` = test_json_table.`uint4` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`uint4_div_json` = test_json_table.`uint4` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: uint4_div_json UPDATE test_json_type, test_json_table SET test_json_type.`uint4_mod_json` = test_json_table.`uint4` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: uint4_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`uint4_xor_json` = test_json_table.`uint4` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2464,8 +2488,6 @@ CONTEXT: referenced column: int8*json UPDATE test_json_type, test_json_table SET test_json_type.`int8/json` = test_json_table.`int8` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: int8/json -ERROR: division by zero -CONTEXT: referenced column: int8/json UPDATE test_json_type, test_json_table SET test_json_type.`int8%json` = test_json_table.`int8` % test_json_table.`json`; WARNING: Truncated incorrect INTEGER value: '{"a": 1, "b": 2}' CONTEXT: referenced column: int8%json @@ -2487,7 +2509,13 @@ CONTEXT: referenced column: int8&json UPDATE test_json_type, test_json_table SET test_json_type.`int8||json` = test_json_table.`int8` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`int8&&json` = test_json_table.`int8` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`int8_div_json` = test_json_table.`int8` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: int8_div_json UPDATE test_json_type, test_json_table SET test_json_type.`int8_mod_json` = test_json_table.`int8` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: int8_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`int8_xor_json` = test_json_table.`int8` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2507,8 +2535,6 @@ CONTEXT: referenced column: uint8*json UPDATE test_json_type, test_json_table SET test_json_type.`uint8/json` = test_json_table.`uint8` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: uint8/json -ERROR: division by zero -CONTEXT: referenced column: uint8/json UPDATE test_json_type, test_json_table SET test_json_type.`uint8%json` = test_json_table.`uint8` % test_json_table.`json`; WARNING: Truncated incorrect INTEGER value: '{"a": 1, "b": 2}' CONTEXT: referenced column: uint8%json @@ -2530,7 +2556,13 @@ CONTEXT: referenced column: uint8&json UPDATE test_json_type, test_json_table SET test_json_type.`uint8||json` = test_json_table.`uint8` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`uint8&&json` = test_json_table.`uint8` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`uint8_div_json` = test_json_table.`uint8` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: uint8_div_json UPDATE test_json_type, test_json_table SET test_json_type.`uint8_mod_json` = test_json_table.`uint8` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: uint8_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`uint8_xor_json` = test_json_table.`uint8` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2550,8 +2582,6 @@ CONTEXT: referenced column: float4*json UPDATE test_json_type, test_json_table SET test_json_type.`float4/json` = test_json_table.`float4` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: float4/json -ERROR: division by zero -CONTEXT: referenced column: float4/json UPDATE test_json_type, test_json_table SET test_json_type.`float4%json` = test_json_table.`float4` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`float4^json` = test_json_table.`float4` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -2571,7 +2601,13 @@ CONTEXT: referenced column: float4&json UPDATE test_json_type, test_json_table SET test_json_type.`float4||json` = test_json_table.`float4` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`float4&&json` = test_json_table.`float4` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`float4_div_json` = test_json_table.`float4` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: float4_div_json UPDATE test_json_type, test_json_table SET test_json_type.`float4_mod_json` = test_json_table.`float4` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: float4_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`float4_xor_json` = test_json_table.`float4` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2591,8 +2627,6 @@ CONTEXT: referenced column: float8*json UPDATE test_json_type, test_json_table SET test_json_type.`float8/json` = test_json_table.`float8` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: float8/json -ERROR: division by zero -CONTEXT: referenced column: float8/json UPDATE test_json_type, test_json_table SET test_json_type.`float8%json` = test_json_table.`float8` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`float8^json` = test_json_table.`float8` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -2612,7 +2646,13 @@ CONTEXT: referenced column: float8&json UPDATE test_json_type, test_json_table SET test_json_type.`float8||json` = test_json_table.`float8` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`float8&&json` = test_json_table.`float8` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`float8_div_json` = test_json_table.`float8` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: float8_div_json UPDATE test_json_type, test_json_table SET test_json_type.`float8_mod_json` = test_json_table.`float8` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: float8_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`float8_xor_json` = test_json_table.`float8` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2632,8 +2672,6 @@ CONTEXT: referenced column: numeric*json UPDATE test_json_type, test_json_table SET test_json_type.`numeric/json` = test_json_table.`numeric` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: numeric/json -ERROR: division by zero -CONTEXT: referenced column: numeric/json UPDATE test_json_type, test_json_table SET test_json_type.`numeric%json` = test_json_table.`numeric` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`numeric^json` = test_json_table.`numeric` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -2653,7 +2691,13 @@ CONTEXT: referenced column: numeric&json UPDATE test_json_type, test_json_table SET test_json_type.`numeric||json` = test_json_table.`numeric` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`numeric&&json` = test_json_table.`numeric` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`numeric_div_json` = test_json_table.`numeric` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: numeric_div_json UPDATE test_json_type, test_json_table SET test_json_type.`numeric_mod_json` = test_json_table.`numeric` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: numeric_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`numeric_xor_json` = test_json_table.`numeric` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2673,8 +2717,6 @@ CONTEXT: referenced column: bit1*json UPDATE test_json_type, test_json_table SET test_json_type.`bit1/json` = test_json_table.`bit1` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: bit1/json -ERROR: division by zero -CONTEXT: referenced column: bit1/json UPDATE test_json_type, test_json_table SET test_json_type.`bit1%json` = test_json_table.`bit1` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`bit1^json` = test_json_table.`bit1` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -2694,7 +2736,13 @@ CONTEXT: referenced column: bit1&json UPDATE test_json_type, test_json_table SET test_json_type.`bit1||json` = test_json_table.`bit1` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`bit1&&json` = test_json_table.`bit1` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`bit1_div_json` = test_json_table.`bit1` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: bit1_div_json UPDATE test_json_type, test_json_table SET test_json_type.`bit1_mod_json` = test_json_table.`bit1` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: bit1_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`bit1_xor_json` = test_json_table.`bit1` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2714,8 +2762,6 @@ CONTEXT: referenced column: bit64*json UPDATE test_json_type, test_json_table SET test_json_type.`bit64/json` = test_json_table.`bit64` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: bit64/json -ERROR: division by zero -CONTEXT: referenced column: bit64/json UPDATE test_json_type, test_json_table SET test_json_type.`bit64%json` = test_json_table.`bit64` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`bit64^json` = test_json_table.`bit64` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -2735,7 +2781,13 @@ CONTEXT: referenced column: bit64&json UPDATE test_json_type, test_json_table SET test_json_type.`bit64||json` = test_json_table.`bit64` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`bit64&&json` = test_json_table.`bit64` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`bit64_div_json` = test_json_table.`bit64` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: bit64_div_json UPDATE test_json_type, test_json_table SET test_json_type.`bit64_mod_json` = test_json_table.`bit64` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: bit64_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`bit64_xor_json` = test_json_table.`bit64` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2755,8 +2807,6 @@ CONTEXT: referenced column: boolean*json UPDATE test_json_type, test_json_table SET test_json_type.`boolean/json` = test_json_table.`boolean` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: boolean/json -ERROR: division by zero -CONTEXT: referenced column: boolean/json UPDATE test_json_type, test_json_table SET test_json_type.`boolean%json` = test_json_table.`boolean` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`boolean^json` = test_json_table.`boolean` ^ test_json_table.`json`; ERROR: failed to find conversion function from boolean to double precision @@ -2776,7 +2826,13 @@ CONTEXT: referenced column: boolean&json UPDATE test_json_type, test_json_table SET test_json_type.`boolean||json` = test_json_table.`boolean` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`boolean&&json` = test_json_table.`boolean` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`boolean_div_json` = test_json_table.`boolean` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: boolean_div_json UPDATE test_json_type, test_json_table SET test_json_type.`boolean_mod_json` = test_json_table.`boolean` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: boolean_mod_json -- UPDATE test_json_type, test_json_table SET test_json_type.`boolean_xor_json` = test_json_table.`boolean` xor test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`boolean_and_json` = test_json_table.`boolean` and test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`boolean_or_json` = test_json_table.`boolean` or test_json_table.`json`; @@ -2792,8 +2848,6 @@ CONTEXT: referenced column: date*json UPDATE test_json_type, test_json_table SET test_json_type.`date/json` = test_json_table.`date` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: date/json -ERROR: division by zero -CONTEXT: referenced column: date/json UPDATE test_json_type, test_json_table SET test_json_type.`date%json` = test_json_table.`date` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`date^json` = test_json_table.`date` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -2813,7 +2867,13 @@ CONTEXT: referenced column: date&json UPDATE test_json_type, test_json_table SET test_json_type.`date||json` = test_json_table.`date` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`date&&json` = test_json_table.`date` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`date_div_json` = test_json_table.`date` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: date_div_json UPDATE test_json_type, test_json_table SET test_json_type.`date_mod_json` = test_json_table.`date` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: date_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`date_xor_json` = test_json_table.`date` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2833,8 +2893,6 @@ CONTEXT: referenced column: time*json UPDATE test_json_type, test_json_table SET test_json_type.`time/json` = test_json_table.`time` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: time/json -ERROR: division by zero -CONTEXT: referenced column: time/json UPDATE test_json_type, test_json_table SET test_json_type.`time%json` = test_json_table.`time` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`time^json` = test_json_table.`time` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -2854,7 +2912,13 @@ CONTEXT: referenced column: time&json UPDATE test_json_type, test_json_table SET test_json_type.`time||json` = test_json_table.`time` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`time&&json` = test_json_table.`time` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`time_div_json` = test_json_table.`time` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: time_div_json UPDATE test_json_type, test_json_table SET test_json_type.`time_mod_json` = test_json_table.`time` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: time_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`time_xor_json` = test_json_table.`time` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2874,8 +2938,6 @@ CONTEXT: referenced column: time(4)*json UPDATE test_json_type, test_json_table SET test_json_type.`time(4)/json` = test_json_table.`time(4)` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: time(4)/json -ERROR: division by zero -CONTEXT: referenced column: time(4)/json UPDATE test_json_type, test_json_table SET test_json_type.`time(4)%json` = test_json_table.`time(4)` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`time(4)^json` = test_json_table.`time(4)` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -2895,7 +2957,13 @@ CONTEXT: referenced column: time(4)&json UPDATE test_json_type, test_json_table SET test_json_type.`time(4)||json` = test_json_table.`time(4)` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`time(4)&&json` = test_json_table.`time(4)` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`time(4)_div_json` = test_json_table.`time(4)` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: time(4)_div_json UPDATE test_json_type, test_json_table SET test_json_type.`time(4)_mod_json` = test_json_table.`time(4)` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: time(4)_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`time(4)_xor_json` = test_json_table.`time(4)` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2915,8 +2983,6 @@ CONTEXT: referenced column: datetime*json UPDATE test_json_type, test_json_table SET test_json_type.`datetime/json` = test_json_table.`datetime` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: datetime/json -ERROR: division by zero -CONTEXT: referenced column: datetime/json UPDATE test_json_type, test_json_table SET test_json_type.`datetime%json` = test_json_table.`datetime` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`datetime^json` = test_json_table.`datetime` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -2946,7 +3012,13 @@ LINE 1: ..._json_table SET test_json_type.`datetime&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`datetime_div_json` = test_json_table.`datetime` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: datetime_div_json UPDATE test_json_type, test_json_table SET test_json_type.`datetime_mod_json` = test_json_table.`datetime` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: datetime_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`datetime_xor_json` = test_json_table.`datetime` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -2978,8 +3050,6 @@ CONTEXT: referenced column: datetime(4)*json UPDATE test_json_type, test_json_table SET test_json_type.`datetime(4)/json` = test_json_table.`datetime(4)` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: datetime(4)/json -ERROR: division by zero -CONTEXT: referenced column: datetime(4)/json UPDATE test_json_type, test_json_table SET test_json_type.`datetime(4)%json` = test_json_table.`datetime(4)` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`datetime(4)^json` = test_json_table.`datetime(4)` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -3009,7 +3079,13 @@ LINE 1: ...on_table SET test_json_type.`datetime(4)&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`datetime(4)_div_json` = test_json_table.`datetime(4)` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: datetime(4)_div_json UPDATE test_json_type, test_json_table SET test_json_type.`datetime(4)_mod_json` = test_json_table.`datetime(4)` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: datetime(4)_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`datetime(4)_xor_json` = test_json_table.`datetime(4)` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3041,8 +3117,6 @@ CONTEXT: referenced column: timestamp*json UPDATE test_json_type, test_json_table SET test_json_type.`timestamp/json` = test_json_table.`timestamp` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: timestamp/json -ERROR: division by zero -CONTEXT: referenced column: timestamp/json UPDATE test_json_type, test_json_table SET test_json_type.`timestamp%json` = test_json_table.`timestamp` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`timestamp^json` = test_json_table.`timestamp` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -3072,7 +3146,13 @@ LINE 1: ...json_table SET test_json_type.`timestamp&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`timestamp_div_json` = test_json_table.`timestamp` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: timestamp_div_json UPDATE test_json_type, test_json_table SET test_json_type.`timestamp_mod_json` = test_json_table.`timestamp` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: timestamp_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`timestamp_xor_json` = test_json_table.`timestamp` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3104,8 +3184,6 @@ CONTEXT: referenced column: timestamp(4)*json UPDATE test_json_type, test_json_table SET test_json_type.`timestamp(4)/json` = test_json_table.`timestamp(4)` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: timestamp(4)/json -ERROR: division by zero -CONTEXT: referenced column: timestamp(4)/json UPDATE test_json_type, test_json_table SET test_json_type.`timestamp(4)%json` = test_json_table.`timestamp(4)` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`timestamp(4)^json` = test_json_table.`timestamp(4)` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -3135,7 +3213,13 @@ LINE 1: ...n_table SET test_json_type.`timestamp(4)&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`timestamp(4)_div_json` = test_json_table.`timestamp(4)` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: timestamp(4)_div_json UPDATE test_json_type, test_json_table SET test_json_type.`timestamp(4)_mod_json` = test_json_table.`timestamp(4)` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: timestamp(4)_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`timestamp(4)_xor_json` = test_json_table.`timestamp(4)` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3167,8 +3251,6 @@ CONTEXT: referenced column: year*json UPDATE test_json_type, test_json_table SET test_json_type.`year/json` = test_json_table.`year` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: year/json -ERROR: division by zero -CONTEXT: referenced column: year/json UPDATE test_json_type, test_json_table SET test_json_type.`year%json` = test_json_table.`year` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`year^json` = test_json_table.`year` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -3196,7 +3278,13 @@ LINE 1: ...test_json_table SET test_json_type.`year&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`year_div_json` = test_json_table.`year` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: year_div_json UPDATE test_json_type, test_json_table SET test_json_type.`year_mod_json` = test_json_table.`year` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: year_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`year_xor_json` = test_json_table.`year` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3232,8 +3320,6 @@ WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: referenced column: char/json WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: char/json -ERROR: division by zero -CONTEXT: referenced column: char/json UPDATE test_json_type, test_json_table SET test_json_type.`char%json` = test_json_table.`char` % test_json_table.`json`; WARNING: invalid input syntax for type numeric: "1.23a" CONTEXT: referenced column: char%json @@ -3265,7 +3351,19 @@ CONTEXT: referenced column: char&json UPDATE test_json_type, test_json_table SET test_json_type.`char||json` = test_json_table.`char` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`char&&json` = test_json_table.`char` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`char_div_json` = test_json_table.`char` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: char_div_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: char_div_json UPDATE test_json_type, test_json_table SET test_json_type.`char_mod_json` = test_json_table.`char` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: char_mod_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: char_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`char_xor_json` = test_json_table.`char` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3297,8 +3395,6 @@ WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: referenced column: varchar/json WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: varchar/json -ERROR: division by zero -CONTEXT: referenced column: varchar/json UPDATE test_json_type, test_json_table SET test_json_type.`varchar%json` = test_json_table.`varchar` % test_json_table.`json`; WARNING: invalid input syntax for type numeric: "1.23a" CONTEXT: referenced column: varchar%json @@ -3330,7 +3426,19 @@ CONTEXT: referenced column: varchar&json UPDATE test_json_type, test_json_table SET test_json_type.`varchar||json` = test_json_table.`varchar` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`varchar&&json` = test_json_table.`varchar` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`varchar_div_json` = test_json_table.`varchar` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: varchar_div_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: varchar_div_json UPDATE test_json_type, test_json_table SET test_json_type.`varchar_mod_json` = test_json_table.`varchar` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: varchar_mod_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: varchar_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`varchar_xor_json` = test_json_table.`varchar` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3362,8 +3470,6 @@ WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: referenced column: binary/json WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: binary/json -ERROR: division by zero -CONTEXT: referenced column: binary/json UPDATE test_json_type, test_json_table SET test_json_type.`binary%json` = test_json_table.`binary` % test_json_table.`json`; ERROR: failed to find conversion function from "binary" to numeric CONTEXT: referenced column: test_json_type @@ -3395,7 +3501,19 @@ LINE 1: ...st_json_table SET test_json_type.`binary&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`binary_div_json` = test_json_table.`binary` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: binary_div_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: binary_div_json UPDATE test_json_type, test_json_table SET test_json_type.`binary_mod_json` = test_json_table.`binary` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: binary_mod_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: binary_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`binary_xor_json` = test_json_table.`binary` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3435,8 +3553,6 @@ WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: referenced column: varbinary/json WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: varbinary/json -ERROR: division by zero -CONTEXT: referenced column: varbinary/json UPDATE test_json_type, test_json_table SET test_json_type.`varbinary%json` = test_json_table.`varbinary` % test_json_table.`json`; ERROR: failed to find conversion function from "varbinary" to numeric CONTEXT: referenced column: test_json_type @@ -3468,7 +3584,19 @@ LINE 1: ...json_table SET test_json_type.`varbinary&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`varbinary_div_json` = test_json_table.`varbinary` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: varbinary_div_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: varbinary_div_json UPDATE test_json_type, test_json_table SET test_json_type.`varbinary_mod_json` = test_json_table.`varbinary` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: varbinary_mod_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: varbinary_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`varbinary_xor_json` = test_json_table.`varbinary` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3508,8 +3636,6 @@ WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: referenced column: tinyblob/json WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: tinyblob/json -ERROR: division by zero -CONTEXT: referenced column: tinyblob/json UPDATE test_json_type, test_json_table SET test_json_type.`tinyblob%json` = test_json_table.`tinyblob` % test_json_table.`json`; ERROR: failed to find conversion function from tinyblob to numeric CONTEXT: referenced column: test_json_type @@ -3541,7 +3667,19 @@ LINE 1: ..._json_table SET test_json_type.`tinyblob&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`tinyblob_div_json` = test_json_table.`tinyblob` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: tinyblob_div_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: tinyblob_div_json UPDATE test_json_type, test_json_table SET test_json_type.`tinyblob_mod_json` = test_json_table.`tinyblob` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: tinyblob_mod_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: tinyblob_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`tinyblob_xor_json` = test_json_table.`tinyblob` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3581,8 +3719,6 @@ WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: referenced column: blob/json WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: blob/json -ERROR: division by zero -CONTEXT: referenced column: blob/json UPDATE test_json_type, test_json_table SET test_json_type.`blob%json` = test_json_table.`blob` % test_json_table.`json`; ERROR: failed to find conversion function from blob to numeric CONTEXT: referenced column: test_json_type @@ -3614,7 +3750,19 @@ LINE 1: ...test_json_table SET test_json_type.`blob&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`blob_div_json` = test_json_table.`blob` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: blob_div_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: blob_div_json UPDATE test_json_type, test_json_table SET test_json_type.`blob_mod_json` = test_json_table.`blob` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: blob_mod_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: blob_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`blob_xor_json` = test_json_table.`blob` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3654,8 +3802,6 @@ WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: referenced column: mediumblob/json WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: mediumblob/json -ERROR: division by zero -CONTEXT: referenced column: mediumblob/json UPDATE test_json_type, test_json_table SET test_json_type.`mediumblob%json` = test_json_table.`mediumblob` % test_json_table.`json`; ERROR: failed to find conversion function from mediumblob to numeric CONTEXT: referenced column: test_json_type @@ -3687,7 +3833,19 @@ LINE 1: ...son_table SET test_json_type.`mediumblob&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`mediumblob_div_json` = test_json_table.`mediumblob` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: mediumblob_div_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: mediumblob_div_json UPDATE test_json_type, test_json_table SET test_json_type.`mediumblob_mod_json` = test_json_table.`mediumblob` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: mediumblob_mod_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: mediumblob_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`mediumblob_xor_json` = test_json_table.`mediumblob` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3727,8 +3885,6 @@ WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: referenced column: longblob/json WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: longblob/json -ERROR: division by zero -CONTEXT: referenced column: longblob/json UPDATE test_json_type, test_json_table SET test_json_type.`longblob%json` = test_json_table.`longblob` % test_json_table.`json`; ERROR: failed to find conversion function from longblob to numeric CONTEXT: referenced column: test_json_type @@ -3760,7 +3916,19 @@ LINE 1: ..._json_table SET test_json_type.`longblob&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`longblob_div_json` = test_json_table.`longblob` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: longblob_div_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: longblob_div_json UPDATE test_json_type, test_json_table SET test_json_type.`longblob_mod_json` = test_json_table.`longblob` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: longblob_mod_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: longblob_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`longblob_xor_json` = test_json_table.`longblob` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3800,8 +3968,6 @@ WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: referenced column: text/json WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: text/json -ERROR: division by zero -CONTEXT: referenced column: text/json UPDATE test_json_type, test_json_table SET test_json_type.`text%json` = test_json_table.`text` % test_json_table.`json`; WARNING: invalid input syntax for type numeric: "1.23a" CONTEXT: referenced column: text%json @@ -3833,7 +3999,19 @@ CONTEXT: referenced column: text&json UPDATE test_json_type, test_json_table SET test_json_type.`text||json` = test_json_table.`text` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`text&&json` = test_json_table.`text` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`text_div_json` = test_json_table.`text` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: text_div_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: text_div_json UPDATE test_json_type, test_json_table SET test_json_type.`text_mod_json` = test_json_table.`text` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: text_mod_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: text_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`text_xor_json` = test_json_table.`text` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "1.23a" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3857,8 +4035,6 @@ CONTEXT: referenced column: enum_t*json UPDATE test_json_type, test_json_table SET test_json_type.`enum_t/json` = test_json_table.`enum_t` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: enum_t/json -ERROR: division by zero -CONTEXT: referenced column: enum_t/json UPDATE test_json_type, test_json_table SET test_json_type.`enum_t%json` = test_json_table.`enum_t` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`enum_t^json` = test_json_table.`enum_t` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -3886,7 +4062,13 @@ LINE 1: ...st_json_table SET test_json_type.`enum_t&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`enum_t_div_json` = test_json_table.`enum_t` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: enum_t_div_json UPDATE test_json_type, test_json_table SET test_json_type.`enum_t_mod_json` = test_json_table.`enum_t` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: enum_t_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`enum_t_xor_json` = test_json_table.`enum_t` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3914,8 +4096,6 @@ CONTEXT: referenced column: set_t*json UPDATE test_json_type, test_json_table SET test_json_type.`set_t/json` = test_json_table.`set_t` / test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: set_t/json -ERROR: division by zero -CONTEXT: referenced column: set_t/json UPDATE test_json_type, test_json_table SET test_json_type.`set_t%json` = test_json_table.`set_t` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`set_t^json` = test_json_table.`set_t` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -3943,7 +4123,13 @@ LINE 1: ...est_json_table SET test_json_type.`set_t&&json` = test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`set_t_div_json` = test_json_table.`set_t` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(anyelement,json) line 3 at RETURN +referenced column: set_t_div_json UPDATE test_json_type, test_json_table SET test_json_type.`set_t_mod_json` = test_json_table.`set_t` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(anyelement,json) line 3 at RETURN +referenced column: set_t_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`set_t_xor_json` = test_json_table.`set_t` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -3992,7 +4178,13 @@ CONTEXT: referenced column: json&int1 UPDATE test_json_type, test_json_table SET test_json_type.`json||int1` = test_json_table.`json` || test_json_table.`int1`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&int1` = test_json_table.`json` && test_json_table.`int1`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_int1` = test_json_table.`json` div test_json_table.`int1`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_int1 UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_int1` = test_json_table.`json` mod test_json_table.`int1`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_int1 UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_int1` = test_json_table.`json` xor test_json_table.`int1`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4033,7 +4225,13 @@ CONTEXT: referenced column: json&uint1 UPDATE test_json_type, test_json_table SET test_json_type.`json||uint1` = test_json_table.`json` || test_json_table.`uint1`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&uint1` = test_json_table.`json` && test_json_table.`uint1`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_uint1` = test_json_table.`json` div test_json_table.`uint1`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_uint1 UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_uint1` = test_json_table.`json` mod test_json_table.`uint1`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_uint1 UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_uint1` = test_json_table.`json` xor test_json_table.`uint1`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4074,7 +4272,13 @@ CONTEXT: referenced column: json&int2 UPDATE test_json_type, test_json_table SET test_json_type.`json||int2` = test_json_table.`json` || test_json_table.`int2`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&int2` = test_json_table.`json` && test_json_table.`int2`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_int2` = test_json_table.`json` div test_json_table.`int2`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_int2 UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_int2` = test_json_table.`json` mod test_json_table.`int2`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_int2 UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_int2` = test_json_table.`json` xor test_json_table.`int2`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4115,7 +4319,13 @@ CONTEXT: referenced column: json&uint2 UPDATE test_json_type, test_json_table SET test_json_type.`json||uint2` = test_json_table.`json` || test_json_table.`uint2`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&uint2` = test_json_table.`json` && test_json_table.`uint2`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_uint2` = test_json_table.`json` div test_json_table.`uint2`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_uint2 UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_uint2` = test_json_table.`json` mod test_json_table.`uint2`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_uint2 UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_uint2` = test_json_table.`json` xor test_json_table.`uint2`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4156,7 +4366,13 @@ CONTEXT: referenced column: json&int4 UPDATE test_json_type, test_json_table SET test_json_type.`json||int4` = test_json_table.`json` || test_json_table.`int4`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&int4` = test_json_table.`json` && test_json_table.`int4`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_int4` = test_json_table.`json` div test_json_table.`int4`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_int4 UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_int4` = test_json_table.`json` mod test_json_table.`int4`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_int4 UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_int4` = test_json_table.`json` xor test_json_table.`int4`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4197,7 +4413,13 @@ CONTEXT: referenced column: json&uint4 UPDATE test_json_type, test_json_table SET test_json_type.`json||uint4` = test_json_table.`json` || test_json_table.`uint4`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&uint4` = test_json_table.`json` && test_json_table.`uint4`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_uint4` = test_json_table.`json` div test_json_table.`uint4`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_uint4 UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_uint4` = test_json_table.`json` mod test_json_table.`uint4`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_uint4 UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_uint4` = test_json_table.`json` xor test_json_table.`uint4`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4238,7 +4460,13 @@ CONTEXT: referenced column: json&int8 UPDATE test_json_type, test_json_table SET test_json_type.`json||int8` = test_json_table.`json` || test_json_table.`int8`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&int8` = test_json_table.`json` && test_json_table.`int8`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_int8` = test_json_table.`json` div test_json_table.`int8`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_int8 UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_int8` = test_json_table.`json` mod test_json_table.`int8`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_int8 UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_int8` = test_json_table.`json` xor test_json_table.`int8`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4279,7 +4507,13 @@ CONTEXT: referenced column: json&uint8 UPDATE test_json_type, test_json_table SET test_json_type.`json||uint8` = test_json_table.`json` || test_json_table.`uint8`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&uint8` = test_json_table.`json` && test_json_table.`uint8`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_uint8` = test_json_table.`json` div test_json_table.`uint8`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_uint8 UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_uint8` = test_json_table.`json` mod test_json_table.`uint8`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_uint8 UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_uint8` = test_json_table.`json` xor test_json_table.`uint8`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4318,7 +4552,13 @@ CONTEXT: referenced column: json&float4 UPDATE test_json_type, test_json_table SET test_json_type.`json||float4` = test_json_table.`json` || test_json_table.`float4`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&float4` = test_json_table.`json` && test_json_table.`float4`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_float4` = test_json_table.`json` div test_json_table.`float4`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_float4 UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_float4` = test_json_table.`json` mod test_json_table.`float4`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_float4 UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_float4` = test_json_table.`json` xor test_json_table.`float4`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4357,7 +4597,13 @@ CONTEXT: referenced column: json&float8 UPDATE test_json_type, test_json_table SET test_json_type.`json||float8` = test_json_table.`json` || test_json_table.`float8`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&float8` = test_json_table.`json` && test_json_table.`float8`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_float8` = test_json_table.`json` div test_json_table.`float8`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_float8 UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_float8` = test_json_table.`json` mod test_json_table.`float8`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_float8 UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_float8` = test_json_table.`json` xor test_json_table.`float8`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4396,7 +4642,13 @@ CONTEXT: referenced column: json&numeric UPDATE test_json_type, test_json_table SET test_json_type.`json||numeric` = test_json_table.`json` || test_json_table.`numeric`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&numeric` = test_json_table.`json` && test_json_table.`numeric`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_numeric` = test_json_table.`json` div test_json_table.`numeric`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_numeric UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_numeric` = test_json_table.`json` mod test_json_table.`numeric`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_numeric UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_numeric` = test_json_table.`json` xor test_json_table.`numeric`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4441,7 +4693,13 @@ CONTEXT: referenced column: json&bit1 UPDATE test_json_type, test_json_table SET test_json_type.`json||bit1` = test_json_table.`json` || test_json_table.`bit1`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&bit1` = test_json_table.`json` && test_json_table.`bit1`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_bit1` = test_json_table.`json` div test_json_table.`bit1`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_bit1 UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_bit1` = test_json_table.`json` mod test_json_table.`bit1`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_bit1 UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_bit1` = test_json_table.`json` xor test_json_table.`bit1`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4486,7 +4744,13 @@ CONTEXT: referenced column: json&bit64 UPDATE test_json_type, test_json_table SET test_json_type.`json||bit64` = test_json_table.`json` || test_json_table.`bit64`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&bit64` = test_json_table.`json` && test_json_table.`bit64`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_bit64` = test_json_table.`json` div test_json_table.`bit64`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_bit64 UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_bit64` = test_json_table.`json` mod test_json_table.`bit64`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_bit64 UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_bit64` = test_json_table.`json` xor test_json_table.`bit64`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4525,7 +4789,13 @@ CONTEXT: referenced column: json&boolean UPDATE test_json_type, test_json_table SET test_json_type.`json||boolean` = test_json_table.`json` || test_json_table.`boolean`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&boolean` = test_json_table.`json` && test_json_table.`boolean`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_boolean` = test_json_table.`json` div test_json_table.`boolean`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_boolean UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_boolean` = test_json_table.`json` mod test_json_table.`boolean`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_boolean -- UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_boolean` = test_json_table.`json` xor test_json_table.`boolean`; UPDATE test_json_type, test_json_table SET test_json_type.`json_and_boolean` = test_json_table.`json` and test_json_table.`boolean`; UPDATE test_json_type, test_json_table SET test_json_type.`json_or_boolean` = test_json_table.`json` or test_json_table.`boolean`; @@ -4560,7 +4830,13 @@ CONTEXT: referenced column: json&date UPDATE test_json_type, test_json_table SET test_json_type.`json||date` = test_json_table.`json` || test_json_table.`date`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&date` = test_json_table.`json` && test_json_table.`date`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_date` = test_json_table.`json` div test_json_table.`date`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_date UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_date` = test_json_table.`json` mod test_json_table.`date`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_date UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_date` = test_json_table.`json` xor test_json_table.`date`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4599,7 +4875,13 @@ CONTEXT: referenced column: json&time UPDATE test_json_type, test_json_table SET test_json_type.`json||time` = test_json_table.`json` || test_json_table.`time`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&time` = test_json_table.`json` && test_json_table.`time`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_time` = test_json_table.`json` div test_json_table.`time`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_time UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_time` = test_json_table.`json` mod test_json_table.`time`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_time UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_time` = test_json_table.`json` xor test_json_table.`time`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4638,7 +4920,13 @@ CONTEXT: referenced column: json&time(4) UPDATE test_json_type, test_json_table SET test_json_type.`json||time(4)` = test_json_table.`json` || test_json_table.`time(4)`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&time(4)` = test_json_table.`json` && test_json_table.`time(4)`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_time(4)` = test_json_table.`json` div test_json_table.`time(4)`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_time(4) UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_time(4)` = test_json_table.`json` mod test_json_table.`time(4)`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_time(4) UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_time(4)` = test_json_table.`json` xor test_json_table.`time(4)`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4691,7 +4979,13 @@ LINE 1: ...type.`json&&datetime` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_datetime` = test_json_table.`json` div test_json_table.`datetime`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_datetime UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_datetime` = test_json_table.`json` mod test_json_table.`datetime`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_datetime UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_datetime` = test_json_table.`json` xor test_json_table.`datetime`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4756,7 +5050,13 @@ LINE 1: ...e.`json&&datetime(4)` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_datetime(4)` = test_json_table.`json` div test_json_table.`datetime(4)`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_datetime(4) UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_datetime(4)` = test_json_table.`json` mod test_json_table.`datetime(4)`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_datetime(4) UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_datetime(4)` = test_json_table.`json` xor test_json_table.`datetime(4)`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4821,7 +5121,13 @@ LINE 1: ...ype.`json&×tamp` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_timestamp` = test_json_table.`json` div test_json_table.`timestamp`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_timestamp UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_timestamp` = test_json_table.`json` mod test_json_table.`timestamp`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_timestamp UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_timestamp` = test_json_table.`json` xor test_json_table.`timestamp`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4886,7 +5192,13 @@ LINE 1: ....`json&×tamp(4)` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_timestamp(4)` = test_json_table.`json` div test_json_table.`timestamp(4)`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_timestamp(4) UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_timestamp(4)` = test_json_table.`json` mod test_json_table.`timestamp(4)`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_timestamp(4) UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_timestamp(4)` = test_json_table.`json` xor test_json_table.`timestamp(4)`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -4945,7 +5257,13 @@ LINE 1: ...son_type.`json&&year` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_year` = test_json_table.`json` div test_json_table.`year`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_year UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_year` = test_json_table.`json` mod test_json_table.`year`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_year UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_year` = test_json_table.`json` xor test_json_table.`year`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5012,7 +5330,19 @@ CONTEXT: referenced column: json&char UPDATE test_json_type, test_json_table SET test_json_type.`json||char` = test_json_table.`json` || test_json_table.`char`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&char` = test_json_table.`json` && test_json_table.`char`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_char` = test_json_table.`json` div test_json_table.`char`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_char +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_char UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_char` = test_json_table.`json` mod test_json_table.`char`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_char +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_char UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_char` = test_json_table.`json` xor test_json_table.`char`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5075,7 +5405,19 @@ CONTEXT: referenced column: json&varchar UPDATE test_json_type, test_json_table SET test_json_type.`json||varchar` = test_json_table.`json` || test_json_table.`varchar`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&varchar` = test_json_table.`json` && test_json_table.`varchar`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_varchar` = test_json_table.`json` div test_json_table.`varchar`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_varchar +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_varchar UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_varchar` = test_json_table.`json` mod test_json_table.`varchar`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_varchar +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_varchar UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_varchar` = test_json_table.`json` xor test_json_table.`varchar`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5138,7 +5480,19 @@ LINE 1: ...n_type.`json&&binary` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_binary` = test_json_table.`json` div test_json_table.`binary`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_binary +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_binary UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_binary` = test_json_table.`json` mod test_json_table.`binary`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_binary +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_binary UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_binary` = test_json_table.`json` xor test_json_table.`binary`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5209,7 +5563,19 @@ LINE 1: ...ype.`json&&varbinary` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_varbinary` = test_json_table.`json` div test_json_table.`varbinary`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_varbinary +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_varbinary UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_varbinary` = test_json_table.`json` mod test_json_table.`varbinary`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_varbinary +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_varbinary UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_varbinary` = test_json_table.`json` xor test_json_table.`varbinary`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5280,7 +5646,19 @@ LINE 1: ...type.`json&&tinyblob` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_tinyblob` = test_json_table.`json` div test_json_table.`tinyblob`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_tinyblob +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_tinyblob UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_tinyblob` = test_json_table.`json` mod test_json_table.`tinyblob`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_tinyblob +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_tinyblob UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_tinyblob` = test_json_table.`json` xor test_json_table.`tinyblob`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5351,7 +5729,19 @@ LINE 1: ...son_type.`json&&blob` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_blob` = test_json_table.`json` div test_json_table.`blob`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_blob +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_blob UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_blob` = test_json_table.`json` mod test_json_table.`blob`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_blob +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_blob UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_blob` = test_json_table.`json` xor test_json_table.`blob`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5422,7 +5812,19 @@ LINE 1: ...pe.`json&&mediumblob` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_mediumblob` = test_json_table.`json` div test_json_table.`mediumblob`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_mediumblob +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_mediumblob UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_mediumblob` = test_json_table.`json` mod test_json_table.`mediumblob`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_mediumblob +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_mediumblob UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_mediumblob` = test_json_table.`json` xor test_json_table.`mediumblob`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5493,7 +5895,19 @@ LINE 1: ...type.`json&&longblob` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_longblob` = test_json_table.`json` div test_json_table.`longblob`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_longblob +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_longblob UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_longblob` = test_json_table.`json` mod test_json_table.`longblob`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_longblob +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_longblob UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_longblob` = test_json_table.`json` xor test_json_table.`longblob`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5564,7 +5978,19 @@ CONTEXT: referenced column: json&text UPDATE test_json_type, test_json_table SET test_json_type.`json||text` = test_json_table.`json` || test_json_table.`text`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&text` = test_json_table.`json` && test_json_table.`text`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_text` = test_json_table.`json` div test_json_table.`text`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_text +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_text UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_text` = test_json_table.`json` mod test_json_table.`text`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_text +WARNING: invalid input syntax for type double precision: "1.23a" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_text UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_text` = test_json_table.`json` xor test_json_table.`text`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5615,7 +6041,13 @@ LINE 1: ...n_type.`json&&enum_t` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_enum_t` = test_json_table.`json` div test_json_table.`enum_t`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_enum_t UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_enum_t` = test_json_table.`json` mod test_json_table.`enum_t`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_enum_t UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_enum_t` = test_json_table.`json` xor test_json_table.`enum_t`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5670,7 +6102,13 @@ LINE 1: ...on_type.`json&&set_t` = test_json_table.`json` && test_json_... ^ CONTEXT: referenced column: test_json_type UPDATE test_json_type, test_json_table SET test_json_type.`json_div_set_t` = test_json_table.`json` div test_json_table.`set_t`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,anyelement) line 3 at RETURN +referenced column: json_div_set_t UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_set_t` = test_json_table.`json` mod test_json_table.`set_t`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,anyelement) line 3 at RETURN +referenced column: json_mod_set_t UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_set_t` = test_json_table.`json` xor test_json_table.`set_t`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5706,8 +6144,6 @@ WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: json/json WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: referenced column: json/json -ERROR: division by zero -CONTEXT: referenced column: json/json UPDATE test_json_type, test_json_table SET test_json_type.`json%json` = test_json_table.`json` % test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`json^json` = test_json_table.`json` ^ test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" @@ -5737,7 +6173,19 @@ CONTEXT: referenced column: json&json UPDATE test_json_type, test_json_table SET test_json_type.`json||json` = test_json_table.`json` || test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`json&&json` = test_json_table.`json` && test_json_table.`json`; UPDATE test_json_type, test_json_table SET test_json_type.`json_div_json` = test_json_table.`json` div test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,json) line 3 at RETURN +referenced column: json_div_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function "div"(json,json) line 3 at RETURN +referenced column: json_div_json UPDATE test_json_type, test_json_table SET test_json_type.`json_mod_json` = test_json_table.`json` mod test_json_table.`json`; +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,json) line 3 at RETURN +referenced column: json_mod_json +WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" +CONTEXT: PL/pgSQL function b_mod(json,json) line 3 at RETURN +referenced column: json_mod_json UPDATE test_json_type, test_json_table SET test_json_type.`json_xor_json` = test_json_table.`json` xor test_json_table.`json`; WARNING: invalid input syntax for type double precision: "{"a": 1, "b": 2}" CONTEXT: SQL statement "SELECT (select a ^ b)" @@ -5768,7 +6216,7 @@ int1+json | 1 int1-json | 1 int1*json | 0 int1/json | -int1%json | 1 +int1%json | int1^json | 1 int1>>json | 1 int1<>json | 1 int2<>json | 1 int4<>json | 1 int8<>json | 1 float4<>json | 1 float8<>json | 1 numeric<>json | 1 bit1<>json | 0000000000000000000000000000000000000000000000000000000000000111 bit64<>json | 1 boolean<>json | 20230205 date<>json | 191050 time<>json | 191050 time(4)<>json | 20230205191050 datetime<>json | 20230205191050 datetime(4)<>json | 20230205191050 timestamp<>json | 20230205191050 timestamp(4)<>json | 2023 year<>json | 1 char<>json | 1 varchar<>json | 1 text<>json | 1 enum_t<>json | 5 set_t<>json | 0 json<sqlModeFlags & OPT_SQL_MODE_STRICT) && !CMD_TAG_IS_SELECT()) #define SQL_MODE_FULL_GROUP() (GetSessionContext()->sqlModeFlags & OPT_SQL_MODE_FULL_GROUP) -#define PG_RETURN_INT8(x) return Int8GetDatum(x) #define SQL_MODE_PIPES_AS_CONCAT() (GetSessionContext()->sqlModeFlags & OPT_SQL_MODE_PIPES_AS_CONCAT) #define SQL_MODE_ANSI_QUOTES() (GetSessionContext()->sqlModeFlags & OPT_SQL_MODE_ANSI_QUOTES) #define SQL_MODE_NO_ZERO_DATE() (GetSessionContext()->sqlModeFlags & OPT_SQL_MODE_NO_ZERO_DATE) @@ -29,7 +30,8 @@ #define SQL_MODE_AllOW_PROCEDURE_WITH_SELECT() \ (GetSessionContext()->sqlModeFlags & OPT_SQL_MODE_BLOCK_RETURN_MULTI_RESULTS) #define SQL_MODE_ATUO_RECOMPILE_FUNCTION() (GetSessionContext()->sqlModeFlags & OPT_SQL_MODE_ATUO_RECOMPILE_FUNCTION) -#define GET_QUOTE() (SQL_MODE_ANSI_QUOTES() ? '\"' : '`') +#define SQL_MODE_ERROR_FOR_DIVISION_BY_ZERO() (GetSessionContext()->sqlModeFlags & \ + OPT_SQL_MODE_ERROR_FOR_DIVISION_BY_ZERO) extern int32 PgAtoiInternal(char* s, int size, int c, bool sqlModeStrict, bool can_ignore, bool isUnsigned = false); extern void CheckSpaceAndDotInternal(char& digitAfterDot, const char** ptr, @@ -142,4 +144,12 @@ invalid_syntax: return (int64)tmp; } +extern inline void CheckErrDivByZero(bool ignore) +{ + if (!SQL_MODE_ERROR_FOR_DIVISION_BY_ZERO()) { + return; + } + ereport((!ignore && SQL_MODE_STRICT()) ? ERROR : WARNING, + (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); +} #endif /* MYSQLMODE_H */ diff --git a/contrib/dolphin/output/dump_dumpall_test.source b/contrib/dolphin/output/dump_dumpall_test.source index c255d4b9f..1d49f4c50 100644 --- a/contrib/dolphin/output/dump_dumpall_test.source +++ b/contrib/dolphin/output/dump_dumpall_test.source @@ -401,7 +401,7 @@ select mod(16, 7); select mod(0.0::float8, 0.0::numeric); mod ----- - 0 + (1 row) select sqrt(64::numeric); @@ -910,7 +910,7 @@ select mod(16, 7); select mod(0.0::float8, 0.0::numeric); mod ----- - 0 + (1 row) select sqrt(64::numeric); @@ -1420,7 +1420,7 @@ select mod(16, 7); select mod(0.0::float8, 0.0::numeric); mod ----- - 0 + (1 row) select sqrt(64::numeric); diff --git a/contrib/dolphin/plugin_postgres.cpp b/contrib/dolphin/plugin_postgres.cpp index 7c57f15ce..56726b864 100644 --- a/contrib/dolphin/plugin_postgres.cpp +++ b/contrib/dolphin/plugin_postgres.cpp @@ -100,7 +100,8 @@ static const struct sql_mode_entry sql_mode_options[OPT_SQL_MODE_MAX] = { {"no_zero_date", OPT_SQL_MODE_NO_ZERO_DATE}, {"pad_char_to_full_length", OPT_SQL_MODE_PAD_CHAR_TO_FULL_LENGTH}, {"block_return_multi_results", OPT_SQL_MODE_BLOCK_RETURN_MULTI_RESULTS}, - {"auto_recompile_function", OPT_SQL_MODE_ATUO_RECOMPILE_FUNCTION} + {"auto_recompile_function", OPT_SQL_MODE_ATUO_RECOMPILE_FUNCTION}, + {"error_for_division_by_zero", OPT_SQL_MODE_ERROR_FOR_DIVISION_BY_ZERO} }; #define DOLPHIN_TYPES_NUM 12 @@ -932,7 +933,7 @@ void init_session_vars(void) NULL, &GetSessionContext()->sqlModeString, "sql_mode_strict,sql_mode_full_group,pipes_as_concat,ansi_quotes,no_zero_date," - "pad_char_to_full_length,auto_recompile_function", + "pad_char_to_full_length,auto_recompile_function,error_for_division_by_zero", PGC_USERSET, GUC_LIST_INPUT | GUC_REPORT, CheckSqlMode, diff --git a/contrib/dolphin/plugin_utils/adt/cash.cpp b/contrib/dolphin/plugin_utils/adt/cash.cpp index 14d695d30..d44c79c50 100644 --- a/contrib/dolphin/plugin_utils/adt/cash.cpp +++ b/contrib/dolphin/plugin_utils/adt/cash.cpp @@ -33,7 +33,9 @@ #include "utils/numeric.h" #include "utils/numeric_gs.h" #include "utils/pg_locale.h" - +#ifdef DOLPHIN +#include "plugin_commands/mysqlmode.h" +#endif #define CACHE_BUFF_LEN_L 256 extern "C" DLL_PUBLIC Datum uint8mul(PG_FUNCTION_ARGS); @@ -661,8 +663,13 @@ Datum cash_div_cash(PG_FUNCTION_ARGS) Cash divisor = PG_GETARG_CASH(1); float8 quotient; - if (divisor == 0) + if (divisor == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); + } quotient = (float8)dividend / (float8)divisor; PG_RETURN_FLOAT8(quotient); @@ -703,8 +710,13 @@ Datum cash_div_flt8(PG_FUNCTION_ARGS) float8 f = PG_GETARG_FLOAT8(1); Cash result; - if (f == 0.0) + if (f == 0.0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); + } result = rint(c / f); PG_RETURN_CASH(result); @@ -746,8 +758,13 @@ Datum cash_div_flt4(PG_FUNCTION_ARGS) float4 f = PG_GETARG_FLOAT4(1); Cash result; - if (f == 0.0) + if (f == 0.0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); + } result = rint(c / (float8)f); PG_RETURN_CASH(result); @@ -788,9 +805,13 @@ Datum cash_div_int8(PG_FUNCTION_ARGS) int64 i = PG_GETARG_INT64(1); Cash result; - if (i == 0) + if (i == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); - + } result = c / i; PG_RETURN_CASH(result); @@ -832,8 +853,13 @@ Datum cash_div_int4(PG_FUNCTION_ARGS) int32 i = PG_GETARG_INT32(1); Cash result; - if (i == 0) + if (i == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); + } result = c / i; @@ -876,8 +902,13 @@ Datum cash_div_int2(PG_FUNCTION_ARGS) int16 s = PG_GETARG_INT16(1); Cash result; - if (s == 0) + if (s == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); + } result = c / s; PG_RETURN_CASH(result); @@ -919,8 +950,13 @@ Datum cash_div_int1(PG_FUNCTION_ARGS) int1 s = PG_GETARG_INT8(1); Cash result; - if (s == 0) + if (s == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); + } result = c / s; PG_RETURN_CASH(result); diff --git a/contrib/dolphin/plugin_utils/adt/float.cpp b/contrib/dolphin/plugin_utils/adt/float.cpp index e049266ef..10c64733c 100644 --- a/contrib/dolphin/plugin_utils/adt/float.cpp +++ b/contrib/dolphin/plugin_utils/adt/float.cpp @@ -967,9 +967,13 @@ Datum float4div(PG_FUNCTION_ARGS) float4 arg2 = PG_GETARG_FLOAT4(1); float4 result; - if (arg2 == 0.0) + if (arg2 == 0.0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); - + } if (arg1 == 0.0) PG_RETURN_FLOAT4(0); @@ -1040,9 +1044,13 @@ Datum float8div(PG_FUNCTION_ARGS) float8 arg2 = PG_GETARG_FLOAT8(1); float8 result; - if (arg2 == 0.0) + if (arg2 == 0.0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); - + } #ifdef DOLPHIN if (arg1 == 0.0) { if (GetSessionContext()->enableBCmptMode && arg2 < 0) { @@ -2688,8 +2696,13 @@ Datum float48div(PG_FUNCTION_ARGS) float8 arg2 = PG_GETARG_FLOAT8(1); float8 result; - if (arg2 == 0.0) + if (arg2 == 0.0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); + } #ifdef DOLPHIN if (arg1 == 0.0) { @@ -2770,9 +2783,13 @@ Datum float84div(PG_FUNCTION_ARGS) float4 arg2 = PG_GETARG_FLOAT4(1); float8 result; - if (arg2 == 0.0) + if (arg2 == 0.0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); - + } #ifdef DOLPHIN if (arg1 == 0.0) { if (GetSessionContext()->enableBCmptMode && arg2 < 0) { @@ -3248,7 +3265,8 @@ Datum dolphin_float4div(PG_FUNCTION_ARGS) float8 result; if (arg2 == 0.0) { - ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); } if (arg1 == 0.0) { diff --git a/contrib/dolphin/plugin_utils/adt/int.cpp b/contrib/dolphin/plugin_utils/adt/int.cpp index 693e86598..37c899b90 100644 --- a/contrib/dolphin/plugin_utils/adt/int.cpp +++ b/contrib/dolphin/plugin_utils/adt/int.cpp @@ -681,6 +681,10 @@ Datum int4div(PG_FUNCTION_ARGS) float8 result; if (arg2 == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); /* ensure compiler realizes we mustn't reach the division (gcc bug) */ PG_RETURN_NULL(); @@ -781,6 +785,10 @@ Datum int2div(PG_FUNCTION_ARGS) float8 result; if (arg2 == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); /* ensure compiler realizes we mustn't reach the division (gcc bug) */ PG_RETURN_NULL(); @@ -851,6 +859,10 @@ Datum int24div(PG_FUNCTION_ARGS) float8 result; if (arg2 == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); /* ensure compiler realizes we mustn't reach the division (gcc bug) */ PG_RETURN_NULL(); @@ -905,6 +917,10 @@ Datum int42div(PG_FUNCTION_ARGS) float8 result; if (arg2 == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); /* ensure compiler realizes we mustn't reach the division (gcc bug) */ PG_RETURN_NULL(); @@ -940,6 +956,10 @@ Datum int4mod(PG_FUNCTION_ARGS) int32 arg2 = PG_GETARG_INT32(1); if (unlikely(arg2 == 0)) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif if (DB_IS_CMPT(PG_FORMAT)) { /* zero is not allowed to be divisor if compatible with PG */ ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); @@ -970,6 +990,10 @@ Datum int2mod(PG_FUNCTION_ARGS) int16 arg2 = PG_GETARG_INT16(1); if (unlikely(arg2 == 0)) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif if (DB_IS_CMPT(PG_FORMAT)) { /* zero is not allowed to be divisor if compatible with PG */ ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); @@ -2029,6 +2053,10 @@ Datum int1div(PG_FUNCTION_ARGS) float8 result; if (arg2 == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); /* ensure compiler realizes we mustn't reach the division (gcc bug) */ @@ -2064,7 +2092,8 @@ Datum int1mod(PG_FUNCTION_ARGS) int8 arg2 = PG_GETARG_INT8(1); if (arg2 == 0) { - PG_RETURN_INT8(arg1); + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); } /* No overflow is possible */ diff --git a/contrib/dolphin/plugin_utils/adt/int16.cpp b/contrib/dolphin/plugin_utils/adt/int16.cpp index 4ef98d51b..3f672f265 100644 --- a/contrib/dolphin/plugin_utils/adt/int16.cpp +++ b/contrib/dolphin/plugin_utils/adt/int16.cpp @@ -709,6 +709,10 @@ Datum int16div(PG_FUNCTION_ARGS) float8 result; if (arg2 == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errmodule(MOD_FUNCTION), errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"), diff --git a/contrib/dolphin/plugin_utils/adt/int8.cpp b/contrib/dolphin/plugin_utils/adt/int8.cpp index c1004629f..903c5fc50 100644 --- a/contrib/dolphin/plugin_utils/adt/int8.cpp +++ b/contrib/dolphin/plugin_utils/adt/int8.cpp @@ -476,6 +476,10 @@ Datum int8div(PG_FUNCTION_ARGS) float8 result; if (arg2 == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); /* ensure compiler realizes we mustn't reach the division (gcc bug) */ PG_RETURN_NULL(); @@ -528,6 +532,10 @@ Datum int8mod(PG_FUNCTION_ARGS) int64 arg2 = PG_GETARG_INT64(1); if (unlikely(arg2 == 0)) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif if (DB_IS_CMPT(PG_FORMAT)) { /* zero is not allowed to be divisor if compatible with PG */ ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); @@ -694,6 +702,10 @@ Datum int84div(PG_FUNCTION_ARGS) float8 result; if (arg2 == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); /* ensure compiler realizes we mustn't reach the division (gcc bug) */ PG_RETURN_NULL(); @@ -782,6 +794,10 @@ Datum int48div(PG_FUNCTION_ARGS) int64 arg2 = PG_GETARG_INT64(1); if (arg2 == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); /* ensure compiler realizes we mustn't reach the division (gcc bug) */ PG_RETURN_NULL(); @@ -861,6 +877,10 @@ Datum int82div(PG_FUNCTION_ARGS) float8 result; if (arg2 == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); /* ensure compiler realizes we mustn't reach the division (gcc bug) */ PG_RETURN_NULL(); @@ -956,6 +976,10 @@ Datum int28div(PG_FUNCTION_ARGS) int64 arg2 = PG_GETARG_INT64(1); if (arg2 == 0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); /* ensure compiler realizes we mustn't reach the division (gcc bug) */ PG_RETURN_NULL(); diff --git a/contrib/dolphin/plugin_utils/adt/numeric.cpp b/contrib/dolphin/plugin_utils/adt/numeric.cpp index 6a8d2c5d5..e5696661c 100644 --- a/contrib/dolphin/plugin_utils/adt/numeric.cpp +++ b/contrib/dolphin/plugin_utils/adt/numeric.cpp @@ -2570,6 +2570,10 @@ Datum numeric_div(PG_FUNCTION_ARGS) */ rscale = select_div_scale(&arg1, &arg2); #ifdef DOLPHIN + if (unlikely(arg2.ndigits == 0 || arg2.digits[0] == 0)) { + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); + } /* * The actual precision calculation method in M* is simulated here. * The result is compared with the actual precision of openGauss, @@ -2646,6 +2650,12 @@ Datum numeric_div_trunc(PG_FUNCTION_ARGS) */ init_var_from_num(num1, &arg1); init_var_from_num(num2, &arg2); +#ifdef DOLPHIN + if (unlikely(arg2.ndigits == 0 || arg2.digits[0] == 0)) { + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); + } +#endif init_var(&result); @@ -2706,7 +2716,10 @@ Datum numeric_mod(PG_FUNCTION_ARGS) free_var(&result); free_var(&arg2); free_var(&arg1); - +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif if (DB_IS_CMPT(PG_FORMAT)) { /* zero is not allowed to be divisor if compatible with PG */ ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); @@ -22499,11 +22512,15 @@ Datum oct_str(PG_FUNCTION_ARGS) PG_RETURN_TEXT_P(cstring_to_text(result)); } -static Numeric numeric_div_internal(NumericVar arg1, NumericVar arg2) +static Numeric numeric_div_internal(NumericVar arg1, NumericVar arg2, bool ignore) { NumericVar result; Numeric res; int rscale; + if (unlikely(arg2.ndigits == 0 || arg2.digits[0] == 0)) { + CheckErrDivByZero(ignore); + return NULL; + } init_var(&result); @@ -22511,7 +22528,6 @@ static Numeric numeric_div_internal(NumericVar arg1, NumericVar arg2) * Select scale for division result */ rscale = select_div_scale(&arg1, &arg2); -#ifdef DOLPHIN /* * The actual precision calculation method in M* is simulated here. * The result is compared with the actual precision of openGauss, @@ -22528,19 +22544,16 @@ static Numeric numeric_div_internal(NumericVar arg1, NumericVar arg2) int tempScale = ROUND_UP(scale1 + scale2 + GetSessionContext()->div_precision_increment) * DIG_PER_DEC1; rscale = tempScale > rscale ? tempScale : rscale; } -#endif /* * Do the divide and return the result */ div_var(&arg1, &arg2, &result, rscale, true); -#ifdef DOLPHIN if (enableBCmptMode) { int outputScale = arg1.dscale + div_precision_increment; round_var(&result, outputScale > oldScale ? outputScale : oldScale); } -#endif res = make_result(&result); @@ -22561,9 +22574,12 @@ Datum dolphin_int4div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_INT32(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int2div); @@ -22579,9 +22595,12 @@ Datum dolphin_int2div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_INT16(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int1div); @@ -22597,9 +22616,12 @@ Datum dolphin_int1div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_INT8(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int8div); @@ -22615,9 +22637,12 @@ Datum dolphin_int8div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar(PG_GETARG_INT64(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_uint1div); @@ -22633,9 +22658,12 @@ Datum dolphin_uint1div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_UINT8(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int1_div_uint1); @@ -22651,9 +22679,12 @@ Datum dolphin_int1_div_uint1(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_UINT8(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_uint1_div_int1); @@ -22669,9 +22700,12 @@ Datum dolphin_uint1_div_int1(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_INT8(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int24div); @@ -22687,9 +22721,12 @@ Datum dolphin_int24div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_INT32(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int28div); @@ -22705,9 +22742,12 @@ Datum dolphin_int28div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar(PG_GETARG_INT64(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int2_div_uint2); @@ -22723,9 +22763,12 @@ Datum dolphin_int2_div_uint2(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_UINT16(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int42div); @@ -22741,9 +22784,12 @@ Datum dolphin_int42div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_INT16(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int48div); @@ -22759,9 +22805,12 @@ Datum dolphin_int48div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar(PG_GETARG_INT64(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int4_div_uint4); @@ -22777,9 +22826,12 @@ Datum dolphin_int4_div_uint4(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_UINT32(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int82div); @@ -22795,9 +22847,12 @@ Datum dolphin_int82div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_INT16(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int84div); @@ -22813,9 +22868,12 @@ Datum dolphin_int84div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_INT32(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_uint2_div_int2); @@ -22831,9 +22889,12 @@ Datum dolphin_uint2_div_int2(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_INT16(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_uint2div); @@ -22849,9 +22910,12 @@ Datum dolphin_uint2div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_UINT16(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_uint4div); @@ -22867,9 +22931,12 @@ Datum dolphin_uint4div(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_UINT32(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_uint4_div_int4); @@ -22885,9 +22952,12 @@ Datum dolphin_uint4_div_int4(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar((int64)PG_GETARG_INT32(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_uint8_div_int8); @@ -22903,9 +22973,12 @@ Datum dolphin_uint8_div_int8(PG_FUNCTION_ARGS) init_var(&arg2_var); int64_to_numericvar(PG_GETARG_INT64(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_int8_div_uint8); @@ -22921,9 +22994,12 @@ Datum dolphin_int8_div_uint8(PG_FUNCTION_ARGS) init_var(&arg2_var); uint8_to_numericvar(PG_GETARG_UINT64(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } PG_FUNCTION_INFO_V1_PUBLIC(dolphin_uint8div); @@ -22939,9 +23015,12 @@ Datum dolphin_uint8div(PG_FUNCTION_ARGS) init_var(&arg2_var); uint8_to_numericvar(PG_GETARG_UINT64(1), &arg2_var); - Numeric result = numeric_div_internal(arg1_var, arg2_var); - - PG_RETURN_NUMERIC(result); + Numeric result = numeric_div_internal(arg1_var, arg2_var, fcinfo->can_ignore); + if (likely(result)) { + PG_RETURN_NUMERIC(result); + } else { + PG_RETURN_NULL(); + } } Datum numeric_cast_int8(PG_FUNCTION_ARGS) diff --git a/contrib/dolphin/plugin_utils/adt/timestamp.cpp b/contrib/dolphin/plugin_utils/adt/timestamp.cpp index 979901c63..eb8ec1dab 100644 --- a/contrib/dolphin/plugin_utils/adt/timestamp.cpp +++ b/contrib/dolphin/plugin_utils/adt/timestamp.cpp @@ -3850,8 +3850,13 @@ Datum interval_div(PG_FUNCTION_ARGS) result = (Interval*)palloc(sizeof(Interval)); - if (factor == 0.0) + if (factor == 0.0) { +#ifdef DOLPHIN + CheckErrDivByZero(fcinfo->can_ignore); + PG_RETURN_NULL(); +#endif ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero"))); + } if (isnan(factor)) { /* NaN convert process. It differs from interval_mul to maintain compatibility. */ INTERVAL_CONVERT_INFINITY_NAN(result); diff --git a/contrib/dolphin/plugin_vector/vecprimitive/numeric.inl b/contrib/dolphin/plugin_vector/vecprimitive/numeric.inl index 5650d401b..621a6007a 100644 --- a/contrib/dolphin/plugin_vector/vecprimitive/numeric.inl +++ b/contrib/dolphin/plugin_vector/vecprimitive/numeric.inl @@ -454,6 +454,9 @@ vnumeric_op(PG_FUNCTION_ARGS) uint16 num1Flags, num2Flags; // numeric flags of num1 and num2 Datum args[2]; FunctionCallInfoData finfo; +#ifdef DOLPHIN + finfo.isnull = false; +#endif finfo.arg = &args[0]; if(likely(pselection == NULL)) @@ -473,14 +476,26 @@ vnumeric_op(PG_FUNCTION_ARGS) arg2 = NUMERIC_FLAG_IS_BI128(num2Flags); // call big integer fast calculate function presult[i] = (BiFunMatrix[op][arg1][arg2])(leftarg, rightarg, NULL); +#ifdef DOLPHIN + SET_NOTNULL(pflagsRes[i]); +#endif } else // numeric_funcs { args[0] = NumericGetDatum(leftarg); args[1] = NumericGetDatum(rightarg); presult[i] = numericFun(&finfo); +#ifdef DOLPHIN + if (!finfo.isnull) { + SET_NOTNULL(pflagsRes[i]); + } else { + SET_NULL(pflagsRes[i]); + } +#endif } +#ifndef DOLPHIN SET_NOTNULL(pflagsRes[i]); +#endif } else { @@ -508,14 +523,26 @@ vnumeric_op(PG_FUNCTION_ARGS) arg2 = NUMERIC_FLAG_IS_BI128(num2Flags); // call big integer fast calculate function presult[i] = (BiFunMatrix[op][arg1][arg2])(leftarg, rightarg, NULL); +#ifdef DOLPHIN + SET_NOTNULL(pflagsRes[i]); +#endif } else // numeric_funcs { args[0] = NumericGetDatum(leftarg); args[1] = NumericGetDatum(rightarg); presult[i] = numericFun(&finfo); +#ifdef DOLPHIN + if (!finfo.isnull) { + SET_NOTNULL(pflagsRes[i]); + } else { + SET_NULL(pflagsRes[i]); + } +#endif } +#ifndef DOLPHIN SET_NOTNULL(pflagsRes[i]); +#endif } else { diff --git a/contrib/dolphin/plugin_vector/vecprimitive/varchar.inl b/contrib/dolphin/plugin_vector/vecprimitive/varchar.inl index 26d48db7e..8ab32c1d4 100644 --- a/contrib/dolphin/plugin_vector/vecprimitive/varchar.inl +++ b/contrib/dolphin/plugin_vector/vecprimitive/varchar.inl @@ -769,7 +769,7 @@ vtrim1(PG_FUNCTION_ARGS) FunctionCallInfoData finfo; finfo.arg = &args[0]; - + finfo.flinfo = fcinfo->flinfo; if (pselection != NULL) { diff --git a/contrib/dolphin/rollback_script/dolphin--2.0--1.1.sql b/contrib/dolphin/rollback_script/dolphin--2.0--1.1.sql index 18c296e6f..da1238fad 100644 --- a/contrib/dolphin/rollback_script/dolphin--2.0--1.1.sql +++ b/contrib/dolphin/rollback_script/dolphin--2.0--1.1.sql @@ -1904,4 +1904,19 @@ DROP FUNCTION IF EXISTS pg_catalog.hex(int8); DROP FUNCTION IF EXISTS pg_catalog.hex(int16); CREATE OR REPLACE FUNCTION pg_catalog.hex(int8) RETURNS text LANGUAGE C IMMUTABLE STRICT as '$libdir/dolphin', 'int_to_hex'; -DROP FUNCTION IF EXISTS pg_catalog.bit_bin_in(cstring, oid, integer); \ No newline at end of file +DROP FUNCTION IF EXISTS pg_catalog.bit_bin_in(cstring, oid, integer); + +DROP FUNCTION IF EXISTS pg_catalog.b_mod(a numeric, b numeric); +CREATE OR REPLACE FUNCTION pg_catalog.b_mod(a numeric, b numeric) +returns numeric +as +$$ +begin + IF b = 0 then + return null; + else + return (select a % b); + end if; +end; +$$ +language plpgsql; \ No newline at end of file diff --git a/contrib/dolphin/sql/create_function_test/m_type_create_proc.sql b/contrib/dolphin/sql/create_function_test/m_type_create_proc.sql index adfa2b4a7..fae8023b5 100644 --- a/contrib/dolphin/sql/create_function_test/m_type_create_proc.sql +++ b/contrib/dolphin/sql/create_function_test/m_type_create_proc.sql @@ -4,6 +4,7 @@ DROP ROLE if EXISTS us2; CREATE ROLE us2 IDENTIFIED BY 'Aa@123456'; GRANT ALL ON SCHEMA m_create_proc_type TO us2; SET ROLE us2 PASSWORD 'Aa@123456'; +set dolphin.sql_mode = 'sql_mode_strict,pipes_as_concat,ansi_quotes,no_zero_date,error_for_division_by_zero'; --test create procedure delimiter // diff --git a/contrib/dolphin/sql/db_b_parser3.sql b/contrib/dolphin/sql/db_b_parser3.sql index 6788c2444..441380621 100644 --- a/contrib/dolphin/sql/db_b_parser3.sql +++ b/contrib/dolphin/sql/db_b_parser3.sql @@ -67,6 +67,405 @@ select 123456 div 5 div 4; select 8 div 1 where 100 div 3 div 4 = 0; select 8 div 3 where 100 div 3 div 4 > 0; +set dolphin.b_compatibility_mode to on; +create table tmp_res(a int); +create table div_test( +c1 int1, +c2 int2, +c3 int4, +c4 int8, +c5 uint1, +c6 uint2, +c7 uint4, +c8 uint8, +c9 float, +c10 double, +c11 numeric, +c12 bit, +c13 binary, +c14 interval, +c15 json); +insert into div_test values(0,0,0,0,0,0,0,0,0,0,0,b'0',0,0,'{"0":"0"}'); +-- strict mode only, no warning and error +set dolphin.sql_mode = 'sql_mode_strict'; +select c1/c1 from div_test; +select c1/c2 from div_test; +select c1/c3 from div_test; +select c1/c4 from div_test; +select c1/c5 from div_test; +select c1/c6 from div_test; +select c1/c7 from div_test; +select c1/c8 from div_test; +select c1/c9 from div_test; +select c1/c10 from div_test; +select c1/c11 from div_test; +select c1/c12 from div_test; +select c1/c13 from div_test; +select c1/c14 from div_test; +select c1/c15 from div_test; +select c1 mod c1 from div_test; +select c1 mod c2 from div_test; +select c1 mod c3 from div_test; +select c1 mod c4 from div_test; +select c1 mod c5 from div_test; +select c1 mod c6 from div_test; +select c1 mod c7 from div_test; +select c1 mod c8 from div_test; +select c1 mod c9 from div_test; +select c1 mod c10 from div_test; +select c1 mod c11 from div_test; +select c1 mod c12 from div_test; +select c1 mod c13 from div_test; +select c1 mod c14 from div_test; +select c1 mod c15 from div_test; +select c1 div c1 from div_test; +select c1 div c2 from div_test; +select c1 div c3 from div_test; +select c1 div c4 from div_test; +select c1 div c5 from div_test; +select c1 div c6 from div_test; +select c1 div c7 from div_test; +select c1 div c8 from div_test; +select c1 div c9 from div_test; +select c1 div c10 from div_test; +select c1 div c11 from div_test; +select c1 div c12 from div_test; +select c1 div c13 from div_test; +select c1 div c14 from div_test; +select c1 div c15 from div_test; + +insert into tmp_res select c1/c1 from div_test; +insert into tmp_res select c1/c2 from div_test; +insert into tmp_res select c1/c3 from div_test; +insert into tmp_res select c1/c4 from div_test; +insert into tmp_res select c1/c5 from div_test; +insert into tmp_res select c1/c6 from div_test; +insert into tmp_res select c1/c7 from div_test; +insert into tmp_res select c1/c8 from div_test; +insert into tmp_res select c1/c9 from div_test; +insert into tmp_res select c1/c10 from div_test; +insert into tmp_res select c1/c11 from div_test; +insert into tmp_res select c1/c12 from div_test; +insert into tmp_res select c1/c13 from div_test; +insert into tmp_res select c1/c14 from div_test; +insert into tmp_res select c1/c15 from div_test; +insert into tmp_res select c1 mod c1 from div_test; +insert into tmp_res select c1 mod c2 from div_test; +insert into tmp_res select c1 mod c3 from div_test; +insert into tmp_res select c1 mod c4 from div_test; +insert into tmp_res select c1 mod c5 from div_test; +insert into tmp_res select c1 mod c6 from div_test; +insert into tmp_res select c1 mod c7 from div_test; +insert into tmp_res select c1 mod c8 from div_test; +insert into tmp_res select c1 mod c9 from div_test; +insert into tmp_res select c1 mod c10 from div_test; +insert into tmp_res select c1 mod c11 from div_test; +insert into tmp_res select c1 mod c12 from div_test; +insert into tmp_res select c1 mod c13 from div_test; +insert into tmp_res select c1 mod c14 from div_test; +insert into tmp_res select c1 mod c15 from div_test; +insert into tmp_res select c1 div c1 from div_test; +insert into tmp_res select c1 div c2 from div_test; +insert into tmp_res select c1 div c3 from div_test; +insert into tmp_res select c1 div c4 from div_test; +insert into tmp_res select c1 div c5 from div_test; +insert into tmp_res select c1 div c6 from div_test; +insert into tmp_res select c1 div c7 from div_test; +insert into tmp_res select c1 div c8 from div_test; +insert into tmp_res select c1 div c9 from div_test; +insert into tmp_res select c1 div c10 from div_test; +insert into tmp_res select c1 div c11 from div_test; +insert into tmp_res select c1 div c12 from div_test; +insert into tmp_res select c1 div c13 from div_test; +insert into tmp_res select c1 div c14 from div_test; +insert into tmp_res select c1 div c15 from div_test; + +-- non-strict mode and non-err_division_by_zero, no warning and error +set dolphin.sql_mode = ''; +select c1/c1 from div_test; +select c1/c2 from div_test; +select c1/c3 from div_test; +select c1/c4 from div_test; +select c1/c5 from div_test; +select c1/c6 from div_test; +select c1/c7 from div_test; +select c1/c8 from div_test; +select c1/c9 from div_test; +select c1/c10 from div_test; +select c1/c11 from div_test; +select c1/c12 from div_test; +select c1/c13 from div_test; +select c1/c14 from div_test; +select c1/c15 from div_test; +select c1 mod c1 from div_test; +select c1 mod c2 from div_test; +select c1 mod c3 from div_test; +select c1 mod c4 from div_test; +select c1 mod c5 from div_test; +select c1 mod c6 from div_test; +select c1 mod c7 from div_test; +select c1 mod c8 from div_test; +select c1 mod c9 from div_test; +select c1 mod c10 from div_test; +select c1 mod c11 from div_test; +select c1 mod c12 from div_test; +select c1 mod c13 from div_test; +select c1 mod c14 from div_test; +select c1 mod c15 from div_test; +select c1 div c1 from div_test; +select c1 div c2 from div_test; +select c1 div c3 from div_test; +select c1 div c4 from div_test; +select c1 div c5 from div_test; +select c1 div c6 from div_test; +select c1 div c7 from div_test; +select c1 div c8 from div_test; +select c1 div c9 from div_test; +select c1 div c10 from div_test; +select c1 div c11 from div_test; +select c1 div c12 from div_test; +select c1 div c13 from div_test; +select c1 div c14 from div_test; +select c1 div c15 from div_test; + +insert into tmp_res select c1/c1 from div_test; +insert into tmp_res select c1/c2 from div_test; +insert into tmp_res select c1/c3 from div_test; +insert into tmp_res select c1/c4 from div_test; +insert into tmp_res select c1/c5 from div_test; +insert into tmp_res select c1/c6 from div_test; +insert into tmp_res select c1/c7 from div_test; +insert into tmp_res select c1/c8 from div_test; +insert into tmp_res select c1/c9 from div_test; +insert into tmp_res select c1/c10 from div_test; +insert into tmp_res select c1/c11 from div_test; +insert into tmp_res select c1/c12 from div_test; +insert into tmp_res select c1/c13 from div_test; +insert into tmp_res select c1/c14 from div_test; +insert into tmp_res select c1/c15 from div_test; +insert into tmp_res select c1 mod c1 from div_test; +insert into tmp_res select c1 mod c2 from div_test; +insert into tmp_res select c1 mod c3 from div_test; +insert into tmp_res select c1 mod c4 from div_test; +insert into tmp_res select c1 mod c5 from div_test; +insert into tmp_res select c1 mod c6 from div_test; +insert into tmp_res select c1 mod c7 from div_test; +insert into tmp_res select c1 mod c8 from div_test; +insert into tmp_res select c1 mod c9 from div_test; +insert into tmp_res select c1 mod c10 from div_test; +insert into tmp_res select c1 mod c11 from div_test; +insert into tmp_res select c1 mod c12 from div_test; +insert into tmp_res select c1 mod c13 from div_test; +insert into tmp_res select c1 mod c14 from div_test; +insert into tmp_res select c1 mod c15 from div_test; +insert into tmp_res select c1 div c1 from div_test; +insert into tmp_res select c1 div c2 from div_test; +insert into tmp_res select c1 div c3 from div_test; +insert into tmp_res select c1 div c4 from div_test; +insert into tmp_res select c1 div c5 from div_test; +insert into tmp_res select c1 div c6 from div_test; +insert into tmp_res select c1 div c7 from div_test; +insert into tmp_res select c1 div c8 from div_test; +insert into tmp_res select c1 div c9 from div_test; +insert into tmp_res select c1 div c10 from div_test; +insert into tmp_res select c1 div c11 from div_test; +insert into tmp_res select c1 div c12 from div_test; +insert into tmp_res select c1 div c13 from div_test; +insert into tmp_res select c1 div c14 from div_test; +insert into tmp_res select c1 div c15 from div_test; + +-- strict mode and err_division_by_zero, select warning, insert error +set dolphin.sql_mode = 'sql_mode_strict,ERROR_FOR_DIVISION_BY_ZERO'; +select c1/c1 from div_test; +select c1/c2 from div_test; +select c1/c3 from div_test; +select c1/c4 from div_test; +select c1/c5 from div_test; +select c1/c6 from div_test; +select c1/c7 from div_test; +select c1/c8 from div_test; +select c1/c9 from div_test; +select c1/c10 from div_test; +select c1/c11 from div_test; +select c1/c12 from div_test; +select c1/c13 from div_test; +select c1/c14 from div_test; +select c1/c15 from div_test; +select c1 mod c1 from div_test; +select c1 mod c2 from div_test; +select c1 mod c3 from div_test; +select c1 mod c4 from div_test; +select c1 mod c5 from div_test; +select c1 mod c6 from div_test; +select c1 mod c7 from div_test; +select c1 mod c8 from div_test; +select c1 mod c9 from div_test; +select c1 mod c10 from div_test; +select c1 mod c11 from div_test; +select c1 mod c12 from div_test; +select c1 mod c13 from div_test; +select c1 mod c14 from div_test; +select c1 mod c15 from div_test; +select c1 div c1 from div_test; +select c1 div c2 from div_test; +select c1 div c3 from div_test; +select c1 div c4 from div_test; +select c1 div c5 from div_test; +select c1 div c6 from div_test; +select c1 div c7 from div_test; +select c1 div c8 from div_test; +select c1 div c9 from div_test; +select c1 div c10 from div_test; +select c1 div c11 from div_test; +select c1 div c12 from div_test; +select c1 div c13 from div_test; +select c1 div c14 from div_test; +select c1 div c15 from div_test; + +insert into tmp_res select c1/c1 from div_test; +insert into tmp_res select c1/c2 from div_test; +insert into tmp_res select c1/c3 from div_test; +insert into tmp_res select c1/c4 from div_test; +insert into tmp_res select c1/c5 from div_test; +insert into tmp_res select c1/c6 from div_test; +insert into tmp_res select c1/c7 from div_test; +insert into tmp_res select c1/c8 from div_test; +insert into tmp_res select c1/c9 from div_test; +insert into tmp_res select c1/c10 from div_test; +insert into tmp_res select c1/c11 from div_test; +insert into tmp_res select c1/c12 from div_test; +insert into tmp_res select c1/c13 from div_test; +insert into tmp_res select c1/c14 from div_test; +insert into tmp_res select c1/c15 from div_test; +insert into tmp_res select c1 mod c1 from div_test; +insert into tmp_res select c1 mod c2 from div_test; +insert into tmp_res select c1 mod c3 from div_test; +insert into tmp_res select c1 mod c4 from div_test; +insert into tmp_res select c1 mod c5 from div_test; +insert into tmp_res select c1 mod c6 from div_test; +insert into tmp_res select c1 mod c7 from div_test; +insert into tmp_res select c1 mod c8 from div_test; +insert into tmp_res select c1 mod c9 from div_test; +insert into tmp_res select c1 mod c10 from div_test; +insert into tmp_res select c1 mod c11 from div_test; +insert into tmp_res select c1 mod c12 from div_test; +insert into tmp_res select c1 mod c13 from div_test; +insert into tmp_res select c1 mod c14 from div_test; +insert into tmp_res select c1 mod c15 from div_test; +insert into tmp_res select c1 div c1 from div_test; +insert into tmp_res select c1 div c2 from div_test; +insert into tmp_res select c1 div c3 from div_test; +insert into tmp_res select c1 div c4 from div_test; +insert into tmp_res select c1 div c5 from div_test; +insert into tmp_res select c1 div c6 from div_test; +insert into tmp_res select c1 div c7 from div_test; +insert into tmp_res select c1 div c8 from div_test; +insert into tmp_res select c1 div c9 from div_test; +insert into tmp_res select c1 div c10 from div_test; +insert into tmp_res select c1 div c11 from div_test; +insert into tmp_res select c1 div c12 from div_test; +insert into tmp_res select c1 div c13 from div_test; +insert into tmp_res select c1 div c14 from div_test; +insert into tmp_res select c1 div c15 from div_test; + +-- non-strict mode and err_division_by_zero, select warning, insert warning +set dolphin.sql_mode = 'ERROR_FOR_DIVISION_BY_ZERO'; +select c1/c1 from div_test; +select c1/c2 from div_test; +select c1/c3 from div_test; +select c1/c4 from div_test; +select c1/c5 from div_test; +select c1/c6 from div_test; +select c1/c7 from div_test; +select c1/c8 from div_test; +select c1/c9 from div_test; +select c1/c10 from div_test; +select c1/c11 from div_test; +select c1/c12 from div_test; +select c1/c13 from div_test; +select c1/c14 from div_test; +select c1/c15 from div_test; +select c1 mod c1 from div_test; +select c1 mod c2 from div_test; +select c1 mod c3 from div_test; +select c1 mod c4 from div_test; +select c1 mod c5 from div_test; +select c1 mod c6 from div_test; +select c1 mod c7 from div_test; +select c1 mod c8 from div_test; +select c1 mod c9 from div_test; +select c1 mod c10 from div_test; +select c1 mod c11 from div_test; +select c1 mod c12 from div_test; +select c1 mod c13 from div_test; +select c1 mod c14 from div_test; +select c1 mod c15 from div_test; +select c1 div c1 from div_test; +select c1 div c2 from div_test; +select c1 div c3 from div_test; +select c1 div c4 from div_test; +select c1 div c5 from div_test; +select c1 div c6 from div_test; +select c1 div c7 from div_test; +select c1 div c8 from div_test; +select c1 div c9 from div_test; +select c1 div c10 from div_test; +select c1 div c11 from div_test; +select c1 div c12 from div_test; +select c1 div c13 from div_test; +select c1 div c14 from div_test; +select c1 div c15 from div_test; + +insert into tmp_res select c1/c1 from div_test; +insert into tmp_res select c1/c2 from div_test; +insert into tmp_res select c1/c3 from div_test; +insert into tmp_res select c1/c4 from div_test; +insert into tmp_res select c1/c5 from div_test; +insert into tmp_res select c1/c6 from div_test; +insert into tmp_res select c1/c7 from div_test; +insert into tmp_res select c1/c8 from div_test; +insert into tmp_res select c1/c9 from div_test; +insert into tmp_res select c1/c10 from div_test; +insert into tmp_res select c1/c11 from div_test; +insert into tmp_res select c1/c12 from div_test; +insert into tmp_res select c1/c13 from div_test; +insert into tmp_res select c1/c14 from div_test; +insert into tmp_res select c1/c15 from div_test; +insert into tmp_res select c1 mod c1 from div_test; +insert into tmp_res select c1 mod c2 from div_test; +insert into tmp_res select c1 mod c3 from div_test; +insert into tmp_res select c1 mod c4 from div_test; +insert into tmp_res select c1 mod c5 from div_test; +insert into tmp_res select c1 mod c6 from div_test; +insert into tmp_res select c1 mod c7 from div_test; +insert into tmp_res select c1 mod c8 from div_test; +insert into tmp_res select c1 mod c9 from div_test; +insert into tmp_res select c1 mod c10 from div_test; +insert into tmp_res select c1 mod c11 from div_test; +insert into tmp_res select c1 mod c12 from div_test; +insert into tmp_res select c1 mod c13 from div_test; +insert into tmp_res select c1 mod c14 from div_test; +insert into tmp_res select c1 mod c15 from div_test; +insert into tmp_res select c1 div c1 from div_test; +insert into tmp_res select c1 div c2 from div_test; +insert into tmp_res select c1 div c3 from div_test; +insert into tmp_res select c1 div c4 from div_test; +insert into tmp_res select c1 div c5 from div_test; +insert into tmp_res select c1 div c6 from div_test; +insert into tmp_res select c1 div c7 from div_test; +insert into tmp_res select c1 div c8 from div_test; +insert into tmp_res select c1 div c9 from div_test; +insert into tmp_res select c1 div c10 from div_test; +insert into tmp_res select c1 div c11 from div_test; +insert into tmp_res select c1 div c12 from div_test; +insert into tmp_res select c1 div c13 from div_test; +insert into tmp_res select c1 div c14 from div_test; +insert into tmp_res select c1 div c15 from div_test; +select count(*) from tmp_res; +select count(*) from tmp_res where a is null; +drop table tmp_res; +drop table div_test; + --测试点三:验证mod操作符 select 8mod3;--返回mod3 8 select 8 mod3;--返回mod3 8 diff --git a/contrib/dolphin/sql/operator_compatibility_test/numeric_operator_test_min.sql b/contrib/dolphin/sql/operator_compatibility_test/numeric_operator_test_min.sql index 36c3dac73..bc199823e 100644 --- a/contrib/dolphin/sql/operator_compatibility_test/numeric_operator_test_min.sql +++ b/contrib/dolphin/sql/operator_compatibility_test/numeric_operator_test_min.sql @@ -19,7 +19,7 @@ CREATE TABLE test_numeric_table_min `bit1` bit(1), `bit64` bit(64) ); - +set dolphin.sql_mode = 'sql_mode_strict,sql_mode_full_group,pipes_as_concat,ansi_quotes,no_zero_date,pad_char_to_full_length,error_for_division_by_zero'; -- type test when b_compatibility_mode is on set dolphin.b_compatibility_mode to on; drop table if exists test_numeric_type_min; diff --git a/contrib/dolphin/upgrade_script/dolphin--1.1--2.0.sql b/contrib/dolphin/upgrade_script/dolphin--1.1--2.0.sql index 35cd42a2f..116c7a8c9 100644 --- a/contrib/dolphin/upgrade_script/dolphin--1.1--2.0.sql +++ b/contrib/dolphin/upgrade_script/dolphin--1.1--2.0.sql @@ -4080,7 +4080,7 @@ returns numeric as $$ begin - return 0; + return $1::double % $2::double; end; $$ language plpgsql; @@ -4091,7 +4091,7 @@ returns numeric as $$ begin - return null; + return $1::double % $2::double; end; $$ language plpgsql; @@ -4102,7 +4102,7 @@ returns numeric as $$ begin - return null; + return $1::double % $2::double; end; $$ language plpgsql; @@ -4113,7 +4113,7 @@ returns numeric as $$ begin - return 0; + return $1::double / $2::double; end; $$ language plpgsql; @@ -4124,7 +4124,7 @@ returns numeric as $$ begin - return null; + return $1::double / $2::double; end; $$ language plpgsql; @@ -4135,7 +4135,7 @@ returns numeric as $$ begin - return null; + return $1::double / $2::double; end; $$ language plpgsql; @@ -4190,4 +4190,7 @@ DROP FUNCTION IF EXISTS pg_catalog.hex(int16); CREATE OR REPLACE FUNCTION pg_catalog.hex(int16) RETURNS text LANGUAGE C IMMUTABLE STRICT as '$libdir/dolphin', 'int_to_hex'; DROP FUNCTION IF EXISTS pg_catalog.bit_bin_in(cstring, oid, integer); -CREATE OR REPLACE FUNCTION pg_catalog.bit_bin_in(cstring, oid, integer) RETURNS bit LANGUAGE C IMMUTABLE STRICT as '$libdir/dolphin','bit_bin_in'; \ No newline at end of file +CREATE OR REPLACE FUNCTION pg_catalog.bit_bin_in(cstring, oid, integer) RETURNS bit LANGUAGE C IMMUTABLE STRICT as '$libdir/dolphin','bit_bin_in'; + +DROP FUNCTION IF EXISTS pg_catalog.b_mod(a numeric, b numeric); +CREATE OR REPLACE FUNCTION pg_catalog.b_mod(a numeric, b numeric) returns numeric LANGUAGE SQL IMMUTABLE STRICT as 'select a % b'; -- Gitee