Rob Butler | 3 May 2003 16:31
Picon

DLZ-0.4.3 released

Hello all,

DLZ-0.4.3 has been uploaded to sourceforge and is available for download.

This release includes all the fixes that should have been in 0.4.2.
Everything should work fine with this release.

If you get the warning messages below when building it's ok, everything will
still build properly.

cc1: warning: changing search order for system directory "/usr/include"
cc1: warning:   as it has already been specified as a non-system directory

If anyone knows how to suppress these particular build warnings, or how to
fix things so they don't appear let me know.  These warnings appear when the
Postgres driver is built along with the BDB driver driver.  It is because
the /usr/include path is after other paths instead of at the beginning of
the DLZ include paths.  However, the path for BDB needs to be first so that
the correct db.h file is found for Berkeley DB during the build.

As always let me know if you have any problems with this release.

Later
Rob

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
(Continue reading)

Joel Moss | 4 May 2003 14:00

Query String: select id from zone where zone = 'com'

I have started named as follows: "/usr/local/sbin/named -u named -g -d 2" so I can see what is happenning.  Now everytime a domain appears and a lookup is performed for it in the mysql database, another lookup for "com" is performed.  As follows:
 
May 04 05:50:49.395
Query String: select id from zone where zone = 'domain.com'
 
May 04 05:50:49.396
Query String: select id from zone where zone = 'com'
 
I don't suppose that is normal is it?
 
Thx,
Joel
Joel Moss | 4 May 2003 14:27

mysql driver unable to return result set for lookup query

I have added a domain to my database and filled in all the records correctly.  However, when I run "host electnetworks.com" I get the following errors:
 
May 04 06:16:08.838
Query String: select ttl, type, mx_priority, case when lower(type)='txt' then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = '*'
 
May 04 06:16:08.838 mysql driver unable to return result set for lookup query
May 04 06:16:08.838
Query String: select ttl, type, mx_priority, case when lower(type)='txt' then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = ' <at> '
 
May 04 06:16:08.839 mysql driver unable to return result set for lookup query
May 04 06:16:08.839
Query String: select ttl, type, mx_priority, case when lower(type)='txt' then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = '*'
 
May 04 06:16:08.840 mysql driver unable to return result set for lookup query
Host electnetworks.com not found: 2(SERVFAIL)
 
Can anybody help?
Ian Tait | 4 May 2003 15:35

Win32 implementation yet?

Hi,

Has anyone the time to produce win32 (win2000) binaries as yet?

Cheers,

Ian

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Rob Butler | 4 May 2003 18:37
Picon

Re: mysql driver unable to return result set for lookup query

Joel,
 
Please send a copy of the DLZ section of your named.conf file.  Also, try directly executing the SQL statements below against MySQL using MySQL manager or mysqlc.  If the queries don't work with those utilities the problem is in the query.  If the SQL statements do work with the utils, then the problem is probably in the named.conf file.  Also, be sure you don't put extra information in fields that are not needed for a particular DNS record type.  I.E. don't put anything in primary_ns, resp_person, serial, refresh, retry, expire, minimum, or mx_priority for an A record.
 
From your other e-mail:
 
>> I have started named as follows: "/usr/local/sbin/named -u named -g -d 2" so I can see what is happenning.  Now everytime a domain appears and a lookup is performed for it in the mysql database, another lookup for "com" is performed.  As follows:
 
>> May 04 05:50:49.395
Query String: select id from zone where zone = 'domain.com'
 
>> May 04 05:50:49.396
Query String: select id from zone where zone = 'com'
 
>>I don't suppose that is normal is it?
 
 
Yes, that is perfectly normal.  DLZ tries to match the longest "zone" in the database it can.  So, if you searched for "some.really.long.domain.name.com"  DLZ would search for:
 
select id from zone where zone = 'some.really.long.domain.name.com'
select id from zone where zone = 'really.long.domain.name.com'
select id from zone where zone = 'long.domain.name.com'
select id from zone where zone = 'domain.name.com'
select id from zone where zone = 'name.com'
select id from zone where zone = 'com'
 
if no matches to the zone name was found.  If however a match for the zone name is found, this query will stop, and then the lookup query will be executed.
 
Hope this helps out.
 
Later
Rob
 
