Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package orafce for openSUSE:Factory checked 
in at 2024-03-07 18:30:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/orafce (Old)
 and      /work/SRC/openSUSE:Factory/.orafce.new.1770 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "orafce"

Thu Mar  7 18:30:56 2024 rev:15 rq:1155895 version:4.9.3+git0.6adbd66

Changes:
--------
--- /work/SRC/openSUSE:Factory/orafce/orafce.changes    2024-02-08 
19:03:09.373247497 +0100
+++ /work/SRC/openSUSE:Factory/.orafce.new.1770/orafce.changes  2024-03-07 
18:32:25.667681111 +0100
@@ -1,0 +2,11 @@
+Thu Mar 07 12:13:12 UTC 2024 - [email protected]
+
+- Update to version 4.9.3+git0.6adbd66:
+  * prepare for 4.9.3
+  * fix regress tests
+  * fix broken handling null in dbms_sql.column_value
+  * fix build for master (pg17+)
+  * possibility to raise error inside trigger functions
+  * fix regress test on fc40
+
+-------------------------------------------------------------------

Old:
----
  orafce-4.9.2+git0.17c9ce4.obscpio

New:
----
  orafce-4.9.3+git0.6adbd66.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ orafce.spec ++++++
--- /var/tmp/diff_new_pack.fh64Nk/_old  2024-03-07 18:32:26.167699562 +0100
+++ /var/tmp/diff_new_pack.fh64Nk/_new  2024-03-07 18:32:26.167699562 +0100
@@ -20,7 +20,7 @@
 %define                realname orafce
 
 Name:           %{pgname}-orafce
-Version:        4.9.2+git0.17c9ce4
+Version:        4.9.3+git0.6adbd66
 Release:        0
 Summary:        Implementation of some Oracle functions into PostgreSQL
 Group:          Productivity/Databases/Tools

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.fh64Nk/_old  2024-03-07 18:32:26.219701480 +0100
+++ /var/tmp/diff_new_pack.fh64Nk/_new  2024-03-07 18:32:26.223701628 +0100
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param name="url">https://github.com/orafce/orafce.git</param>
-              <param 
name="changesrevision">17c9ce474b254ff2ee868aa02ff23cfdf0726a85</param></service></servicedata>
+              <param 
name="changesrevision">6adbd66c429dabb828f10d764d356824efeb8396</param></service></servicedata>
 (No newline at EOF)
 

++++++ orafce-4.9.2+git0.17c9ce4.obscpio -> orafce-4.9.3+git0.6adbd66.obscpio 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/orafce-4.9.2+git0.17c9ce4/META.json 
new/orafce-4.9.3+git0.6adbd66/META.json
--- old/orafce-4.9.2+git0.17c9ce4/META.json     2024-02-08 05:20:56.000000000 
+0100
+++ new/orafce-4.9.3+git0.6adbd66/META.json     2024-03-06 16:43:44.000000000 
+0100
@@ -2,7 +2,7 @@
    "name": "orafce",
    "abstract": "Oracle's compatibility functions and packages",
    "description": "This module allows use a well known Oracle's functions and 
packages inside PostgreSQL",
-   "version": "4.9.2",
+   "version": "4.9.3",
    "maintainer": [
       "Pavel Stehule <[email protected]>",
       "Takahiro Itagaki <[email protected]>"
@@ -25,7 +25,7 @@
      "orafce": {
        "file": "sql/orafce.sql",
        "docfile": "README.orafce",
-       "version": "4.9.2",
+       "version": "4.9.3",
        "abstract": "Oracle's compatibility functions and packages"
      }
    },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/orafce-4.9.2+git0.17c9ce4/README.asciidoc 
new/orafce-4.9.3+git0.6adbd66/README.asciidoc
--- old/orafce-4.9.2+git0.17c9ce4/README.asciidoc       2024-02-08 
05:20:56.000000000 +0100
+++ new/orafce-4.9.3+git0.6adbd66/README.asciidoc       2024-03-06 
16:43:44.000000000 +0100
@@ -883,12 +883,12 @@
 This can be enusured with trigger functions:
 
 ----
-oracle.replace_empty_strings([raise_warnings boolean])
-oracle.replace_null_strings([raise_warnings boolean])
+oracle.replace_empty_strings([ 'on' | 'true' | 'warning' | 'error' ])
+oracle.replace_null_strings([ 'on' | 'true' | 'warning' | 'error' ])
 ----
 
-Optional boolean argument is used as indicator so these functions should to
-raise warning when row was changed inside these functions.
+Optional string argument is used as indicator so these functions should to
+raise warning (possibly error) when row was changed inside these functions.
 
 ----
 CREATE TABLE test(id serial, name varchar, surname varchar);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/orafce-4.9.2+git0.17c9ce4/alert.c 
new/orafce-4.9.3+git0.6adbd66/alert.c
--- old/orafce-4.9.2+git0.17c9ce4/alert.c       2024-02-08 05:20:56.000000000 
+0100
+++ new/orafce-4.9.3+git0.6adbd66/alert.c       2024-03-06 16:43:44.000000000 
+0100
@@ -74,6 +74,16 @@
 /* in sec 1000 days */
 #define MAXWAIT                86400000
 
+#if PG_VERSION_NUM >= 170000
+
+#define CURRENT_LXID   (MyProc->vxid.lxid)
+
+#else
+
+#define CURRENT_LXID   (MyProc->lxid)
+
+#endif
+
 
 static void unregister_event(int event_id, int sid);
 static char* find_and_remove_message_item(int message_id, int sid,
@@ -1087,7 +1097,7 @@
                 * MyProc->lxid already invalided. So we need to invalid 
pointer to
                 * obsolete buffer here.
                 */
-               if (local_buf_lxid != MyProc->lxid)
+               if (local_buf_lxid != CURRENT_LXID)
                        signals = NULL;
        }
        else if (event == XACT_EVENT_COMMIT && signals)
@@ -1162,12 +1172,12 @@
        event = PG_GETARG_TEXT_P(0);
        message = (!PG_ARGISNULL(1)) ? PG_GETARG_TEXT_P(1) : NULL;
 
-       if (local_buf_lxid != MyProc->lxid)
+       if (local_buf_lxid != CURRENT_LXID)
        {
                local_buf_cxt = AllocSetContextCreate(TopTransactionContext,
                                                                                
          "dbms_alert local buffer",
                                                                                
          ALLOCSET_START_SMALL_SIZES);
-               local_buf_lxid = MyProc->lxid;
+               local_buf_lxid = CURRENT_LXID;
 
                signals = NULL;
                last_signal = NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/orafce-4.9.2+git0.17c9ce4/dbms_sql.c 
new/orafce-4.9.3+git0.6adbd66/dbms_sql.c
--- old/orafce-4.9.2+git0.17c9ce4/dbms_sql.c    2024-02-08 05:20:56.000000000 
+0100
+++ new/orafce-4.9.3+git0.6adbd66/dbms_sql.c    2024-03-06 16:43:44.000000000 
+0100
@@ -1689,7 +1689,10 @@
                value = cast_value(ccast, value, *isnull);
        }
 
-       if (1)//spi_transfer)
+       if (*isnull)
+               return (Datum) 0;
+
+       if (spi_transfer)
                value = SPI_datumTransfer(value, ccast->typbyval, 
ccast->typlen);
 
        return value;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/orafce-4.9.2+git0.17c9ce4/expected/dbms_random_3.out 
