core dump in mysql_bind_param (versions 4.1.1-alpha, 5.0.0-alpha, 4.1.2-alpha-nightly)

core dump in mysql_bind_param (versions 4.1.1-alpha, 5.0.0-alpha, 4.1.2-alpha-nightly)

am 28.04.2004 11:42:36 von Kevin Cowley

>Description:

Since I've got no response elsewhere then I'll try the bugs list
I'm getting a core dump in mysql_bind_params which I need help in
identifying why. The manual is no use as the 4.1.1 API actual quotes the (as
yet) unimplemented 5.0.0 interface which is not what is currently in the
4.1.1-alpha 4.1.2-apha-nightly or 5.0.0-alpha sources.


>How-To-Repeat:
Run the following code block
Begin code Block

sprintf(query,"INSERT INTO ssa_keys
(urn,key_address,addr_part1,addr_part2,postcode) Values(?,?,?,?,?)");
if ((stmt=mysql_prepare(conn,query, strlen(query))==NULL))
{
fprintf(stderr,
"mysql_stmt_prepare error with \"%s\": %s",
query, mysql_stmt_error(stmt));
return EXIT_SQL_FAIL;
}
/* bind the data buffers */

/* urn */
bind_vars[BIND_IV1_URN].buffer_type=MYSQL_TYPE_LONG;
bind_vars[BIND_IV1_URN].buffer=(char *)&vUrnField;
bind_vars[BIND_IV1_URN].is_null=0;
/* key_address */
bind_vars[BIND_IV1_KEY].buffer_type=MYSQL_TYPE_STRING;
bind_vars[BIND_IV1_KEY].buffer=bfKeyField;
bind_vars[BIND_IV1_KEY].buffer_length=szKeyField;
bind_vars[BIND_IV1_KEY].is_null=0;
bind_vars[BIND_IV1_KEY].length=&lnKeyField;
/* addr_part1 */
bind_vars[BIND_IV1_ADDR1].buffer_type=MYSQL_TYPE_STRING;
bind_vars[BIND_IV1_ADDR1].buffer=bfAddr1Field;
bind_vars[BIND_IV1_ADDR1].buffer_length=szAddr1Field;
bind_vars[BIND_IV1_ADDR1].is_null=&is_addr1_null;
bind_vars[BIND_IV1_ADDR1].length=&lnAddr1Field;
/* addr_part2 */
bind_vars[BIND_IV1_ADDR2].buffer_type=MYSQL_TYPE_STRING;
bind_vars[BIND_IV1_ADDR2].buffer=bfAddr2Field;
bind_vars[BIND_IV1_ADDR2].buffer_length=szAddr2Field;
bind_vars[BIND_IV1_ADDR2].is_null=&is_addr2_null;
bind_vars[BIND_IV1_ADDR2].length=&lnAddr2Field;
/* postcode */
bind_vars[BIND_IV1_PCODE].buffer_type=MYSQL_TYPE_STRING;
bind_vars[BIND_IV1_PCODE].buffer=bfPcodeField;
bind_vars[BIND_IV1_PCODE].buffer_length=szPcodeField;
bind_vars[BIND_IV1_PCODE].is_null=&is_pcode_null;
bind_vars[BIND_IV1_PCODE].length=&lnPcodeField;

if (mysql_bind_param(stmt,bind_vars))
{
fprintf(stderr,
"mysql_stmt_bind_param error: %s", mysql_stmt_error(stmt));
return EXIT_SQL_FAIL;
}

End code block

Prior to this I use a standard query as follows to create the tables with no
problems

create table ssa_keys(urn int unsigned not null, key_address binary(8) not
null, addr_part1 char(40) null, addr_part2 char(40) null, postcode char(8)
null);

A standard insert query works without problems but we want to convert this
to parsed/compiled query for speed.
>Fix:
Unknown - If I knew why bind wasn't working I might be able to suggest one.

>Submitter-Id:
>Originator:
>Organization:

>MySQL support: none
>Synopsis: core dump in mysql_bind_param (versions 4.1.1-alpha,
5.0.0-alpha, 4.1.2-alpha-nightly)
>Severity: critical
>Priority: high
>Category: mysql
>Class: sw-bug
>Release: mysql-4.1.1-alpha (Source distribution) / mysql-5.0.0-alpha
(Source distribution)/ mysql-4.1.2-alpha-nightly (Source distribution)
>Server: /alchroot/mysql-4.1.1/bin/mysqladmin Ver 8.40 Distrib 4.1.1-alpha,
for pc-linux on i686
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version 4.1.1-alpha-log
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /tmp/mysql-4.1.1.sock
Uptime: 11 days 15 hours 28 min 56 sec

Threads: 1 Questions: 1124560319 Slow queries: 468 Opens: 250 Flush
tables: 1 Open tables: 12 Queries per second avg: 1117.702
>C compiler: gcc (GCC) 3.2.2
>C++ compiler: g++ (GCC) 3.2.2
>Environment:

System: Linux linpo 2.4.19-64GB-SMP #1 SMP Mon Aug 4 23:48:22 UTC 2003 i686
unknown
Architecture: i686

Some paths: /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc
/usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i486-suse-linux/3.2.2/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib
--enable-languages=c,c++,f77,objc,java,ada --enable-libgcj
--with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib
--with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linux
Thread model: posix
gcc version 3.2.2
Compilation info: CC='gcc' CFLAGS='' CXX='g++' CXXFLAGS='' LDFLAGS=''
ASFLAGS=''
LIBC:
-rwxr-xr-x 1 root root 1325063 2003-04-02 21:08 /lib/libc.so.6
-rw-r--r-- 1 root root 23181700 2003-04-02 20:58 /usr/lib/libc.a
-rw-r--r-- 1 root root 178 2003-04-02 20:58 /usr/lib/libc.so
-rw-r--r-- 1 root root 896350 2002-10-21 17:26
/usr/lib/libc-client.a
lrwxrwxrwx 1 root root 20 2003-10-02 12:14
/usr/lib/libc-client.so -> libc-client.so.2001a
-rwxr-xr-x 1 root root 735696 2002-10-21 17:26
/usr/lib/libc-client.so.2001a
Configure command: ./configure '--prefix=/alchroot/mysql-4.1.1'
'--with-tcp-port=4306' '--with-unix-socket_path=/tmp/mysql-4.1.1.sock'

Kevin Cowley
R&D

Tel: 0118 902 9099 (direct line)
Email: kevin.cowley@alchemetrics.co.uk
Web: http://www.alchemetrics.co.uk



************************************************************ **************************
ALCHEMETRICS LIMITED (ALCHEMETRICS)
Mulberry Park, Fishponds Road, Wokingham, Berkshire, RG41 2GX
Tel: +44 (0) 118 902 9000 Fax: +44 (0) 118 902 9001
This e-mail is confidential and is intended for the use of the addressee only.
If you are not the intended recipient, you are hereby notified that you must
not use, copy, disclose, otherwise disseminate or take any action based on
this e-mail or any information herein.
If you receive this transmission in error, please notify the sender
immediately by reply e-mail or by using the contact details above and then
delete this e-mail.
Please note that e-mail may be susceptible to data corruption, interception
and unauthorised amendment. Alchemetrics does not accept any liability for
any such corruption, interception, amendment or the consequences thereof.
************************************************************ **************************


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: core dump in mysql_bind_param (versions 4.1.1-alpha, 5.0.0-alpha,4.1.2-alpha-nightly)

am 28.04.2004 19:09:37 von Dean Ellis

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kevin,

> Since I've got no response elsewhere then I'll try the bugs list I'm
> getting a core dump in mysql_bind_params which I need help in
> identifying why

Please send a complete test case; it may be that the problem is actually
outside the code block you provided, so having the full case will make
identifying that much easier.

> The manual is no use as the 4.1.1 API actual quotes the (as yet)
> unimplemented 5.0.0 interface which is not what is currently in the
> 4.1.1-alpha 4.1.2-apha-nightly or 5.0.0-alpha sources.

The manual refers to the current 4.1.2 C API. A recent snapshot (and
the BitKeeper repository) would reflect this as well. If you mean
something else, please let me know.

Best regards,
- --
Dean Ellis, Support Engineer & Software Developer
MySQL AB, www.mysql.com

Are you MySQL certified? http://www.mysql.com/certification
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAj+VRAebV/bGJ5NERAlFqAJ0fAk+sut0r3Qvg/fdX2QyHdrImhwCf TDq1
y0/oDUKt4zXSUHeNaEN6dRk=
=cccd
-----END PGP SIGNATURE-----

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org