2 messages in com.mysql.lists.plusplusRe: core dump in mysql_bind_param (ve...| From | Sent On | Attachments |
|---|---|---|
| Kevin Cowley | 27 Apr 2004 02:26 | |
| Sinisa Milivojevic | 03 May 2004 04:46 |
| Subject: | Re: core dump in mysql_bind_param (versions 4.1.1-alpha, 5.0.0-alpha, 4.1.2-alpha-nightly)![]() |
|---|---|
| From: | Sinisa Milivojevic (sin...@mysql.com) |
| Date: | 05/03/2004 04:46:54 AM |
| List: | com.mysql.lists.plusplus |
Kevin Cowley wrote:
I'm not sure if this is the right list to post this to as this is a C problem and not a C++ problem and nobody on the general list has bothered to reply there.
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.
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.
We're running on SLES8 using gcc 3.2.2
Kevin Cowley R&D
Tel: 0118 902 9099 (direct line) Email: kevi...@alchemetrics.co.uk Web: http://www.alchemetrics.co.uk
No, this is not the right list for such issue.
You should send mails like the above one to general or bugs list.
However, the above bug is already fixed and fix will come in 4.1.2, which should be out in few weeks.
--
Sincerely,
-- For technical support contracts, go to https://order.mysql.com/?ref=msmi __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <sin...@mysql.com> / /|_/ / // /\ \/ /_/ / /__ MySQL AB /_/ /_/\_, /___/\___\_\___/ Full time Developer and Support Coordinator <___/ www.mysql.com Larnaca, Cyprus




