program output
--------
INSERT INTO wfr_map (filename, facility, lot, wafer, repeat_cnt, dte, tme, prog, product, type, prober, tester, probecard,loadboard, operator, temp, fail_cnt, pass_cnt, d_chips, tot_cnt,yield, neff,flat, b_mode, test_var, w_pass,npar,msg,map_type_id,archive) VALUES('/data/thx1/inbox/4296381_4.001','XTex6','4296381 ','04',' 0','2004-12-13','23:31:48','Z512X ','Z5127 ','ZZ86129EA ',' 1868 ','219 ','15001-02 ',NULL,'9269 ',-32000,0,0,0,0,0,0,'S',0,' ',1,95,'PT',2,0)
Could not execute query!
ERROR: 1064(You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'lot, wafer, repeat_cnt,filename from wfr_map' at line 1)

Darrell:

Note that MySQL is attempting to parse something that you do not seem to have in your query. I believe what is happening is that you are overwriting some buffer somewhere (possibly in the sprintf() call), and then end up sending garbage to mysql_query(). Instead of using sprintf(), I would recommend either a manual construction of the string with calls to mysql_real_escape_string(), or something like myvsprintf(), which you can find at

http://mysql.he.net/Downloads/Contrib/mysnprintf.c

or any other MySQL mirror.

The problem with sprintf() is that it does not check buffer boundaries, and does not escape the strings. snprintf() will check the boundaries, but you would have to do the escaping yourself. mysnprintf() will do both for you.

If sprintf() fix/check does not help, get valgrind from http://valgrind.kde.org/ ( or use your favorite memory error detection tool), and see what it says.

--
Sasha Pachev
Create online surveys at http://www.surveyz.com/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to