2 messages in com.mysql.lists.bugscore dump in mysql_bind_param (versio...
FromSent OnAttachments
Kevin Cowley28 Apr 2004 02:42 
Dean Ellis28 Apr 2004 10:09 
Subject:core dump in mysql_bind_param (versions 4.1.1-alpha, 5.0.0-alpha, 4.1.2-alpha-nightly)
From:Kevin Cowley (kevi@alchemetrics.co.uk)
Date:04/28/2004 02:42:14 AM
List:com.mysql.lists.bugs

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: <submitter ID> Originator: Organization: <organization of PR author (multiple lines)> 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:

<machine, os, target, libraries (multiple lines)> 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'