UTL_FILE.NEW_LINE silently ignores negative line counts

オープン 初心者向け
#2,634 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@X-LightYear がすでに取り組んでいます。

2026年10月25日 から。

  • #2917 @X-LightYear による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
64/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
c, postgresql
領域
databases

調査の方向性

まず、Oracle互換のUTL_FILE実装とそのテストを見つけ、次に sys.ora_utl_file_new_line の引数検証と改行ループを調べます。負の回数ではVALUE_ERRORの経路を通り、ゼロおよび正の回数では従来の動作が維持されることを確認する回帰テストを追加します。Oracle互換モードでこれらのSQLケースがパスすれば完了です。

索引モデルが issue の本文から書いたものです。

説明

What happened?

The Oracle signature defines UTL_FILE.NEW_LINE's lines parameter as NATURAL, but IvorySQL exposes it as INTEGER and silently loops zero times for a negative value. A caller receives success without writing anything, hiding an invalid argument.

What did you expect to happen?

Negative lines values should be rejected through the package's VALUE_ERROR path. Zero and positive counts should retain their existing behavior. This expectation follows the Oracle-compatible UTL_FILE contract; no Oracle server output is being claimed here.

How can we reproduce it (as minimally and precisely as possible)?

In Oracle-compatible mode, open a writable file and call:

-- Use the repository's UTL_FILE test directory or another writable directory.
SELECT sys.ora_utl_file_new_line(file_handle, -1);

The pre-fix implementation returns successfully and writes no newline. The regression should verify the error for a negative count and preserve the zero/positive cases.

IvorySQL version

master

Compatible mode

oracle

Server encoding

UTF8

Anything else we need to know?

This is limited to the IvorySQL Oracle-compatible UTL_FILE package. The issue concerns argument validation before the newline loop. Oracle server version/output is not available for this report.

OS version

The reproducer is SQL-level and should run on all supported platforms; CI should cover the platform-specific builds.

Before submitting

  • I confirmed the problem still happens on current master
  • I searched existing issues and found no duplicate
主要言語
C
スター
1.1k
フォーク
232
平均マージ
3日 2時間
マージ済み PR(30日)
15

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

IvorySQL/IvorySQL のほかの issue

IvorySQL/IvorySQL の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。