new/orafce-4.9.3+git0.6adbd66/expected/dbms_random_3.out
--- old/orafce-4.9.2+git0.17c9ce4/expected/dbms_random_3.out    1970-01-01 
01:00:00.000000000 +0100
+++ new/orafce-4.9.3+git0.6adbd66/expected/dbms_random_3.out    2024-03-06 
16:43:44.000000000 +0100
@@ -0,0 +1,129 @@
+-- Tests for package DBMS_RANDOM
+SELECT dbms_random.initialize(8);
+ initialize 
+------------
+ 
+(1 row)
+
+SELECT dbms_random.normal()::numeric(10, 8);
+   normal   
+------------
+ 0.12583199
+(1 row)
+
+SELECT dbms_random.normal()::numeric(10, 8);
+   normal    
+-------------
+ -0.61543969
+(1 row)
+
+SELECT dbms_random.seed(8);
+ seed 
+------
+ 
+(1 row)
+
+SELECT dbms_random.random();
+   random   
+------------
+ 1951052976
+(1 row)
+
+SELECT dbms_random.seed('test');
+ seed 
+------
+ 
+(1 row)
+
+SELECT dbms_random.string('U',5);
+ string 
+--------
+ LWLPN
+(1 row)
+
+SELECT dbms_random.string('P',2);
+ string 
+--------
+ \a
+(1 row)
+
+SELECT dbms_random.string('x',4);
+ string 
+--------
+ HJPS
+(1 row)
+
+SELECT dbms_random.string('a',2);
+ string 
+--------
+ Hg
+(1 row)
+
+SELECT dbms_random.string('l',3);
+ string 
+--------
+ fwz
+(1 row)
+
+SELECT dbms_random.seed(5);
+ seed 
+------
+ 
+(1 row)
+
+SELECT dbms_random.value()::numeric(10, 8);
+   value    
+------------
+ 0.08003045
+(1 row)
+
+SELECT dbms_random.value(10,15)::numeric(10, 8);
+    value    
+-------------
+ 12.24227702
+(1 row)
+
+SELECT dbms_random.terminate();
+ terminate 
+-----------
+ 
+(1 row)
+
+SELECT dbms_random.string('u', 10);
+   string   
+------------
+ AHZFKGJHKG
+(1 row)
+
+SELECT dbms_random.string('l', 10);
+   string   
+------------
+ hllhbvzkjz
+(1 row)
+
+SELECT dbms_random.string('a', 10);
+   string   
+------------
+ yHayLiCaFc
+(1 row)
+
+SELECT dbms_random.string('x', 10);
+   string   
+------------
+ WMBVUQ470J
+(1 row)
+
+SELECT dbms_random.string('p', 10);
+   string   
+------------
+ /h`N+8A(/-
+(1 row)
+
+SELECT dbms_random.string('uu', 10); -- error
+ERROR:  this first parameter value is more than 1 characters long
+SELECT dbms_random.string('w', 10);
+   string   
+------------
+ NYTOLMSZNI
+(1 row)
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/orafce-4.9.2+git0.17c9ce4/expected/dbms_sql.out 
new/orafce-4.9.3+git0.6adbd66/expected/dbms_sql.out
--- old/orafce-4.9.2+git0.17c9ce4/expected/dbms_sql.out 2024-02-08 
05:20:56.000000000 +0100
+++ new/orafce-4.9.3+git0.6adbd66/expected/dbms_sql.out 2024-03-06 
16:43:44.000000000 +0100
@@ -610,3 +610,30 @@
 
 drop procedure single_Row_insert;
 drop table tab1;
+create table test(id text);
+insert into test(id) values ('1'), (null);
+-- should not to crash
+do $$
+declare
+  cursor int;
+  id text;
+  row_counter int := 0;
+begin
+  cursor := dbms_sql.open_cursor();
+  call dbms_sql.parse(cursor, 'select id from test');
+  call dbms_sql.define_column(cursor, 1, 'id');
+  perform dbms_sql.execute(cursor);
+  while dbms_sql.fetch_rows(cursor) > 0 loop
+    row_counter = row_counter + 1;
+    raise notice 'process row #%', row_counter;
+    call dbms_sql.column_value(cursor, 1, id);
+    raise notice 'row id: `%`', id;
+  end loop;
+  call dbms_sql.close_cursor(cursor);
+end;
+$$;
+NOTICE:  process row #1
+NOTICE:  row id: `1`
+NOTICE:  process row #2
+NOTICE:  row id: `<NULL>`
+drop table test;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/orafce-4.9.2+git0.17c9ce4/expected/dbms_sql_1.out 
new/orafce-4.9.3+git0.6adbd66/expected/dbms_sql_1.out
--- old/orafce-4.9.2+git0.17c9ce4/expected/dbms_sql_1.out       2024-02-08 
05:20:56.000000000 +0100
+++ new/orafce-4.9.3+git0.6adbd66/expected/dbms_sql_1.out       2024-03-06 
16:43:44.000000000 +0100
@@ -610,3 +610,30 @@
 
 drop procedure single_Row_insert;
 drop table tab1;
+create table test(id text);
+insert into test(id) values ('1'), (null);
+-- should not to crash
+do $$
+declare
+  cursor int;
+  id text;
+  row_counter int := 0;
+begin
+  cursor := dbms_sql.open_cursor();
+  call dbms_sql.parse(cursor, 'select id from test');
+  call dbms_sql.define_column(cursor, 1, 'id');
+  perform dbms_sql.execute(cursor);
+  while dbms_sql.fetch_rows(cursor) > 0 loop
+    row_counter = row_counter + 1;
+    raise notice 'process row #%', row_counter;
+    call dbms_sql.column_value(cursor, 1, id);
+    raise notice 'row id: `%`', id;
+  end loop;
+  call dbms_sql.close_cursor(cursor);
+end;
+$$;
+NOTICE:  process row #1
+NOTICE:  row id: `1`
+NOTICE:  process row #2
+NOTICE:  row id: `<NULL>`
+drop table test;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/orafce-4.9.2+git0.17c9ce4/others.c 
new/orafce-4.9.3+git0.6adbd66/others.c
--- old/orafce-4.9.2+git0.17c9ce4/others.c      2024-02-08 05:20:56.000000000 
+0100
+++ new/orafce-4.9.3+git0.6adbd66/others.c      2024-03-06 16:43:44.000000000 
+0100
@@ -67,6 +67,16 @@
 
 static Datum ora_greatest_least(FunctionCallInfo fcinfo, bool greater);
 
+#if PG_VERSION_NUM >= 170000
+
+#define CURRENT_LXID   (MyProc->vxid.lxid)
+
+#else
+
+#define CURRENT_LXID   (MyProc->lxid)
+
+#endif
+
 #if PG_VERSION_NUM < 160000
 
 static Oid
@@ -131,7 +141,7 @@
 {
        Oid                     result = InvalidOid;
 
-       if (uuid_generate_func_lxid != MyProc->lxid ||
+       if (uuid_generate_func_lxid != CURRENT_LXID ||
                uuid_generate_func_oid == InvalidOid ||
                strcmp(orafce_sys_guid_source, uuid_generate_func_name) != 0)
        {
@@ -194,7 +204,7 @@
                if (!OidIsValid(result))
                        elog(ERROR, "function \"%s\" doesn't exist", 
orafce_sys_guid_source);
 
-               uuid_generate_func_lxid = MyProc->lxid;
+               uuid_generate_func_lxid = CURRENT_LXID;
                uuid_generate_func_oid = result;
                strcpy(uuid_generate_func_name, orafce_sys_guid_source);
                *reset_fmgr = true;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/orafce-4.9.2+git0.17c9ce4/replace_empty_string.c 
new/orafce-4.9.3+git0.6adbd66/replace_empty_string.c
--- old/orafce-4.9.2+git0.17c9ce4/replace_empty_string.c        2024-02-08 
05:20:56.000000000 +0100
+++ new/orafce-4.9.3+git0.6adbd66/replace_empty_string.c        2024-03-06 
16:43:44.000000000 +0100
@@ -57,18 +57,27 @@
  * columns. When first argument is "on" or "true", then warnings will be 
raised.
  */
 static bool
-should_raise_warnings(FunctionCallInfo fcinfo)
+should_raise_warnings(FunctionCallInfo fcinfo, bool *raise_error)
 {
        TriggerData        *trigdata = (TriggerData *) fcinfo->context;
        Trigger            *trigger = trigdata->tg_trigger;
 
+       *raise_error = false;
+
        if (trigger->tgnargs > 0)
        {
                char              **args = trigger->tgargs;
 
                if (strcmp(args[0], "on") == 0 ||
-                               strcmp(args[0], "true") == 0)
+                               strcmp(args[0], "true") == 0 ||
+                               strcmp(args[0], "warning") == 0)
                        return true;
+
+               if (strcmp(args[0], "error") == 0)
+               {
+                       *raise_error = true;
+                       return true;
+               }
        }
 
        return false;
@@ -91,10 +100,11 @@
        int                             nresetcols = 0;
        int                             attnum;
        bool                    raise_warning = false;
+       bool                    raise_error;
        char               *relname = NULL;
 
        trigger_sanity_check(fcinfo, "replace_empty_strings");
-       raise_warning = should_raise_warnings(fcinfo);
+       raise_warning = should_raise_warnings(fcinfo, &raise_error);
 
        rettuple = get_rettuple(fcinfo);
        tupdesc = trigdata->tg_relation->rd_att;
@@ -149,7 +159,7 @@
                                                if (!relname)
                                                        relname = 
SPI_getrelname(trigdata->tg_relation);
 
-                                               elog(WARNING,
+                                               elog(raise_error ? ERROR : 
WARNING,
                                "Field \"%s\" of table \"%s\" is empty string 
(replaced by NULL).",
                                                                
SPI_fname(tupdesc, attnum), relname);
                                        }
@@ -195,10 +205,11 @@
        int                             nresetcols = 0;
        int                             attnum;
        bool                    raise_warning = false;
+       bool                    raise_error;
        char               *relname = NULL;
 
        trigger_sanity_check(fcinfo, "replace_null_strings");
-       raise_warning = should_raise_warnings(fcinfo);
+       raise_warning = should_raise_warnings(fcinfo, &raise_error);
 
        rettuple = get_rettuple(fcinfo);
 
@@ -252,7 +263,7 @@
                                        if (!relname)
                                                relname = 
SPI_getrelname(trigdata->tg_relation);
 
-                                       elog(WARNING,
+                                       elog(raise_error ? ERROR : WARNING,
                                "Field \"%s\" of table \"%s\" is NULL (replaced 
by '').",
                                                                
SPI_fname(tupdesc, attnum), relname);
                                }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/orafce-4.9.2+git0.17c9ce4/sql/dbms_sql.sql 
new/orafce-4.9.3+git0.6adbd66/sql/dbms_sql.sql
--- old/orafce-4.9.2+git0.17c9ce4/sql/dbms_sql.sql      2024-02-08 
05:20:56.000000000 +0100
+++ new/orafce-4.9.3+git0.6adbd66/sql/dbms_sql.sql      2024-03-06 
16:43:44.000000000 +0100
@@ -285,3 +285,29 @@
 select * from tab1;
 drop procedure single_Row_insert;
 drop table tab1;
+
+create table test(id text);
+insert into test(id) values ('1'), (null);
+
+-- should not to crash
+do $$
+declare
+  cursor int;
+  id text;
+  row_counter int := 0;
+begin
+  cursor := dbms_sql.open_cursor();
+  call dbms_sql.parse(cursor, 'select id from test');
+  call dbms_sql.define_column(cursor, 1, 'id');
+  perform dbms_sql.execute(cursor);
+  while dbms_sql.fetch_rows(cursor) > 0 loop
+    row_counter = row_counter + 1;
+    raise notice 'process row #%', row_counter;
+    call dbms_sql.column_value(cursor, 1, id);
+    raise notice 'row id: `%`', id;
+  end loop;
+  call dbms_sql.close_cursor(cursor);
+end;
+$$;
+
+drop table test;

++++++ orafce.obsinfo ++++++
--- /var/tmp/diff_new_pack.fh64Nk/_old  2024-03-07 18:32:26.467710632 +0100
+++ /var/tmp/diff_new_pack.fh64Nk/_new  2024-03-07 18:32:26.467710632 +0100
@@ -1,5 +1,5 @@
 name: orafce
-version: 4.9.2+git0.17c9ce4
-mtime: 1707366056
-commit: 17c9ce474b254ff2ee868aa02ff23cfdf0726a85
+version: 4.9.3+git0.6adbd66
+mtime: 1709739824
+commit: 6adbd66c429dabb828f10d764d356824efeb8396
 

Reply via email to