Re: EMBEDDED BUG?!?!?!?

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: Lynn(dot)Tilby(at)asu(dot)edu
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: EMBEDDED BUG?!?!?!?
Date: 2003-10-31 19:50:54
Message-ID: 20031031195054.GA5984@feivel.fam-meskes.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Oct 27, 2003 at 06:25:46PM -0700, Lynn(dot)Tilby(at)asu(dot)edu wrote:
> [postgres(at)polaris pgsql]$ postmaster -V
> postmaster (PostgreSQL) 7.1.3

This is pretty old already.

> EXEC SQL FETCH stck_info_crsr INTO :i_symbol :i_data_date, :i_open, :i_high,
> :i_low, :i_close, :i_volume;

If this is taken literally from your program be aware that it cannot
work as there is no "," between ":i_symbol" and ":i_data_date" thus the
latter is considered an indicator.

> when executing the fetch I get:
>
> sqlcaid = SQLCA
> sqlabc = 4.642502
> sqlcode = 4.642506
> sqlca.sqlerrm.sqlerrml = 49
> sqlca.sqlerrm.sqlerrmc = Not correctly formatted int type: 29.25 line 500.

Okay, it seems you did use the line above and try to read a real value
into an int.

> BEFORE ** A 6 20020102.000000 28.510000 29.340000 28.459999 0
> SYMBOL ** 'A '
> D_DATE ** '0'
> i_open ** '20020102.000000'
> VOLUME ** '0'
>
> The BEFORE, SYMBOL, D_DATE, i_open, VOLUME are from simple printf's.

This is utterly useless unless you provide the sources so we can see
what you actually printf.

> Apparently postgres is misreading the declaration of i_symbol and
> loading part of the declaration into the actual value of the data!!!!

Nope. The "6" comes beyond the limit of the variable. The string simply
seems to lack the delimitting \0.

> The folks who do embedded stuff need to take a look at this!!!!!!

They just did. They even used their spare time to create a test case
themselves as you did only provide code snippets.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes(at)jabber(dot)org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dann Corbit 2003-10-31 19:51:38 Re: INSERT performance
Previous Message Fernando Schapachnik 2003-10-31 19:36:48 Re: help from Portugal