DBMS_RANDOM.STRING rejects a single multibyte option character

Offen
#2,947 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@hexu-xu arbeitet bereits daran.

Seit 27.10.2026.

  • #2949 von @hexu-xu — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
c, postgresql
Bereich
backend, databases

Rechercherichtung

Find the C implementation of DBMS_RANDOM.STRING and read how it validates the option character, especially the check that uses opt[1]. Trace the relevant character encoding and string handling, then run the SQL reproduction in an Oracle-compatible UTF-8 database. Done means a single multibyte option passes validation and returns three uppercase ASCII letters, with existing ASCII behavior preserved.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug
What happened?

On current master (2c5e8dd667), a UTF-8 database rejects DBMS_RANDOM.STRING('é', 3) with: ERROR: the character class must be a single character: u, l, a, x or p. The implementation checks opt[1], so it counts bytes instead of characters. The ASCII unknown-option case already works.

What did you expect to happen?

The single-character option should pass validation. Because é is not one of u/l/a/x/p, the result should contain three uppercase ASCII letters. Oracle's DBMS_RANDOM.STRING documentation declares opt IN CHAR and says other options return uppercase alpha characters: https://docs.oracle.com/en/database/oracle/oracle-database/19/arpls/DBMS_RANDOM.html . This expectation comes from the documentation; I have not tested a live Oracle server.

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

In an IvorySQL UTF-8 database:

SET ivorysql.compatible_mode = oracle;
SELECT dbms_random.string('é', 3);

Actual: ERROR: the character class must be a single character: u, l, a, x or p. A single UTF-8 character is incorrectly treated as multiple bytes.

IvorySQL version

master

Compatible mode

oracle

Server encoding

UTF8

Anything else we need to know?

Source build at master commit 2c5e8dd667 in the repository Ubuntu 22.04 development container; disposable Oracle-mode test cluster. No live Oracle comparison.

OS version

Ubuntu 22.04 development container on WSL2.

Before submitting
  • I confirmed the problem still happens on current master
  • I searched existing issues and found no duplicate
Vorherrschende Sprache
C
Sterne
1.1k
Forks
232
Ø Merge
3 T. 2 Std.
Gemergte PRs (30 T.)
15

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus IvorySQL/IvorySQL

Alle Issues in IvorySQL/IvorySQL

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.