Bug 919414

Summary: zone2sqlite is sometime unable to create tables
Product: Red Hat Enterprise Linux 6 Reporter: GV <rhel>
Component: bindAssignee: Tomáš Hozza <thozza>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.4CC: hhorak
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: bind-9.8.2-0.26.rc1.el6 Doc Type: Bug Fix
Doc Text:
Cause: The zone2sqlite utility when calling sqlite commands was using formatting option that did not add single quotes around the outside of the argument. Consequence: As a consequence zone2sqlite was unable to perform operations on tables which name contained "." or "-" or started with digit. Fix: The zone2sqlite utility was fixed to use formatting option that adds a single quotes around the outside of the rgument, when calling sqlite commands. Result: As a result zone2sqlite ius now able to perform operations on tables which name contained "." or "-" or started with digit.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 04:34:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix for this issue none

Description GV 2013-03-08 12:06:35 UTC
Description of problem:
zone2sqlite cannot create a table when table name contain ".", "-" or start with a digit, etc.

Version-Release number of selected component (if applicable):
bind-9.8.2-0.17.rc1.el6.3.x86_64
bind-sdb-9.8.2-0.17.rc1.el6.3.x86_64

How reproducible:
# zone2sqlite
usage: zone2sqlite <zone> <zonefile> <dbfile> <dbtable>

# zone2sqlite domaintest.org m:domaintest.org zones.db domaintest.org
Connecting to 'zones.db'
DROP TABLE domaintest.org 
CREATE TABLE domaintest.org (NAME TEXT, TTL INTEGER, RDTYPE TEXT, RDATA TEXT) 
CREATE TABLE domaintest.org failed: unknown database domaintest

# zone2sqlite 0-255.1.168.192.in-addr.arpa m:0-255.1.168.192.in-addr.arpa zones.db 0-255.1.168.192.in-addr.arpa
Connecting to 'zones.db'
DROP TABLE 0-255.1.168.192.in-addr.arpa 
CREATE TABLE 0-255.1.168.192.in-addr.arpa (NAME TEXT, TTL INTEGER, RDTYPE TEXT, RDATA TEXT) 
CREATE TABLE 0-255.1.168.192.in-addr.arpa failed: near "0": syntax error

# zone2sqlite 0-255.1.168.192.in-addr.arpa m:0-255.1.168.192.in-addr.arpa zones.db rev_0-255.1.168.192.in-addr.arpa
Connecting to 'zones.db'
DROP TABLE rev_0-255.1.168.192.in-addr.arpa 
CREATE TABLE rev_0-255.1.168.192.in-addr.arpa (NAME TEXT, TTL INTEGER, RDTYPE TEXT, RDATA TEXT) 
CREATE TABLE rev_0-255.1.168.192.in-addr.arpa failed: near "-": syntax error

Additional info:
1. Table can be created with dummy names and renamed after.
2. named-sdb seems to work fine with table names containing ".", "-" or starting with a digit.
3. Fixing the bug is trivial.

Comment 2 Tomáš Hozza 2013-05-02 13:58:43 UTC
Created attachment 742712 [details]
Fix for this issue

Comment 7 errata-xmlrpc 2014-10-14 04:34:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1373.html