----- Original Message -----
From: Joel Moss
Sent: Sunday, May 04, 2003 8:27 AM
Subject: [Bind-dlz-testers] mysql driver unable to return result set for lookup query

I have added a domain to my database and filled in all the records correctly.  However, when I run "host electnetworks.com" I get the following errors:
 
May 04 06:16:08.838
Query String: select ttl, type, mx_priority, case when lower(type)='txt' then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = '*'
 
May 04 06:16:08.838 mysql driver unable to return result set for lookup query
May 04 06:16:08.838
Query String: select ttl, type, mx_priority, case when lower(type)='txt' then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = ' <at> '
 
May 04 06:16:08.839 mysql driver unable to return result set for lookup query
May 04 06:16:08.839
Query String: select ttl, type, mx_priority, case when lower(type)='txt' then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = '*'
 
May 04 06:16:08.840 mysql driver unable to return result set for lookup query
Host electnetworks.com not found: 2(SERVFAIL)
 
Can anybody help?
Rob Butler | 4 May 2003 19:02
Picon

Re: Win32 implementation yet?

Ian,

Binaries for Win32 are really easy. DLZ is actually developed on Win 2k, and
then tested on Redhat.  (I'm slowly migrating to a Linux environment, but I
am still more comfortable on Win 2k.)

If you have Visual Studio & cygwin all you have to do is:

1) download bind-9.2.2 from www.isc.com
2) use winzip to decompress it.  (or if you have cygwin gunzip it, and then
tar -xvf it.)
3) apply the patch file (in cygwin patch -p0 < dlz.patch) Or perhaps you can
find a win32 version of Gnu Patch.  If you can, you don't need cygwin at
all.
4) download openssl version 0.9.7b (I upgraded the SSL version on Windows
cause I couldn't get 0.9.6e to compile right)
5) Build open ssl on Windows following it's instructions.  The openssl
folder should be in the same folder as bind-9.2.2.  Your file structure
should resemble:
    /some upper folder
        |
        - bind -9.2.2
        - openssl-0.9.7b
        - dlz.patch

6) Open the bind-9.2.2/win32utils/BINDBuild.dsw file with visual studio.
7) select "file view" in the top left window, right click the "named"
project, and select "set as active project"
8) From the menu bar at the top select project->settings
9) Modify the project's c/c++ and link options as appropriate for what you
need:
    If you need just the file system driver add
    /D "DLZ" /D "DLZ_FILESYSTEM" where you see the other "/D" defines.

    This will build the DLZ core, and the file system driver.  This is the
easiest driver because it does not require any additional libraries.  Always
build the DLZ core /D "DLZ", Other defines for the other drivers are:
/D "DLZ_BDB" /D "DLZ_POSTGRES" /D "DLZ_MYSQL"  Only use the ones you need.

You will also have to follow the instructions for building the Win32
components of each of those other databases, and then also follow the
instructions for including the necessary headers and libraries in your build
for named.

I would create win32 binaries for download, but haven't because of a few
concerns.  First and foremost is the need for openssl to be compiled in.  I
live in the US so I am subject to encryption export laws.  I really don't
want to have the hassle of verifying people are allowed to download the
"encryption" capabilities built into the binary.

Also, DLZ now supports 4 database drivers, 3 of which require extra external
libraries.  Should I build DLZ with all the drivers, and include all the
libraries?, or do multiple builds with multiple combinations of driver
selections (YUCK).

To make it all "easy" for the end user to do I would have to modify Bind's
install program.  I haven't even looked at that yet (and really don't want
to)..  But it could be done.

So... After all that, try doing the build on Win32 if you can Ian.  If you
don't have the capabilities to do builds on Windows, then I can try looking
into what I can do to make win32 binaries available, but it's going to have
to wait a little while until the ODBC and LDAP drivers are both done.

Let me know how you do with it.

Later
Rob

----- Original Message -----
From: "Ian Tait" <ian.t <at> thoughtbubble.net>
To: <bind-dlz-testers <at> lists.sourceforge.net>
Sent: Sunday, May 04, 2003 9:35 AM
Subject: [Bind-dlz-testers] Win32 implementation yet?

> Hi,
>
> Has anyone the time to produce win32 (win2000) binaries as yet?
>
> Cheers,
>
> Ian
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Bind-dlz-testers mailing list
> Bind-dlz-testers <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Ian Tait | 4 May 2003 19:25

