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-02-08 19:02:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/orafce (Old) and /work/SRC/openSUSE:Factory/.orafce.new.1815 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "orafce" Thu Feb 8 19:02:58 2024 rev:14 rq:1145078 version:4.9.2+git0.17c9ce4 Changes: -------- --- /work/SRC/openSUSE:Factory/orafce/orafce.changes 2024-01-29 22:32:28.120943896 +0100 +++ /work/SRC/openSUSE:Factory/.orafce.new.1815/orafce.changes 2024-02-08 19:03:09.373247497 +0100 @@ -1,0 +2,15 @@ +Thu Feb 08 08:43:18 UTC 2024 - emiliano.lange...@suse.com + +- Update to version 4.9.2+git0.17c9ce4: + * prepare for 4.9.2 + * Update the usage example for DBMS_OUTPUT package. + * fix memory issues in plvlex.token function + * fix sqlscanner typecast has not assigned yylval.val.str field + * should not to crash, when we try to read column without data + * fix regress tests + * dont't try to free byref null variable + * result_cxt schema can be used only after successfull execution #254 (second part) + * fix crash of dbms_sql.execute when bound array variable is NULL #254 + * added an alternative output for test dbms_random (Windows) + +------------------------------------------------------------------- Old: ---- orafce-4.9.1+git0.1071eb6.obscpio New: ---- orafce-4.9.2+git0.17c9ce4.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ orafce.spec ++++++ --- /var/tmp/diff_new_pack.dGRIZb/_old 2024-02-08 19:03:10.153275694 +0100 +++ /var/tmp/diff_new_pack.dGRIZb/_new 2024-02-08 19:03:10.157275838 +0100 @@ -20,7 +20,7 @@ %define realname orafce Name: %{pgname}-orafce -Version: 4.9.1+git0.1071eb6 +Version: 4.9.2+git0.17c9ce4 Release: 0 Summary: Implementation of some Oracle functions into PostgreSQL Group: Productivity/Databases/Tools ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.dGRIZb/_old 2024-02-08 19:03:10.213277863 +0100 +++ /var/tmp/diff_new_pack.dGRIZb/_new 2024-02-08 19:03:10.213277863 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/orafce/orafce.git</param> - <param name="changesrevision">1071eb658945973396144a8a6b7b8fb74cfa6047</param></service></servicedata> + <param name="changesrevision">17c9ce474b254ff2ee868aa02ff23cfdf0726a85</param></service></servicedata> (No newline at EOF) ++++++ orafce-4.9.1+git0.1071eb6.obscpio -> orafce-4.9.2+git0.17c9ce4.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orafce-4.9.1+git0.1071eb6/META.json new/orafce-4.9.2+git0.17c9ce4/META.json --- old/orafce-4.9.1+git0.1071eb6/META.json 2024-01-28 08:49:25.000000000 +0100 +++ new/orafce-4.9.2+git0.17c9ce4/META.json 2024-02-08 05:20:56.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.1", + "version": "4.9.2", "maintainer": [ "Pavel Stehule <pavel.steh...@gmail.com>", "Takahiro Itagaki <itagaki.takah...@gmail.com>" @@ -25,7 +25,7 @@ "orafce": { "file": "sql/orafce.sql", "docfile": "README.orafce", - "version": "4.9.1", + "version": "4.9.2", "abstract": "Oracle's compatibility functions and packages" } }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orafce-4.9.1+git0.1071eb6/dbms_sql.c new/orafce-4.9.2+git0.17c9ce4/dbms_sql.c --- old/orafce-4.9.1+git0.1071eb6/dbms_sql.c 2024-01-28 08:49:25.000000000 +0100 +++ new/orafce-4.9.2+git0.17c9ce4/dbms_sql.c 2024-02-08 05:20:56.000000000 +0100 @@ -535,8 +535,11 @@ if (var->typoid != InvalidOid) { - if (!var->typbyval) + if (!var->typbyval && !var->isnull) + { pfree(DatumGetPointer(var->value)); + var->value = (Datum) 0; + } var->isnull = true; } @@ -621,6 +624,17 @@ (errcode(ERRCODE_DATATYPE_MISMATCH), errmsg("value is not a array"))); + if (var->typoid != InvalidOid) + { + if (!var->typbyval && !var->isnull) + { + pfree(DatumGetPointer(var->value)); + var->value = (Datum) 0; + } + + var->isnull = true; + } + var->is_array = true; var->typoid = valtype; var->typelemid = elementtype; @@ -887,6 +901,7 @@ CursorData *cur = (CursorData *) arg; cur->cursor_xact_cxt = NULL; + cur->result_cxt = NULL; cur->tuples_cxt = NULL; cur->processed = 0; @@ -1278,7 +1293,7 @@ MemoryContextReset(c->result_cxt); } - else + else if (has_value) { int rc; @@ -1570,10 +1585,12 @@ Oid columnTypeId; CastCacheData *ccast; - if (!c->executed) + Assert(c->executed); + + if (last_row_count == 0) ereport(ERROR, - (errcode(ERRCODE_INVALID_CURSOR_STATE), - errmsg("cursor is not executed"))); + (errcode(ERRCODE_NO_DATA_FOUND), + errmsg("no data found"))); if (!c->tupdesc) ereport(ERROR, @@ -1672,7 +1689,7 @@ value = cast_value(ccast, value, *isnull); } - if (spi_transfer) + if (1)//spi_transfer) value = SPI_datumTransfer(value, ccast->typbyval, ccast->typlen); return value; @@ -1709,8 +1726,14 @@ pos = PG_GETARG_INT32(1); + if (!c->executed) + ereport(ERROR, + (errcode(ERRCODE_INVALID_CURSOR_STATE), + errmsg("cursor is not executed"))); + oldcxt = MemoryContextSwitchTo(c->result_cxt); + /* * Setting of OUT field is little bit more complex, because although * there is only one output field, the result should be compisite type. @@ -1769,6 +1792,11 @@ pos = PG_GETARG_INT32(1); + if (!c->executed) + ereport(ERROR, + (errcode(ERRCODE_INVALID_CURSOR_STATE), + errmsg("cursor is not executed"))); + oldcxt = MemoryContextSwitchTo(c->result_cxt); targetTypeId = get_fn_expr_argtype(fcinfo->flinfo, 2); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orafce-4.9.1+git0.1071eb6/doc/orafce_documentation/Orafce_Documentation_06.md new/orafce-4.9.2+git0.17c9ce4/doc/orafce_documentation/Orafce_Documentation_06.md --- old/orafce-4.9.1+git0.1071eb6/doc/orafce_documentation/Orafce_Documentation_06.md 2024-01-28 08:49:25.000000000 +0100 +++ new/orafce-4.9.2+git0.17c9ce4/doc/orafce_documentation/Orafce_Documentation_06.md 2024-02-08 05:20:56.000000000 +0100 @@ -670,28 +670,29 @@ A usage example of DBMS_OUTPUT is shown below. ~~~ +CREATE TABLE dbms_output_table(c1 text, c2 int); CREATE FUNCTION dbms_output_exe() RETURNS VOID AS $$ DECLARE buff1 VARCHAR(20); - buff2 VARCHAR(20); stts1 INTEGER; - stts2 INTEGER; BEGIN - PERFORM DBMS_OUTPUT.DISABLE(); + PERFORM DBMS_OUTPUT.SERVEROUTPUT(TRUE); PERFORM DBMS_OUTPUT.ENABLE(); - PERFORM DBMS_OUTPUT.SERVEROUTPUT(FALSE); PERFORM DBMS_OUTPUT.PUT('DBMS_OUTPUT TEST 1'); PERFORM DBMS_OUTPUT.NEW_LINE(); PERFORM DBMS_OUTPUT.PUT_LINE('DBMS_OUTPUT TEST 2'); + + PERFORM DBMS_OUTPUT.SERVEROUTPUT(FALSE); + PERFORM DBMS_OUTPUT.ENABLE(); + PERFORM DBMS_OUTPUT.PUT_LINE('DBMS_OUTPUT TEST 3'); SELECT line,status INTO buff1,stts1 FROM DBMS_OUTPUT.GET_LINE(); - SELECT line,status INTO buff2,stts2 FROM DBMS_OUTPUT.GET_LINE(); - PERFORM DBMS_OUTPUT.SERVEROUTPUT(TRUE); - PERFORM DBMS_OUTPUT.PUT_LINE(buff1); - PERFORM DBMS_OUTPUT.PUT_LINE(buff2); + INSERT INTO dbms_output_table VALUES(buff1,stts1); END; $$ LANGUAGE plpgsql; SELECT dbms_output_exe(); +SELECT * FROM dbms_output_table; DROP FUNCTION dbms_output_exe(); +DROP TABLE dbms_output_table; ~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orafce-4.9.1+git0.1071eb6/expected/dbms_random_2.out new/orafce-4.9.2+git0.17c9ce4/expected/dbms_random_2.out --- old/orafce-4.9.1+git0.1071eb6/expected/dbms_random_2.out 2024-01-28 08:49:25.000000000 +0100 +++ new/orafce-4.9.2+git0.17c9ce4/expected/dbms_random_2.out 2024-02-08 05:20:56.000000000 +0100 @@ -89,3 +89,41 @@ (1 row) +SELECT dbms_random.string('u', 10); + string +------------ + JTVYSOVZEW +(1 row) + +SELECT dbms_random.string('l', 10); + string +------------ + knadjpjaji +(1 row) + +SELECT dbms_random.string('a', 10); + string +------------ + XSPLgEQeBm +(1 row) + +SELECT dbms_random.string('x', 10); + string +------------ + 5H7G1H2ERS +(1 row) + +SELECT dbms_random.string('p', 10); + string +------------ + km:uKzx??E +(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 +------------ + MJCOVPXTET +(1 row) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orafce-4.9.1+git0.1071eb6/expected/dbms_sql.out new/orafce-4.9.2+git0.17c9ce4/expected/dbms_sql.out --- old/orafce-4.9.1+git0.1071eb6/expected/dbms_sql.out 2024-01-28 08:49:25.000000000 +0100 +++ new/orafce-4.9.2+git0.17c9ce4/expected/dbms_sql.out 2024-02-08 05:20:56.000000000 +0100 @@ -373,6 +373,79 @@ (3 rows) truncate foo; +-- should not to crash, when bound array is null +do $$ +declare + c int; + ca numeric[]; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'insert into foo values(:a, 10, 20)'); + + call dbms_sql.bind_array(c, 'a', ca); + raise notice 'inserted rows %d', dbms_sql.execute(c); +end; +$$; +NOTICE: inserted rows 0d +-- should not to crash, when we try to touch result without execute +do $$ +declare + c int; + a int[]; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'select i from generate_series(1, 2) g(i)'); + call dbms_sql.define_array(c, 1, a, 10, 1); + call dbms_sql.column_value(c, 1, a); + call dbms_sql.close_cursor(c); +end; +$$; +ERROR: cursor is not executed +CONTEXT: SQL statement "call dbms_sql.column_value(c, 1, a)" +PL/pgSQL function inline_code_block line 9 at CALL +-- should not to crash, when the variable is overwritten +DO $$ +declare + c integer; + n integer; + c2 numeric; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'INSERT INTO foo(a) VALUES (:bnd2)'); + call dbms_sql.bind_variable(c, 'bnd2', c2); + call dbms_sql.bind_variable(c, 'bnd2', c2); + n := dbms_sql.execute(c); +end +$$; +-- should not to crash, when we try to read column without data +do $$ +declare + c int; + strval varchar; + intval int; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'select ''foo'', 1'); + call dbms_sql.define_column(c, 1, strval); + call dbms_sql.define_column(c, 2, intval); + perform dbms_sql.execute(c); + while dbms_sql.fetch_rows(c) > -1 + loop + call dbms_sql.column_value(c, 1, strval); + end loop; + call dbms_sql.close_cursor(c); +end; +$$; +ERROR: no data found +CONTEXT: SQL statement "call dbms_sql.column_value(c, 1, strval)" +PL/pgSQL function inline_code_block line 14 at CALL +select * from foo; + a | b | c +---+---+--- + | | +(1 row) + +truncate foo; do $$ declare c int; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orafce-4.9.1+git0.1071eb6/expected/dbms_sql_1.out new/orafce-4.9.2+git0.17c9ce4/expected/dbms_sql_1.out --- old/orafce-4.9.1+git0.1071eb6/expected/dbms_sql_1.out 1970-01-01 01:00:00.000000000 +0100 +++ new/orafce-4.9.2+git0.17c9ce4/expected/dbms_sql_1.out 2024-02-08 05:20:56.000000000 +0100 @@ -0,0 +1,612 @@ +do $$ +declare + c int; + strval varchar; + intval int; + nrows int default 30; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'select ''ahoj'' || i, i from generate_series(1, :nrows) g(i)'); + call dbms_sql.bind_variable(c, 'nrows', nrows); + call dbms_sql.define_column(c, 1, strval); + call dbms_sql.define_column(c, 2, intval); + perform dbms_sql.execute(c); + while dbms_sql.fetch_rows(c) > 0 + loop + call dbms_sql.column_value(c, 1, strval); + call dbms_sql.column_value(c, 2, intval); + raise notice 'c1: %, c2: %', strval, intval; + end loop; + call dbms_sql.close_cursor(c); +end; +$$; +NOTICE: c1: ahoj1, c2: 1 +NOTICE: c1: ahoj2, c2: 2 +NOTICE: c1: ahoj3, c2: 3 +NOTICE: c1: ahoj4, c2: 4 +NOTICE: c1: ahoj5, c2: 5 +NOTICE: c1: ahoj6, c2: 6 +NOTICE: c1: ahoj7, c2: 7 +NOTICE: c1: ahoj8, c2: 8 +NOTICE: c1: ahoj9, c2: 9 +NOTICE: c1: ahoj10, c2: 10 +NOTICE: c1: ahoj11, c2: 11 +NOTICE: c1: ahoj12, c2: 12 +NOTICE: c1: ahoj13, c2: 13 +NOTICE: c1: ahoj14, c2: 14 +NOTICE: c1: ahoj15, c2: 15 +NOTICE: c1: ahoj16, c2: 16 +NOTICE: c1: ahoj17, c2: 17 +NOTICE: c1: ahoj18, c2: 18 +NOTICE: c1: ahoj19, c2: 19 +NOTICE: c1: ahoj20, c2: 20 +NOTICE: c1: ahoj21, c2: 21 +NOTICE: c1: ahoj22, c2: 22 +NOTICE: c1: ahoj23, c2: 23 +NOTICE: c1: ahoj24, c2: 24 +NOTICE: c1: ahoj25, c2: 25 +NOTICE: c1: ahoj26, c2: 26 +NOTICE: c1: ahoj27, c2: 27 +NOTICE: c1: ahoj28, c2: 28 +NOTICE: c1: ahoj29, c2: 29 +NOTICE: c1: ahoj30, c2: 30 +do $$ +declare + c int; + strval varchar; + intval int; + nrows int default 30; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'select ''ahoj'' || i, i from generate_series(1, :nrows) g(i)'); + call dbms_sql.bind_variable(c, 'nrows', nrows); + call dbms_sql.define_column(c, 1, strval); + call dbms_sql.define_column(c, 2, intval); + perform dbms_sql.execute(c); + while dbms_sql.fetch_rows(c) > 0 + loop + strval := dbms_sql.column_value_f(c, 1, strval); + intval := dbms_sql.column_value_f(c, 2, intval); + raise notice 'c1: %, c2: %', strval, intval; + end loop; + call dbms_sql.close_cursor(c); +end; +$$; +NOTICE: c1: ahoj1, c2: 1 +NOTICE: c1: ahoj2, c2: 2 +NOTICE: c1: ahoj3, c2: 3 +NOTICE: c1: ahoj4, c2: 4 +NOTICE: c1: ahoj5, c2: 5 +NOTICE: c1: ahoj6, c2: 6 +NOTICE: c1: ahoj7, c2: 7 +NOTICE: c1: ahoj8, c2: 8 +NOTICE: c1: ahoj9, c2: 9 +NOTICE: c1: ahoj10, c2: 10 +NOTICE: c1: ahoj11, c2: 11 +NOTICE: c1: ahoj12, c2: 12 +NOTICE: c1: ahoj13, c2: 13 +NOTICE: c1: ahoj14, c2: 14 +NOTICE: c1: ahoj15, c2: 15 +NOTICE: c1: ahoj16, c2: 16 +NOTICE: c1: ahoj17, c2: 17 +NOTICE: c1: ahoj18, c2: 18 +NOTICE: c1: ahoj19, c2: 19 +NOTICE: c1: ahoj20, c2: 20 +NOTICE: c1: ahoj21, c2: 21 +NOTICE: c1: ahoj22, c2: 22 +NOTICE: c1: ahoj23, c2: 23 +NOTICE: c1: ahoj24, c2: 24 +NOTICE: c1: ahoj25, c2: 25 +NOTICE: c1: ahoj26, c2: 26 +NOTICE: c1: ahoj27, c2: 27 +NOTICE: c1: ahoj28, c2: 28 +NOTICE: c1: ahoj29, c2: 29 +NOTICE: c1: ahoj30, c2: 30 +drop table if exists foo; +create table foo(a int, b varchar, c numeric); +do $$ +declare c int; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'insert into foo values(:a, :b, :c)'); + for i in 1..100 + loop + call dbms_sql.bind_variable(c, 'a', i); + call dbms_sql.bind_variable(c, 'b', 'Ahoj ' || i); + call dbms_sql.bind_variable(c, 'c', i + 0.033); + perform dbms_sql.execute(c); + end loop; +end; +$$; +select * from foo; + a | b | c +-----+----------+--------- + 1 | Ahoj 1 | 1.033 + 2 | Ahoj 2 | 2.033 + 3 | Ahoj 3 | 3.033 + 4 | Ahoj 4 | 4.033 + 5 | Ahoj 5 | 5.033 + 6 | Ahoj 6 | 6.033 + 7 | Ahoj 7 | 7.033 + 8 | Ahoj 8 | 8.033 + 9 | Ahoj 9 | 9.033 + 10 | Ahoj 10 | 10.033 + 11 | Ahoj 11 | 11.033 + 12 | Ahoj 12 | 12.033 + 13 | Ahoj 13 | 13.033 + 14 | Ahoj 14 | 14.033 + 15 | Ahoj 15 | 15.033 + 16 | Ahoj 16 | 16.033 + 17 | Ahoj 17 | 17.033 + 18 | Ahoj 18 | 18.033 + 19 | Ahoj 19 | 19.033 + 20 | Ahoj 20 | 20.033 + 21 | Ahoj 21 | 21.033 + 22 | Ahoj 22 | 22.033 + 23 | Ahoj 23 | 23.033 + 24 | Ahoj 24 | 24.033 + 25 | Ahoj 25 | 25.033 + 26 | Ahoj 26 | 26.033 + 27 | Ahoj 27 | 27.033 + 28 | Ahoj 28 | 28.033 + 29 | Ahoj 29 | 29.033 + 30 | Ahoj 30 | 30.033 + 31 | Ahoj 31 | 31.033 + 32 | Ahoj 32 | 32.033 + 33 | Ahoj 33 | 33.033 + 34 | Ahoj 34 | 34.033 + 35 | Ahoj 35 | 35.033 + 36 | Ahoj 36 | 36.033 + 37 | Ahoj 37 | 37.033 + 38 | Ahoj 38 | 38.033 + 39 | Ahoj 39 | 39.033 + 40 | Ahoj 40 | 40.033 + 41 | Ahoj 41 | 41.033 + 42 | Ahoj 42 | 42.033 + 43 | Ahoj 43 | 43.033 + 44 | Ahoj 44 | 44.033 + 45 | Ahoj 45 | 45.033 + 46 | Ahoj 46 | 46.033 + 47 | Ahoj 47 | 47.033 + 48 | Ahoj 48 | 48.033 + 49 | Ahoj 49 | 49.033 + 50 | Ahoj 50 | 50.033 + 51 | Ahoj 51 | 51.033 + 52 | Ahoj 52 | 52.033 + 53 | Ahoj 53 | 53.033 + 54 | Ahoj 54 | 54.033 + 55 | Ahoj 55 | 55.033 + 56 | Ahoj 56 | 56.033 + 57 | Ahoj 57 | 57.033 + 58 | Ahoj 58 | 58.033 + 59 | Ahoj 59 | 59.033 + 60 | Ahoj 60 | 60.033 + 61 | Ahoj 61 | 61.033 + 62 | Ahoj 62 | 62.033 + 63 | Ahoj 63 | 63.033 + 64 | Ahoj 64 | 64.033 + 65 | Ahoj 65 | 65.033 + 66 | Ahoj 66 | 66.033 + 67 | Ahoj 67 | 67.033 + 68 | Ahoj 68 | 68.033 + 69 | Ahoj 69 | 69.033 + 70 | Ahoj 70 | 70.033 + 71 | Ahoj 71 | 71.033 + 72 | Ahoj 72 | 72.033 + 73 | Ahoj 73 | 73.033 + 74 | Ahoj 74 | 74.033 + 75 | Ahoj 75 | 75.033 + 76 | Ahoj 76 | 76.033 + 77 | Ahoj 77 | 77.033 + 78 | Ahoj 78 | 78.033 + 79 | Ahoj 79 | 79.033 + 80 | Ahoj 80 | 80.033 + 81 | Ahoj 81 | 81.033 + 82 | Ahoj 82 | 82.033 + 83 | Ahoj 83 | 83.033 + 84 | Ahoj 84 | 84.033 + 85 | Ahoj 85 | 85.033 + 86 | Ahoj 86 | 86.033 + 87 | Ahoj 87 | 87.033 + 88 | Ahoj 88 | 88.033 + 89 | Ahoj 89 | 89.033 + 90 | Ahoj 90 | 90.033 + 91 | Ahoj 91 | 91.033 + 92 | Ahoj 92 | 92.033 + 93 | Ahoj 93 | 93.033 + 94 | Ahoj 94 | 94.033 + 95 | Ahoj 95 | 95.033 + 96 | Ahoj 96 | 96.033 + 97 | Ahoj 97 | 97.033 + 98 | Ahoj 98 | 98.033 + 99 | Ahoj 99 | 99.033 + 100 | Ahoj 100 | 100.033 +(100 rows) + +truncate foo; +do $$ +declare c int; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'insert into foo values(:a, :b, :c)'); + for i in 1..100 + loop + perform dbms_sql.bind_variable_f(c, 'a', i); + perform dbms_sql.bind_variable_f(c, 'b', 'Ahoj ' || i); + perform dbms_sql.bind_variable_f(c, 'c', i + 0.033); + perform dbms_sql.execute(c); + end loop; +end; +$$; +select * from foo; + a | b | c +-----+----------+--------- + 1 | Ahoj 1 | 1.033 + 2 | Ahoj 2 | 2.033 + 3 | Ahoj 3 | 3.033 + 4 | Ahoj 4 | 4.033 + 5 | Ahoj 5 | 5.033 + 6 | Ahoj 6 | 6.033 + 7 | Ahoj 7 | 7.033 + 8 | Ahoj 8 | 8.033 + 9 | Ahoj 9 | 9.033 + 10 | Ahoj 10 | 10.033 + 11 | Ahoj 11 | 11.033 + 12 | Ahoj 12 | 12.033 + 13 | Ahoj 13 | 13.033 + 14 | Ahoj 14 | 14.033 + 15 | Ahoj 15 | 15.033 + 16 | Ahoj 16 | 16.033 + 17 | Ahoj 17 | 17.033 + 18 | Ahoj 18 | 18.033 + 19 | Ahoj 19 | 19.033 + 20 | Ahoj 20 | 20.033 + 21 | Ahoj 21 | 21.033 + 22 | Ahoj 22 | 22.033 + 23 | Ahoj 23 | 23.033 + 24 | Ahoj 24 | 24.033 + 25 | Ahoj 25 | 25.033 + 26 | Ahoj 26 | 26.033 + 27 | Ahoj 27 | 27.033 + 28 | Ahoj 28 | 28.033 + 29 | Ahoj 29 | 29.033 + 30 | Ahoj 30 | 30.033 + 31 | Ahoj 31 | 31.033 + 32 | Ahoj 32 | 32.033 + 33 | Ahoj 33 | 33.033 + 34 | Ahoj 34 | 34.033 + 35 | Ahoj 35 | 35.033 + 36 | Ahoj 36 | 36.033 + 37 | Ahoj 37 | 37.033 + 38 | Ahoj 38 | 38.033 + 39 | Ahoj 39 | 39.033 + 40 | Ahoj 40 | 40.033 + 41 | Ahoj 41 | 41.033 + 42 | Ahoj 42 | 42.033 + 43 | Ahoj 43 | 43.033 + 44 | Ahoj 44 | 44.033 + 45 | Ahoj 45 | 45.033 + 46 | Ahoj 46 | 46.033 + 47 | Ahoj 47 | 47.033 + 48 | Ahoj 48 | 48.033 + 49 | Ahoj 49 | 49.033 + 50 | Ahoj 50 | 50.033 + 51 | Ahoj 51 | 51.033 + 52 | Ahoj 52 | 52.033 + 53 | Ahoj 53 | 53.033 + 54 | Ahoj 54 | 54.033 + 55 | Ahoj 55 | 55.033 + 56 | Ahoj 56 | 56.033 + 57 | Ahoj 57 | 57.033 + 58 | Ahoj 58 | 58.033 + 59 | Ahoj 59 | 59.033 + 60 | Ahoj 60 | 60.033 + 61 | Ahoj 61 | 61.033 + 62 | Ahoj 62 | 62.033 + 63 | Ahoj 63 | 63.033 + 64 | Ahoj 64 | 64.033 + 65 | Ahoj 65 | 65.033 + 66 | Ahoj 66 | 66.033 + 67 | Ahoj 67 | 67.033 + 68 | Ahoj 68 | 68.033 + 69 | Ahoj 69 | 69.033 + 70 | Ahoj 70 | 70.033 + 71 | Ahoj 71 | 71.033 + 72 | Ahoj 72 | 72.033 + 73 | Ahoj 73 | 73.033 + 74 | Ahoj 74 | 74.033 + 75 | Ahoj 75 | 75.033 + 76 | Ahoj 76 | 76.033 + 77 | Ahoj 77 | 77.033 + 78 | Ahoj 78 | 78.033 + 79 | Ahoj 79 | 79.033 + 80 | Ahoj 80 | 80.033 + 81 | Ahoj 81 | 81.033 + 82 | Ahoj 82 | 82.033 + 83 | Ahoj 83 | 83.033 + 84 | Ahoj 84 | 84.033 + 85 | Ahoj 85 | 85.033 + 86 | Ahoj 86 | 86.033 + 87 | Ahoj 87 | 87.033 + 88 | Ahoj 88 | 88.033 + 89 | Ahoj 89 | 89.033 + 90 | Ahoj 90 | 90.033 + 91 | Ahoj 91 | 91.033 + 92 | Ahoj 92 | 92.033 + 93 | Ahoj 93 | 93.033 + 94 | Ahoj 94 | 94.033 + 95 | Ahoj 95 | 95.033 + 96 | Ahoj 96 | 96.033 + 97 | Ahoj 97 | 97.033 + 98 | Ahoj 98 | 98.033 + 99 | Ahoj 99 | 99.033 + 100 | Ahoj 100 | 100.033 +(100 rows) + +truncate foo; +do $$ +declare + c int; + a int[]; + b varchar[]; + ca numeric[]; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'insert into foo values(:a, :b, :c)'); + a := ARRAY[1, 2, 3, 4, 5]; + b := ARRAY['Ahoj', 'Nazdar', 'Bazar']; + ca := ARRAY[3.14, 2.22, 3.8, 4]; + + call dbms_sql.bind_array(c, 'a', a); + call dbms_sql.bind_array(c, 'b', b); + call dbms_sql.bind_array(c, 'c', ca); + raise notice 'inserted rows %d', dbms_sql.execute(c); +end; +$$; +NOTICE: inserted rows 3d +select * from foo; + a | b | c +---+--------+------ + 1 | Ahoj | 3.14 + 2 | Nazdar | 2.22 + 3 | Bazar | 3.8 +(3 rows) + +truncate foo; +-- should not to crash, when bound array is null +do $$ +declare + c int; + ca numeric[]; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'insert into foo values(:a, 10, 20)'); + + call dbms_sql.bind_array(c, 'a', ca); + raise notice 'inserted rows %d', dbms_sql.execute(c); +end; +$$; +NOTICE: inserted rows 0d +-- should not to crash, when we try to touch result without execute +do $$ +declare + c int; + a int[]; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'select i from generate_series(1, 2) g(i)'); + call dbms_sql.define_array(c, 1, a, 10, 1); + call dbms_sql.column_value(c, 1, a); + call dbms_sql.close_cursor(c); +end; +$$; +ERROR: cursor is not executed +CONTEXT: SQL statement "CALL dbms_sql.column_value(c, 1, a)" +PL/pgSQL function inline_code_block line 9 at CALL +-- should not to crash, when the variable is overwritten +DO $$ +declare + c integer; + n integer; + c2 numeric; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'INSERT INTO foo(a) VALUES (:bnd2)'); + call dbms_sql.bind_variable(c, 'bnd2', c2); + call dbms_sql.bind_variable(c, 'bnd2', c2); + n := dbms_sql.execute(c); +end +$$; +-- should not to crash, when we try to read column without data +do $$ +declare + c int; + strval varchar; + intval int; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'select ''foo'', 1'); + call dbms_sql.define_column(c, 1, strval); + call dbms_sql.define_column(c, 2, intval); + perform dbms_sql.execute(c); + while dbms_sql.fetch_rows(c) > -1 + loop + call dbms_sql.column_value(c, 1, strval); + end loop; + call dbms_sql.close_cursor(c); +end; +$$; +ERROR: no data found +CONTEXT: SQL statement "CALL dbms_sql.column_value(c, 1, strval)" +PL/pgSQL function inline_code_block line 14 at CALL +select * from foo; + a | b | c +---+---+--- + | | +(1 row) + +truncate foo; +do $$ +declare + c int; + a int[]; + b varchar[]; + ca numeric[]; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'insert into foo values(:a, :b, :c)'); + a := ARRAY[1, 2, 3, 4, 5]; + b := ARRAY['Ahoj', 'Nazdar', 'Bazar']; + ca := ARRAY[3.14, 2.22, 3.8, 4]; + + call dbms_sql.bind_array(c, 'a', a, 2, 3); + call dbms_sql.bind_array(c, 'b', b, 3, 4); + call dbms_sql.bind_array(c, 'c', ca); + raise notice 'inserted rows %d', dbms_sql.execute(c); +end; +$$; +NOTICE: inserted rows 1d +select * from foo; + a | b | c +---+-------+----- + 3 | Bazar | 3.8 +(1 row) + +truncate foo; +do $$ +declare + c int; + a int[]; + b varchar[]; + ca numeric[]; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'select i, ''Ahoj'' || i, i + 0.003 from generate_series(1, 35) g(i)'); + call dbms_sql.define_array(c, 1, a, 10, 1); + call dbms_sql.define_array(c, 2, b, 10, 1); + call dbms_sql.define_array(c, 3, ca, 10, 1); + + perform dbms_sql.execute(c); + while dbms_sql.fetch_rows(c) > 0 + loop + call dbms_sql.column_value(c, 1, a); + call dbms_sql.column_value(c, 2, b); + call dbms_sql.column_value(c, 3, ca); + raise notice 'a = %', a; + raise notice 'b = %', b; + raise notice 'c = %', ca; + end loop; + call dbms_sql.close_cursor(c); +end; +$$; +NOTICE: a = {1,2,3,4,5,6,7,8,9,10} +NOTICE: b = {Ahoj1,Ahoj2,Ahoj3,Ahoj4,Ahoj5,Ahoj6,Ahoj7,Ahoj8,Ahoj9,Ahoj10} +NOTICE: c = {1.003,2.003,3.003,4.003,5.003,6.003,7.003,8.003,9.003,10.003} +NOTICE: a = {11,12,13,14,15,16,17,18,19,20} +NOTICE: b = {Ahoj11,Ahoj12,Ahoj13,Ahoj14,Ahoj15,Ahoj16,Ahoj17,Ahoj18,Ahoj19,Ahoj20} +NOTICE: c = {11.003,12.003,13.003,14.003,15.003,16.003,17.003,18.003,19.003,20.003} +NOTICE: a = {21,22,23,24,25,26,27,28,29,30} +NOTICE: b = {Ahoj21,Ahoj22,Ahoj23,Ahoj24,Ahoj25,Ahoj26,Ahoj27,Ahoj28,Ahoj29,Ahoj30} +NOTICE: c = {21.003,22.003,23.003,24.003,25.003,26.003,27.003,28.003,29.003,30.003} +NOTICE: a = {31,32,33,34,35} +NOTICE: b = {Ahoj31,Ahoj32,Ahoj33,Ahoj34,Ahoj35} +NOTICE: c = {31.003,32.003,33.003,34.003,35.003} +drop table foo; +create table tab1(c1 integer, c2 numeric); +create or replace procedure single_Row_insert(c1 integer, c2 numeric) +as $$ +declare + c integer; + n integer; +begin + c := dbms_sql.open_cursor(); + + call dbms_sql.parse(c, 'INSERT INTO tab1 VALUES (:bnd1, :bnd2)'); + + call dbms_sql.bind_variable(c, 'bnd1', c1); + call dbms_sql.bind_variable(c, 'bnd2', c2); + + n := dbms_sql.execute(c); + + call dbms_sql.debug_cursor(c); + call dbms_sql.close_cursor(c); +end +$$language plpgsql; +do $$ +declare a numeric(7,2); +begin + call single_Row_insert(2,a); +end +$$; +NOTICE: orig query: "INSERT INTO tab1 VALUES (:bnd1, :bnd2)" +NOTICE: parsed query: "INSERT INTO tab1 VALUES ($1, $2)" +NOTICE: variable "bnd1" is assigned to "2" +NOTICE: variable "bnd2" is NULL +select * from tab1; + c1 | c2 +----+---- + 2 | +(1 row) + +do $$ +declare a numeric(7,2) default 1.23; +begin + call single_Row_insert(2,a); +end +$$; +NOTICE: orig query: "INSERT INTO tab1 VALUES (:bnd1, :bnd2)" +NOTICE: parsed query: "INSERT INTO tab1 VALUES ($1, $2)" +NOTICE: variable "bnd1" is assigned to "2" +NOTICE: variable "bnd2" is assigned to "1.23" +select * from tab1; + c1 | c2 +----+------ + 2 | + 2 | 1.23 +(2 rows) + +select * from tab1 where c2 is null; + c1 | c2 +----+---- + 2 | +(1 row) + +do $$ +declare a numeric(7,2); +begin + call single_Row_insert(0,a); -- single_Row_insert(0, null) +end +$$; +NOTICE: orig query: "INSERT INTO tab1 VALUES (:bnd1, :bnd2)" +NOTICE: parsed query: "INSERT INTO tab1 VALUES ($1, $2)" +NOTICE: variable "bnd1" is assigned to "0" +NOTICE: variable "bnd2" is NULL +select * from tab1; + c1 | c2 +----+------ + 2 | + 2 | 1.23 + 0 | +(3 rows) + +do $$ +declare a numeric(7,2) default 1.23; +begin + call single_Row_insert(0,a); -- single_Row_insert(0, 1.23) +end +$$; +NOTICE: orig query: "INSERT INTO tab1 VALUES (:bnd1, :bnd2)" +NOTICE: parsed query: "INSERT INTO tab1 VALUES ($1, $2)" +NOTICE: variable "bnd1" is assigned to "0" +NOTICE: variable "bnd2" is assigned to "1.23" +select * from tab1; + c1 | c2 +----+------ + 2 | + 2 | 1.23 + 0 | + 0 | 1.23 +(4 rows) + +drop procedure single_Row_insert; +drop table tab1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orafce-4.9.1+git0.1071eb6/plvlex.c new/orafce-4.9.2+git0.17c9ce4/plvlex.c --- old/orafce-4.9.1+git0.1071eb6/plvlex.c 2024-01-28 08:49:25.000000000 +0100 +++ new/orafce-4.9.2+git0.17c9ce4/plvlex.c 2024-02-08 05:20:56.000000000 +0100 @@ -129,7 +129,7 @@ if (qnames) { - bool isdot = (IsType(nd, OTHERS) && (nd->str[0] == '.')); + bool isdot = (IsType(nd, OTHERS) && (nd->str) && (nd->str[0] == '.')); if (IsType(nd, IDENT) && dot && a) { @@ -201,7 +201,6 @@ fctx->values = (char **) palloc (6 * sizeof (char *)); fctx->values [0] = (char*) palloc (16 * sizeof (char)); - fctx->values [1] = (char*) palloc (1024 * sizeof (char)); fctx->values [2] = (char*) palloc (16 * sizeof (char)); fctx->values [3] = (char*) palloc (16 * sizeof (char)); fctx->values [4] = (char*) palloc (255 * sizeof (char)); @@ -248,7 +247,9 @@ back_vals[5] = values[5]; snprintf(values[0], 16, "%d", nd->lloc); - snprintf(values[1], 10000, "%s", SF(nd->str)); + + values[1] = nd->str; + snprintf(values[2], 16, "%d", nd->keycode); snprintf(values[3], 16, "%s", nd->classname); snprintf(values[4], 255, "%s", SF(nd->sep)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orafce-4.9.1+git0.1071eb6/sql/dbms_sql.sql new/orafce-4.9.2+git0.17c9ce4/sql/dbms_sql.sql --- old/orafce-4.9.1+git0.1071eb6/sql/dbms_sql.sql 2024-01-28 08:49:25.000000000 +0100 +++ new/orafce-4.9.2+git0.17c9ce4/sql/dbms_sql.sql 2024-02-08 05:20:56.000000000 +0100 @@ -107,6 +107,71 @@ select * from foo; truncate foo; +-- should not to crash, when bound array is null +do $$ +declare + c int; + ca numeric[]; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'insert into foo values(:a, 10, 20)'); + + call dbms_sql.bind_array(c, 'a', ca); + raise notice 'inserted rows %d', dbms_sql.execute(c); +end; +$$; + +-- should not to crash, when we try to touch result without execute +do $$ +declare + c int; + a int[]; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'select i from generate_series(1, 2) g(i)'); + call dbms_sql.define_array(c, 1, a, 10, 1); + call dbms_sql.column_value(c, 1, a); + call dbms_sql.close_cursor(c); +end; +$$; + +-- should not to crash, when the variable is overwritten +DO $$ +declare + c integer; + n integer; + c2 numeric; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'INSERT INTO foo(a) VALUES (:bnd2)'); + call dbms_sql.bind_variable(c, 'bnd2', c2); + call dbms_sql.bind_variable(c, 'bnd2', c2); + n := dbms_sql.execute(c); +end +$$; + +-- should not to crash, when we try to read column without data +do $$ +declare + c int; + strval varchar; + intval int; +begin + c := dbms_sql.open_cursor(); + call dbms_sql.parse(c, 'select ''foo'', 1'); + call dbms_sql.define_column(c, 1, strval); + call dbms_sql.define_column(c, 2, intval); + perform dbms_sql.execute(c); + while dbms_sql.fetch_rows(c) > -1 + loop + call dbms_sql.column_value(c, 1, strval); + end loop; + call dbms_sql.close_cursor(c); +end; +$$; + +select * from foo; +truncate foo; do $$ declare c int; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orafce-4.9.1+git0.1071eb6/sqlscan.c new/orafce-4.9.2+git0.17c9ce4/sqlscan.c --- old/orafce-4.9.1+git0.1071eb6/sqlscan.c 2024-01-28 08:49:25.000000000 +0100 +++ new/orafce-4.9.2+git0.17c9ce4/sqlscan.c 2024-02-08 05:20:56.000000000 +0100 @@ -1422,7 +1422,7 @@ #line 316 "sqlscan.l" { SET_YYLLOC(); - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = NULL; yylval.val.keycode = -1; yylval.val.sep = NULL; @@ -1434,7 +1434,7 @@ #line 325 "sqlscan.l" { SET_YYLLOC(); - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = "sc"; yylval.val.keycode = -1; yylval.val.sep = NULL; @@ -1788,7 +1788,7 @@ /* throw back all but the initial "$" */ yyless(1); /* and treat it as {other} */ - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = "dolqf"; yylval.val.keycode = -1; yylval.val.sep = NULL; @@ -1912,6 +1912,7 @@ #line 636 "sqlscan.l" { SET_YYLLOC(); + yylval.val.str = pstrdup(yytext); yylval.val.modificator = "typecast"; yylval.val.keycode = X_TYPECAST; yylval.val.sep = NULL; @@ -1920,10 +1921,10 @@ YY_BREAK case 43: YY_RULE_SETUP -#line 644 "sqlscan.l" +#line 645 "sqlscan.l" { SET_YYLLOC(); - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = "self"; yylval.val.keycode = yytext[0]; yylval.val.sep = NULL; @@ -1932,7 +1933,7 @@ YY_BREAK case 44: YY_RULE_SETUP -#line 653 "sqlscan.l" +#line 654 "sqlscan.l" { /* * Check for embedded slash-star or dash-dash; those @@ -1994,7 +1995,7 @@ if (nchars == 1 && strchr(",()[].;:+-*/%^<>=", yytext[0])) { - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = NULL; yylval.val.keycode = yytext[0]; yylval.val.sep = NULL; @@ -2024,11 +2025,11 @@ YY_BREAK case 45: YY_RULE_SETUP -#line 742 "sqlscan.l" +#line 743 "sqlscan.l" { SET_YYLLOC(); yylval.val.modificator = NULL; - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.keycode = -1; yylval.val.sep = NULL; return X_PARAM; @@ -2036,7 +2037,7 @@ YY_BREAK case 46: YY_RULE_SETUP -#line 751 "sqlscan.l" +#line 752 "sqlscan.l" { long val; char* endptr; @@ -2058,7 +2059,7 @@ yylval.val.sep = NULL; return X_NCONST; } - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = "i"; yylval.val.keycode = -1; yylval.val.sep = NULL; @@ -2067,7 +2068,7 @@ YY_BREAK case 47: YY_RULE_SETUP -#line 778 "sqlscan.l" +#line 779 "sqlscan.l" { SET_YYLLOC(); yylval.val.str = pstrdup(yytext); @@ -2079,7 +2080,7 @@ YY_BREAK case 48: YY_RULE_SETUP -#line 786 "sqlscan.l" +#line 787 "sqlscan.l" { SET_YYLLOC(); yylval.val.str = pstrdup(yytext); @@ -2091,7 +2092,7 @@ YY_BREAK case 49: YY_RULE_SETUP -#line 794 "sqlscan.l" +#line 795 "sqlscan.l" { /* * throw back the [Ee], and treat as {decimal}. Note @@ -2110,7 +2111,7 @@ YY_BREAK case 50: YY_RULE_SETUP -#line 809 "sqlscan.l" +#line 810 "sqlscan.l" { /* throw back the [Ee][+-], and proceed as above */ yyless(yyleng-2); @@ -2124,7 +2125,7 @@ YY_BREAK case 51: YY_RULE_SETUP -#line 821 "sqlscan.l" +#line 822 "sqlscan.l" { char *ident; const char *keyword; @@ -2160,10 +2161,10 @@ YY_BREAK case 52: YY_RULE_SETUP -#line 854 "sqlscan.l" +#line 855 "sqlscan.l" { SET_YYLLOC(); - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = NULL; yylval.val.keycode = yytext[0]; yylval.val.sep = NULL; @@ -2171,7 +2172,7 @@ } YY_BREAK case YY_STATE_EOF(INITIAL): -#line 863 "sqlscan.l" +#line 864 "sqlscan.l" { SET_YYLLOC(); yyterminate(); @@ -2179,10 +2180,10 @@ YY_BREAK case 53: YY_RULE_SETUP -#line 868 "sqlscan.l" +#line 869 "sqlscan.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2185 "sqlscan.c" +#line 2186 "sqlscan.c" case YY_END_OF_BUFFER: { @@ -3149,7 +3150,7 @@ #define YYTABLES_NAME "yytables" -#line 868 "sqlscan.l" +#line 869 "sqlscan.l" /* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/orafce-4.9.1+git0.1071eb6/sqlscan.l new/orafce-4.9.2+git0.17c9ce4/sqlscan.l --- old/orafce-4.9.1+git0.1071eb6/sqlscan.l 2024-01-28 08:49:25.000000000 +0100 +++ new/orafce-4.9.2+git0.17c9ce4/sqlscan.l 2024-02-08 05:20:56.000000000 +0100 @@ -315,7 +315,7 @@ {whitespace} { SET_YYLLOC(); - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = NULL; yylval.val.keycode = -1; yylval.val.sep = NULL; @@ -324,7 +324,7 @@ {comment} { SET_YYLLOC(); - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = "sc"; yylval.val.keycode = -1; yylval.val.sep = NULL; @@ -554,7 +554,7 @@ /* throw back all but the initial "$" */ yyless(1); /* and treat it as {other} */ - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = "dolqf"; yylval.val.keycode = -1; yylval.val.sep = NULL; @@ -635,6 +635,7 @@ } {typecast} { SET_YYLLOC(); + yylval.val.str = pstrdup(yytext); yylval.val.modificator = "typecast"; yylval.val.keycode = X_TYPECAST; yylval.val.sep = NULL; @@ -643,7 +644,7 @@ {self} { SET_YYLLOC(); - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = "self"; yylval.val.keycode = yytext[0]; yylval.val.sep = NULL; @@ -711,7 +712,7 @@ if (nchars == 1 && strchr(",()[].;:+-*/%^<>=", yytext[0])) { - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = NULL; yylval.val.keycode = yytext[0]; yylval.val.sep = NULL; @@ -742,7 +743,7 @@ {param} { SET_YYLLOC(); yylval.val.modificator = NULL; - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.keycode = -1; yylval.val.sep = NULL; return X_PARAM; @@ -769,7 +770,7 @@ yylval.val.sep = NULL; return X_NCONST; } - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = "i"; yylval.val.keycode = -1; yylval.val.sep = NULL; @@ -853,7 +854,7 @@ {other} { SET_YYLLOC(); - yylval.val.str = yytext; + yylval.val.str = pstrdup(yytext); yylval.val.modificator = NULL; yylval.val.keycode = yytext[0]; yylval.val.sep = NULL; ++++++ orafce.obsinfo ++++++ --- /var/tmp/diff_new_pack.dGRIZb/_old 2024-02-08 19:03:10.449286394 +0100 +++ /var/tmp/diff_new_pack.dGRIZb/_new 2024-02-08 19:03:10.453286538 +0100 @@ -1,5 +1,5 @@ name: orafce -version: 4.9.1+git0.1071eb6 -mtime: 1706428165 -commit: 1071eb658945973396144a8a6b7b8fb74cfa6047 +version: 4.9.2+git0.17c9ce4 +mtime: 1707366056 +commit: 17c9ce474b254ff2ee868aa02ff23cfdf0726a85