little libmysql-bug (mysql_fetch_field)

little libmysql-bug (mysql_fetch_field)

am 01.12.2002 20:27:20 von Georg Richter

Hi all,

there is a little bug in libmysql:
field->table is NULL

affected versions: 3.23,4.0, 4.1

how-to-repeat:


strcpy(query, "select sin(a) from t04");
mysql_real_query(mysql, query, strlen(query));
res = mysql_store_result(mysql);
field = mysql_fetch_field(res);


with "select a from t04" it's ok



Regards

Georg

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13176@lists.mysql.com
To unsubscribe, e-mail

Re: little libmysql-bug (mysql_fetch_field)

am 03.12.2002 04:58:55 von Venu

On Sun, 2002-12-01 at 11:27, Georg Richter wrote:
> Hi all,
>
> there is a little bug in libmysql:
> field->table is NULL
>
> affected versions: 3.23,4.0, 4.1
>
> how-to-repeat:
>
>
> strcpy(query, "select sin(a) from t04");
> mysql_real_query(mysql, query, strlen(query));
> res = mysql_store_result(mysql);
> field = mysql_fetch_field(res);
>

>
> with "select a from t04" it's ok
>

Actually its not a bug. And Monty confirmed that we can't return
complete field information for the expressions and/functions; except the
name of the expression (nothing but the complete expression).

For example, if you consider

SELECT 1 FROM table

where in one can't expect the table name/other members from FIELD;
similarly it holds true for all expressions/functions LIKE SIN,
DATE_FORMAT, ..

On the other hand, the FIELD will have complete information only if it
is a pure column spec/list.

Thanks

--
Regards, Venu
For technical support contracts, go to https://order.mysql.com
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Venu
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Developer
/_/ /_/\_, /___/\___\_\___/ Palo Alto, CA-94306, USA
<___/ www.mysql.com


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13192@lists.mysql.com
To unsubscribe, e-mail