Re: Win32 implementation yet?

Hiya,

Thanks for the primer! I don't have Visual Studio, but I'll look into
getting it, and see how I get on.

Cheers,

Ian

----- Original Message -----
From: "Rob Butler" <robert.butler5 <at> verizon.net>
To: "Ian Tait" <ian.t <at> thoughtbubble.net>;
<bind-dlz-testers <at> lists.sourceforge.net>
Sent: Sunday, May 04, 2003 6:02 PM
Subject: Re: [Bind-dlz-testers] Win32 implementation yet?

> Ian,
>
> Binaries for Win32 are really easy. DLZ is actually developed on Win 2k,
and
> then tested on Redhat.  (I'm slowly migrating to a Linux environment, but
I
> am still more comfortable on Win 2k.)
>
> If you have Visual Studio & cygwin all you have to do is:
>
> 1) download bind-9.2.2 from www.isc.com
> 2) use winzip to decompress it.  (or if you have cygwin gunzip it, and
then
> tar -xvf it.)
> 3) apply the patch file (in cygwin patch -p0 < dlz.patch) Or perhaps you
can
> find a win32 version of Gnu Patch.  If you can, you don't need cygwin at
> all.
> 4) download openssl version 0.9.7b (I upgraded the SSL version on Windows
> cause I couldn't get 0.9.6e to compile right)
> 5) Build open ssl on Windows following it's instructions.  The openssl
> folder should be in the same folder as bind-9.2.2.  Your file structure
> should resemble:
>     /some upper folder
>         |
>         - bind -9.2.2
>         - openssl-0.9.7b
>         - dlz.patch
>
> 6) Open the bind-9.2.2/win32utils/BINDBuild.dsw file with visual studio.
> 7) select "file view" in the top left window, right click the "named"
> project, and select "set as active project"
> 8) From the menu bar at the top select project->settings
> 9) Modify the project's c/c++ and link options as appropriate for what you
> need:
>     If you need just the file system driver add
>     /D "DLZ" /D "DLZ_FILESYSTEM" where you see the other "/D" defines.
>
>     This will build the DLZ core, and the file system driver.  This is the
> easiest driver because it does not require any additional libraries.
Always
> build the DLZ core /D "DLZ", Other defines for the other drivers are:
> /D "DLZ_BDB" /D "DLZ_POSTGRES" /D "DLZ_MYSQL"  Only use the ones you need.
>
> You will also have to follow the instructions for building the Win32
> components of each of those other databases, and then also follow the
> instructions for including the necessary headers and libraries in your
build
> for named.
>
> I would create win32 binaries for download, but haven't because of a few
> concerns.  First and foremost is the need for openssl to be compiled in.
I
> live in the US so I am subject to encryption export laws.  I really don't
> want to have the hassle of verifying people are allowed to download the
> "encryption" capabilities built into the binary.
>
> Also, DLZ now supports 4 database drivers, 3 of which require extra
external
> libraries.  Should I build DLZ with all the drivers, and include all the
> libraries?, or do multiple builds with multiple combinations of driver
> selections (YUCK).
>
> To make it all "easy" for the end user to do I would have to modify Bind's
> install program.  I haven't even looked at that yet (and really don't want
> to)..  But it could be done.
>
> So... After all that, try doing the build on Win32 if you can Ian.  If you
> don't have the capabilities to do builds on Windows, then I can try
looking
> into what I can do to make win32 binaries available, but it's going to
have
> to wait a little while until the ODBC and LDAP drivers are both done.
>
> Let me know how you do with it.
>
> Later
> Rob
>
>
> ----- Original Message -----
> From: "Ian Tait" <ian.t <at> thoughtbubble.net>
> To: <bind-dlz-testers <at> lists.sourceforge.net>
> Sent: Sunday, May 04, 2003 9:35 AM
> Subject: [Bind-dlz-testers] Win32 implementation yet?
>
>
> > Hi,
> >
> > Has anyone the time to produce win32 (win2000) binaries as yet?
> >
> > Cheers,
> >
> > Ian
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Bind-dlz-testers mailing list
> > Bind-dlz-testers <at> lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Bind-dlz-testers mailing list
> Bind-dlz-testers <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers
>

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Joel Moss | 5 May 2003 11:32

Re: mysql driver unable to return result set for lookup query

