Re: mysql driver unable to return result set for lookup query
Joel Moss <joel <at> joelmoss.info>
2003-05-06 07:24:04 GMT
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