Обсуждение: psql and \do

Поиск
Список
Период
Сортировка

psql and \do

От
Bruce Momjian
Дата:
I am getting an crash on psql \do when assert checking is enabled.  The
problem is in cost_seqscan() where temp is now > 0.

Not sure on the cause yet.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] psql and \do

От
Bruce Momjian
Дата:
> I am getting an crash on psql \do when assert checking is enabled.  The
> problem is in cost_seqscan() where temp is not > 0.
> 
> Not sure on the cause yet.

I have cleaned up some areas, but now cost_index() is getting that
problem with temp as NaN because it has exceeded it's range or something
strange like that.

Does psql \do work on stock 6.5?

Here is the weird part.  This is with no optimization, and of course the
assert at the end fails on the test temp >= 0.    Breakpoint 1, cost_index (indexid=17033,
expected_indexpages=137251568,    selec=0.00877192989, relpages=2, reltuples=114, indexpages=2,     indextuples=114,
is_injoin=1'\001') at costsize.c:132132             Cost            temp = 0;(gdb) n134             if
(!_enable_indexscan_&& !is_injoin)(gdb) 142             if (expected_indexpages <= 0)(gdb) 144             if
(indextuples<= 0)(gdb) print temp$1 = 0(gdb) n148             temp += expected_indexpages;(gdb) print temp$2 = 0(gdb)
n156            temp += ceil(((double) selec) * ((double) relpages));(gdb) print temp$3 = -NaN(0x400000)(gdb) print
expected_indexpages$4= 137251568
 

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] psql and \do

От
Bruce Momjian
Дата:
> I am getting an crash on psql \do when assert checking is enabled.  The
> problem is in cost_seqscan() where temp is now > 0.
> 
> Not sure on the cause yet.

Let me ask specifically.  With assert checking enabled, does \do crash
psql in 6.5?

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] psql and \do

От
Tom Lane
Дата:
Bruce Momjian <maillist@candle.pha.pa.us> writes:
>> I am getting an crash on psql \do when assert checking is enabled.  The
>> problem is in cost_seqscan() where temp is now > 0.

> Let me ask specifically.  With assert checking enabled, does \do crash
> psql in 6.5?

Works for me, with sources from about 30 June.  Someone's broken
something since then, perhaps.
        regards, tom lane


Re: [HACKERS] psql and \do

От
Bruce Momjian
Дата:
> > I am getting an crash on psql \do when assert checking is enabled.  The
> > problem is in cost_seqscan() where temp is now > 0.
> > 
> > Not sure on the cause yet.
> 
> Let me ask specifically.  With assert checking enabled, does \do crash
> psql in 6.5?
> 

OK, fixed.  The call to ceil() in plancat.c did not have a prototype, so
it thought ceil() returned an int, so it caused an invalid float value
that was only caught later on in cost_index().

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: [HACKERS] psql and \do

От
Bruce Momjian
Дата:
> Bruce Momjian <maillist@candle.pha.pa.us> writes:
> >> I am getting an crash on psql \do when assert checking is enabled.  The
> >> problem is in cost_seqscan() where temp is now > 0.
> 
> > Let me ask specifically.  With assert checking enabled, does \do crash
> > psql in 6.5?
> 
> Works for me, with sources from about 30 June.  Someone's broken
> something since then, perhaps.

I have fixed it.  It was a call to ceil() without a prototype, causing
invalid float value that was only caught later.  Not sure why it was not
showing up earlier.


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026