I have tried executing those SQL statements and they return results fine.
dlz section as requested.
 
dlz "Mysql zone" {
        database "mysql
        {host=localhost dbname=dns user=root pass=am161197 ssl=false}
        {select id from zone where zone = '%zone%'}
        {select ttl, type, mx_priority, case when lower(type)='txt' then concat('\"', data, '\"') when lower(type)='soa' then CONCAT_WS (' ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end from zone z left join dns_records d on z.id=d.zone_id where zone = '%zone%' and host = '%record%'}
        {}
        {select ttl, type, host, mx_priority, case when lower(type) ='txt' then concat('\"', data, '\"') when lower(type)='soa' then CONCAT_WS (' ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end from zone z left join dns_records d on z.id=d.zone_id where zone = '%zone%' and host = '%record%'}
        {select id from zone where zone = '%zone%' and client = '%client%'}
        {}";
};
 
Thx,
Joel
 
 
----- Original Message -----
From: Rob Butler
Sent: Sunday, May 04, 2003 5:37 PM
Subject: Re: [Bind-dlz-testers] mysql driver unable to return result set for lookup query

Joel,
 
Please send a copy of the DLZ section of your named.conf file.  Also, try directly executing the SQL statements below against MySQL using MySQL manager or mysqlc.  If the queries don't work with those utilities the problem is in the query.  If the SQL statements do work with the utils, then the problem is probably in the named.conf file.  Also, be sure you don't put extra information in fields that are not needed for a particular DNS record type.  I.E. don't put anything in primary_ns, resp_person, serial, refresh, retry, expire, minimum, or mx_priority for an A record.
 
From your other e-mail:
 
>> I have started named as follows: "/usr/local/sbin/named -u named -g -d 2" so I can see what is happenning.  Now everytime a domain appears and a lookup is performed for it in the mysql database, another lookup for "com" is performed.  As follows:
 
>> May 04 05:50:49.395
Query String: select id from zone where zone = 'domain.com'
 
>> May 04 05:50:49.396
Query String: select id from zone where zone = 'com'
 
>>I don't suppose that is normal is it?
 
 
Yes, that is perfectly normal.  DLZ tries to match the longest "zone" in the database it can.  So, if you searched for "some.really.long.domain.name.com"  DLZ would search for:
 
select id from zone where zone = 'some.really.long.domain.name.com'
select id from zone where zone = 'really.long.domain.name.com'
select id from zone where zone = 'long.domain.name.com'
select id from zone where zone = 'domain.name.com'
select id from zone where zone = 'name.com'
select id from zone where zone = 'com'
 
if no matches to the zone name was found.  If however a match for the zone name is found, this query will stop, and then the lookup query will be executed.
 
Hope this helps out.
 
Later
Rob
 
----- Original Message -----
From: Joel Moss
Sent: Sunday, May 04, 2003 8:27 AM
Subject: [Bind-dlz-testers] mysql driver unable to return result set for lookup query

I have added a domain to my database and filled in all the records correctly.  However, when I run "host electnetworks.com" I get the following errors:
 
May 04 06:16:08.838
Query String: select ttl, type, mx_priority, case when lower(type)='txt' then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = '*'
 
May 04 06:16:08.838 mysql driver unable to return result set for lookup query
May 04 06:16:08.838
Query String: select ttl, type, mx_priority, case when lower(type)='txt' then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = ' <at> '
 
May 04 06:16:08.839 mysql driver unable to return result set for lookup query
May 04 06:16:08.839
Query String: select ttl, type, mx_priority, case when lower(type)='txt' then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = '*'
 
May 04 06:16:08.840 mysql driver unable to return result set for lookup query
Host electnetworks.com not found: 2(SERVFAIL)
 
Can anybody help?
Rob Butler | 6 May 2003 02:29
Picon

Re: mysql driver unable to return result set for lookup query

Joel,

The named.conf looks ok. (I think, nothing obviously wrong anyway)

Can you send a larger section of the log file?  If the section you sent is
the only error in the logs then things are really strange.  If you are
getting an error with the lookup query (as seen in the log section you
sent), but you are NOT getting an error in the findzone query I would think
something has got to be wrong in the lookup query, because both actually use
the same function mysql_get_resultset() in the driver to get data from the
database.

The only other thing that I can think of that may be wrong is your running
out of memory.  The MySQL driver uses the function mysql_store_result()
which causes all the rows to be returned, and stored in memory by named, so
they can be passed to the driver function mysql_process_rs without
interacting with MySQL again.  If your system is very low on memory, or if
your zone is very big, you could be running out of ram, and unable to
temporarily store the result set.

If your feeling adventurous, you can modify the code to get some more
information on the error.

Just do this, look around line 328 of the bin/named/dlz_mysql_driver.c file
and change:

  // output the full query string during debug so we can see
  // what lame error the query has.
 isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
       DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
       "\nQuery String: %s\n", querystring);

  // attempt query up to 3 times.
 for(i=0; i < 3; i++){
  qres = mysql_query((MYSQL *) dbi->dbconn, querystring);
  if(qres == 0)
   break;
  for(j=0; mysql_ping((MYSQL *) dbi->dbconn) != 0 && j < 4; j++);
 }

To:
  // output the full query string during debug so we can see
  // what lame error the query has.
 isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
       DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
       "\nQuery String: %s\n", querystring);

  // attempt query up to 3 times.
 for(i=0; i < 3; i++){
  qres = mysql_query((MYSQL *) dbi->dbconn, querystring);
 isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,    // this line added
       DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),             // this line added
       "\nMySQL_query returned: %d\n", qres);
// this line added
  if(qres == 0)
   break;
  for(j=0; mysql_ping((MYSQL *) dbi->dbconn) != 0 && j < 4; j++);
 }

