Skip to content

DBMS_OUTPUT: Buffer size below 2000 should be silently adjusted, not rejected #22

@rophy

Description

@rophy

Description

IvorySQL's DBMS_OUTPUT.ENABLE rejects buffer sizes below 2000 with an error, while Oracle silently adjusts them up to 2000.

Oracle Behavior

Per Oracle documentation:

The minimum size is 2000 bytes and the maximum is unlimited.

When a value below 2000 is passed, Oracle silently adjusts it to 2000:

-- Oracle accepts this and uses 2000 internally
DBMS_OUTPUT.ENABLE(100);
-- No error, buffer works with 2000 byte limit

IvorySQL Behavior

IvorySQL rejects values below 2000:

CALL dbms_output.enable(1000);
-- ERROR: buffer size must be between 2000 and 1000000

Test Case

BEGIN
    DBMS_OUTPUT.ENABLE(100);  -- Should silently use 2000
    FOR i IN 1..50 LOOP
        DBMS_OUTPUT.PUT_LINE('Line ' || i);
    END LOOP;
END;
/
-- Oracle: succeeds (uses 2000 byte buffer)
-- IvorySQL: ERROR

Expected Fix

In pl_dbms_output.c, instead of raising an error for values below 2000, silently adjust to 2000:

if (buffer_size < 2000)
    buffer_size = 2000;  // Silent adjustment like Oracle

Impact

Low - most applications use valid buffer sizes, but this improves Oracle compatibility.

Related

  • Branch: feat/dbms_output
  • Design doc: design/dbms_output/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions