ALTER TABLE OF accepts object tables without ROWID and breaks REF

Ouverte
#2,935 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@balckwell y travaille déjà.

Depuis le 26/10/2026.

  • #2936 par @balckwell — ouverte

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
25/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
À l'abandon
Stack technique
c, postgresql
Domaine
databases

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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%

Langage dominant
C
Étoiles
1.1k
Forks
232
Merge moyen
2 j 3 h
PR mergées (30 j)
8

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de IvorySQL/IvorySQL

Toutes les issues de IvorySQL/IvorySQL

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.