2 messages in com.mysql.lists.pluspluscore dump in mysql_bind_param (versio...| From | Sent On | Attachments |
|---|---|---|
| Kevin Cowley | 27 Apr 2004 02:26 | |
| Sinisa Milivojevic | 03 May 2004 04:46 |
| 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/27/2004 02:26:34 AM |
| List: | com.mysql.lists.plusplus |
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
************************************************************************************** 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. **************************************************************************************




