ALTER TABLE OF accepts object tables without ROWID and breaks REF

Abierto
#2,935 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@balckwell ya está trabajando en esto.

Desde el 26/10/2026.

  • #2936 de @balckwell — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
c, postgresql
Área
databases

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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%

Lenguaje dominante
C
Estrellas
1.1k
Forks
232
Merge medio
1 d 20 h
PR fusionados (30 d)
7

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de IvorySQL/IvorySQL

Todos los issues de IvorySQL/IvorySQL

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.