Ticket #448 (new defect)

Opened 13 months ago

Last modified 12 months ago

zone2sql --oracle SQL statements do not correspond to documented schema

Reported by: anon Owned by: ahu
Priority: normal Milestone:
Component: auth Version: 3.0
Severity: normal Keywords: zone2sql oracle schema dml documentation
Cc:

Description

When zone2sql is used with --oracle switch, the generated SQL code does not correspond to the schema as described in the official docummentation, specifically:

CREATE TABLE records (

id number(11) not NULL, domain_id INT DEFAULT NULL REFERENCES Domains(ID) ON DELETE CASCADE, name VARCHAR(255) DEFAULT NULL, type VARCHAR(10) DEFAULT NULL, content VARCHAR2(4000) DEFAULT NULL, ttl INT DEFAULT NULL, prio INT DEFAULT NULL, change_date INT DEFAULT NULL, primary key (id)

);

however, the zone2sql --oracle generates DML statements as follows (example scrubbed for privacy / security reasons):

insert into Records (id,ZoneId?, name,type,content,TimeToLive?,Priority) select RECORDS_ID_SEQUENCE.nextval,id ,'host.subdomain.domain.tld', 'A', '1.2.3.4', 86400, 0 from Domains where name='subdomain.domain.tld'

*

ERROR at line 1: ORA-00904: "PRIORITY": invalid identifier

from the schema above, it is apparent that there is a disconnect between what the documented schema is, and what zone2sql thinks should be in the schema. There might be more discrepancies between zone2sql and the documented Oracle schema.

Change History

Changed 13 months ago by peter

Hi! We don't use the oracle or goraclebackend. My suspicion is that zone2sql --oracle was tailored for a pre-3.0 version of one of those backends.

We do not currently have the means to test with Oracle. A patch that looks good will be accepted, so please submit one!

Changed 13 months ago by peter

  • owner changed from somebody to ahu
  • component changed from component1 to auth

Changed 12 months ago by anon

As a quick relief fix, "--oracle" should probably be changed to "--goracle" so as to at least distinguish it from the "oracle" backend. The ideal solution would be to also add support for the "oracle" backend in zone2sql.

Note: See TracTickets for help on using tickets.