ALTER TABLE OF accepts object tables without ROWID and breaks REF

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

Maintainer antworten meist innerhalb von 1 Tag

@balckwell arbeitet bereits daran.

Seit 26.10.2026.

  • #2936 von @balckwell — offen

Bewertung

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

Rechercherichtung

The issue describes a narrow guard and regression coverage, but names no source or test files. Start by inspecting linked PR #2936 to find the affected ALTER TABLE conversion path and regression tests. Done means rejecting conversion without ROWID while leaving the table unchanged, permitting conversion after adding ROWID, preserving REF/DEREF behavior, and allowing ordinary composite conversion without ROWID.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

What happened?

ALTER TABLE ... OF accepts a table without ROWID when the target is an Oracle object type. It records the table as an object table, but every REF() expression then fails with REF requires an object table with ROWID (42809). The creation path already requires ROWID for object tables.

What did you expect to happen?

The conversion should enforce the same ROWID requirement as object-table creation and reject an unsupported conversion before changing the table's type. Adding ROWID first, in Oracle compatibility mode, should permit the conversion. Ordinary composite typed tables should continue to support tables without ROWID.

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

SET ivorysql.compatible_mode = oracle;
CREATE TYPE converted_person AS OBJECT (id integer);
CREATE TABLE no_rowids (id integer) WITHOUT ROWID;
INSERT INTO no_rowids VALUES (11);
SET ivorysql.compatible_mode = pg;
ALTER TABLE no_rowids OF converted_person; -- succeeds incorrectly
SELECT relhasrowid, reloftype = 'converted_person'::regtype
FROM pg_class WHERE oid = 'no_rowids'::regclass;
-- f | t
SET ivorysql.compatible_mode = oracle;
SELECT REF(p) FROM no_rowids p;
-- ERROR: REF requires an object table with ROWID

IvorySQL version

Upstream master at 2c5e8dd6676c443571549b801543e6590a260246, reproduced on 2026-10-26 with a debug/cassert build.

Compatible mode

Both: Oracle for ROWID DDL and REF; PG for the type conversion.

Server encoding

UTF8.

OS version

Linux/x86_64, GCC 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1); assertion-enabled debug build.

Anything else we need to know?

A narrow guard and regression coverage have been validated independently. The tests check rejection and unchanged state, adding ROWID to existing rows before conversion, REF/DEREF of existing and new rows, and ordinary composite conversion without ROWID. This is separate from #2004's implicit ROWID-index maintenance issue.

Before submitting

  • I confirmed the problem still happens on current master.
  • I searched existing issues and found no duplicate in the saved results.

Assisted-by: Codex:GPT-6

Percentage of AI-generated code: 100%

Vorherrschende Sprache
C
Sterne
1.1k
Forks
232
Ø Merge
1 T. 20 Std.
Gemergte PRs (30 T.)
7

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.