Then,

Make clean
./configure --whatever config parameters you had last time
make
make install
and execute named again.  This time we will see the code returned by MySQL,
and can see if the query worked.  If the query worked, but the lookup still
fails that means that the query results were too large and could not
allocate enough ram to hold the result set.

If this is the case, how much ram do you have on the system, how much is
available, and how many rows are returned by your lookup query when you
execute it using the MySQL utils?

We will get to the bottom of this, even if I have to log into your box to
solve the problem!  (assuming of course that you would want me to do that)..

Or, you could switch over to Postgres instead of MySQL!

Later
Rob
----- Original Message -----
From: "Joel Moss" <joel <at> joelmoss.info>
To: "Rob Butler" <robert.butler5 <at> verizon.net>
Sent: Monday, May 05, 2003 5:37 PM
Subject: Re: Re: [Bind-dlz-testers] mysql driver unable to return result set
for lookup query

> Did you see anything wrong with the named.conf?  Can you help?

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Joel Moss | 6 May 2003 09:24

Re: mysql driver unable to return result set for lookup query

Ok, I rebuilt bind with the extra lines that you suggested.  It started up
and I ran the command with the following results.  From the first few lines,
it looks to me as if it simply cannot find the domain in the database as it
returns a 0 result.  Yet I can run those very same SQL statements directly
against the database and they work with the proper results.

[root <at> maill bind-9.2.1]# host electnetworks.com
May 06 01:12:47.710
Query String: select id from zone where zone = 'electnetworks.com'

May 06 01:12:47.712
MySQL_query returned: 0

May 06 01:12:47.712
Query String: select ttl, type, mx_priority, case when lower(type)='txt'
then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end
from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = ' <at> '

May 06 01:12:47.712
MySQL_query returned: -1

May 06 01:12:47.713
MySQL_query returned: -1

May 06 01:12:47.713
MySQL_query returned: -1

May 06 01:12:47.713 mysql driver unable to return result set for lookup
query
May 06 01:12:47.713
Query String: select ttl, type, mx_priority, case when lower(type)='txt'
then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end
from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = '*'

May 06 01:12:47.714
MySQL_query returned: -1

May 06 01:12:47.714
MySQL_query returned: -1

May 06 01:12:47.714
MySQL_query returned: -1

May 06 01:12:47.715 mysql driver unable to return result set for lookup
query
May 06 01:12:47.715
Query String: select ttl, type, mx_priority, case when lower(type)='txt'
then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end
from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = ' <at> '

May 06 01:12:47.715
MySQL_query returned: -1

May 06 01:12:47.715
MySQL_query returned: -1

May 06 01:12:47.716
MySQL_query returned: -1

