Skip to content

Commit 123346e

Browse files
committed
docs: clarify Oracle compatibility in DBMS_OUTPUT comments
Address CodeRabbit review feedback: - Change "full Oracle compatibility" to "high Oracle compatibility" - Clarify that re-ENABLE clearing buffer is IvorySQL behavior (not Oracle) - Clarify that buffer size range is IvorySQL-enforced (stricter than Oracle) - Reference GitHub issues #22 and #26 for tracking differences
1 parent 0324f53 commit 123346e

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

  • contrib/ivorysql_ora/src/builtin_packages/dbms_output

contrib/ivorysql_ora/src/builtin_packages/dbms_output/dbms_output.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* package for IvorySQL.
2020
*
2121
* Provides session-level buffering for PUT_LINE, PUT, NEW_LINE,
22-
* GET_LINE, and GET_LINES functions with full Oracle compatibility.
22+
* GET_LINE, and GET_LINES functions with high Oracle compatibility.
23+
* See ora_dbms_output.sql tests for known behavioral differences.
2324
*
2425
* contrib/ivorysql_ora/src/builtin_packages/dbms_output/dbms_output.c
2526
*
@@ -83,14 +84,17 @@ PG_FUNCTION_INFO_V1(ora_dbms_output_get_lines);
8384
* init_output_buffer
8485
*
8586
* Initialize or re-initialize the output buffer.
86-
* CRITICAL: Oracle behavior - ENABLE always clears existing buffer.
87+
*
88+
* IvorySQL behavior: ENABLE always clears existing buffer.
89+
* Note: Oracle preserves buffer on re-ENABLE; this is an intentional
90+
* IvorySQL simplification. See GitHub issue #26 for tracking.
8791
*/
8892
static void
8993
init_output_buffer(int buffer_size)
9094
{
9195
MemoryContext oldcontext;
9296

93-
/* Oracle behavior: ENABLE always clears existing buffer */
97+
/* IvorySQL behavior: ENABLE clears existing buffer (differs from Oracle) */
9498
if (output_buffer != NULL)
9599
cleanup_output_buffer();
96100

@@ -266,8 +270,12 @@ dbms_output_xact_callback(XactEvent event, void *arg)
266270
*
267271
* Enable output buffering with optional size limit.
268272
* NULL parameter means UNLIMITED (Oracle 10g R2+).
269-
* Oracle constraints: 2000 to 1000000 bytes when explicitly specified.
270-
* Default (from SQL): 20000 bytes.
273+
*
274+
* IvorySQL-enforced range: 2000 to 1000000 bytes when explicitly specified.
275+
* Note: Oracle silently clamps below-min values to 2000 and has no upper limit.
276+
* See GitHub issue #22 for tracking this difference.
277+
*
278+
* Default (from SQL wrapper): 20000 bytes.
271279
*/
272280
Datum
273281
ora_dbms_output_enable(PG_FUNCTION_ARGS)
@@ -281,7 +289,7 @@ ora_dbms_output_enable(PG_FUNCTION_ARGS)
281289
{
282290
buffer_size = PG_GETARG_INT32(0);
283291

284-
/* Oracle constraints: 2000 to 1000000 bytes when explicitly specified */
292+
/* IvorySQL-enforced range (stricter than Oracle, see issue #22) */
285293
if (buffer_size < 2000 || buffer_size > 1000000)
286294
ereport(ERROR,
287295
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),

0 commit comments

Comments
 (0)