From 822fda9aa79cb40d7a601a6e282825ab47056c68 Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Thu, 24 Apr 2014 18:23:07 +0200 Subject: [PATCH] comment is a reserved word in oracle --- modules/goraclebackend/goracle-schema.sql | 2 +- modules/goraclebackend/goraclebackend.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/goraclebackend/goracle-schema.sql b/modules/goraclebackend/goracle-schema.sql index a65e2842c..4a0205dc7 100644 --- a/modules/goraclebackend/goracle-schema.sql +++ b/modules/goraclebackend/goracle-schema.sql @@ -49,7 +49,7 @@ CREATE TABLE comments ( type VARCHAR2(10) NOT NULL, modified_at INTEGER NOT NULL, account VARCHAR2(40) NOT NULL, - comment VARCHAR2(4000) NOT NULL + "comment" VARCHAR2(4000) NOT NULL ); CREATE SEQUENCE comments_id_sequence; CREATE INDEX comments$nametype ON comments (name, type); diff --git a/modules/goraclebackend/goraclebackend.cc b/modules/goraclebackend/goraclebackend.cc index 5815721d2..bfcd10965 100644 --- a/modules/goraclebackend/goraclebackend.cc +++ b/modules/goraclebackend/goraclebackend.cc @@ -126,8 +126,8 @@ public: declare(suffix, "get-all-domains-query", "Retrieve all domains", "select records.domain_id, records.name, records.content, domains.type, domains.master, domains.notified_serial, domains.last_check from records, domains where records.domain_id=domains.id and records.type='SOA' and (records.disabled=0 OR 1=%d)"); - declare(suffix, "list-comments-query", "", "SELECT domain_id,name,type,modified_at,account,comment FROM comments WHERE domain_id=%d"); - declare(suffix, "insert-comment-query", "", "INSERT INTO comments (id, domain_id, name, type, modified_at, account, comment) VALUES (comments_id_sequence.nextval, %d, '%s', '%s', %d, '%s', '%s')"); + declare(suffix, "list-comments-query", "", "SELECT domain_id,name,type,modified_at,account,\"comment\" FROM comments WHERE domain_id=%d"); + declare(suffix, "insert-comment-query", "", "INSERT INTO comments (id, domain_id, name, type, modified_at, account, \"comment\") VALUES (comments_id_sequence.nextval, %d, '%s', '%s', %d, '%s', '%s')"); declare(suffix, "delete-comment-rrset-query", "", "DELETE FROM comments WHERE domain_id=%d AND name='%s' AND type='%s'"); declare(suffix, "delete-comments-query", "", "DELETE FROM comments WHERE domain_id=%d"); } -- 2.49.0