May 06 01:12:47.716 mysql driver unable to return result set for lookup
query
May 06 01:12:47.716
Query String: select ttl, type, mx_priority, case when lower(type)='txt'
then concat('"', data, '"') when lower(type)='soa' then CONCAT_WS ('
 ',primary_ns,resp_person,serial,refresh,retry,expire,minimum) else data end
from zone z left join dns_records d on z.id=d.zone_id where zone
 = 'electnetworks.com' and host = '*'

May 06 01:12:47.716
MySQL_query returned: -1

May 06 01:12:47.717
MySQL_query returned: -1

May 06 01:12:47.717
MySQL_query returned: -1

May 06 01:12:47.717 mysql driver unable to return result set for lookup
query
Host electnetworks.com not found: 2(SERVFAIL)

Thx, Joel

----- Original Message ----- 
From: "Rob Butler" <robert.butler5 <at> verizon.net>
To: "Joel Moss" <joel <at> joelmoss.info>;
<bind-dlz-testers <at> lists.sourceforge.net>
Sent: Tuesday, May 06, 2003 1:29 AM
Subject: Re: [Bind-dlz-testers] mysql driver unable to return result set for
lookup query

> Joel,
>
> The named.conf looks ok. (I think, nothing obviously wrong anyway)
>
> Can you send a larger section of the log file?  If the section you sent is
> the only error in the logs then things are really strange.  If you are
> getting an error with the lookup query (as seen in the log section you
> sent), but you are NOT getting an error in the findzone query I would
think
> something has got to be wrong in the lookup query, because both actually
use
> the same function mysql_get_resultset() in the driver to get data from the
> database.
>
> The only other thing that I can think of that may be wrong is your running
> out of memory.  The MySQL driver uses the function mysql_store_result()
> which causes all the rows to be returned, and stored in memory by named,
so
> they can be passed to the driver function mysql_process_rs without
> interacting with MySQL again.  If your system is very low on memory, or if
> your zone is very big, you could be running out of ram, and unable to
> temporarily store the result set.
>
> If your feeling adventurous, you can modify the code to get some more
> information on the error.
>
> Just do this, look around line 328 of the bin/named/dlz_mysql_driver.c
file
> and change:
>
>   // output the full query string during debug so we can see
>   // what lame error the query has.
>  isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
>        DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
>        "\nQuery String: %s\n", querystring);
>
>   // attempt query up to 3 times.
>  for(i=0; i < 3; i++){
>   qres = mysql_query((MYSQL *) dbi->dbconn, querystring);
>   if(qres == 0)
>    break;
>   for(j=0; mysql_ping((MYSQL *) dbi->dbconn) != 0 && j < 4; j++);
>  }
>
>
> To:
>   // output the full query string during debug so we can see
>   // what lame error the query has.
>  isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
>        DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),
>        "\nQuery String: %s\n", querystring);
>
>   // attempt query up to 3 times.
>  for(i=0; i < 3; i++){
>   qres = mysql_query((MYSQL *) dbi->dbconn, querystring);
>  isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,    // this line added
>        DNS_LOGMODULE_DLZ, ISC_LOG_DEBUG(1),             // this line added
>        "\nMySQL_query returned: %d\n", qres);
> // this line added
>   if(qres == 0)
>    break;
>   for(j=0; mysql_ping((MYSQL *) dbi->dbconn) != 0 && j < 4; j++);
>  }
>
> Then,
>
> Make clean
> ./configure --whatever config parameters you had last time
> make
> make install
> and execute named again.  This time we will see the code returned by
MySQL,
> and can see if the query worked.  If the query worked, but the lookup
still
> fails that means that the query results were too large and could not
> allocate enough ram to hold the result set.
>
> If this is the case, how much ram do you have on the system, how much is
> available, and how many rows are returned by your lookup query when you
> execute it using the MySQL utils?
>
> We will get to the bottom of this, even if I have to log into your box to
> solve the problem!  (assuming of course that you would want me to do
that)..
>
> Or, you could switch over to Postgres instead of MySQL!
>
> Later
> Rob
> ----- Original Message -----
> From: "Joel Moss" <joel <at> joelmoss.info>
> To: "Rob Butler" <robert.butler5 <at> verizon.net>
> Sent: Monday, May 05, 2003 5:37 PM
> Subject: Re: Re: [Bind-dlz-testers] mysql driver unable to return result
set
> for lookup query
>
> > Did you see anything wrong with the named.conf?  Can you help?
>
>

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

Gmane