MySQL Forums
Forum List  »  Newbie

Re: mysql_query returns 1 but mysql_errno is 0
Posted by: Calin Dorohoi
Date: September 13, 2014 01:12PM

Happens with InnoDB too.

Meanwhile I tried setting concurrent_insert to 0 (disables concurrent inserts as per official MySQl documentation) in my.ini. No difference.

OK, Rick James' answer made me think I was too vague. Here are 2 actual examples of what happens. The results are from a run with InnoDB engine.
(the sha256, sha1 and md5 colums are defined as UNIQUE)


Thread 0: INSERT INTO main_db.main_tbl (sha256, sha1, md5, created, modified, size, ext, path, orig_path) VALUES
('E9ABACB9501875EF954BA9A32DC13A772458DAF7A86AA8B57C34ECF29B7ECEA4', '348DF1708D506E3E2DD172C191AB51E96E78976C', '1E7CC2F8AC0950C34A2A3285635DFE99', FROM_UNIXTIME(1363339456), FROM_UNIXTIME(1159421402), 211441, 'PNG', '...', '...')

...

Thread 0: INSERT INTO main_db.main_tbl (sha256, sha1, md5, created, modified, size, ext, path, orig_path) VALUES
('E9ABACB9501875EF954BA9A32DC13A772458DAF7A86AA8B57C34ECF29B7ECEA4', '348DF1708D506E3E2DD172C191AB51E96E78976C', '1E7CC2F8AC0950C34A2A3285635DFE99', FROM_UNIXTIME(1363339457), FROM_UNIXTIME(1159475402), 211441, 'PNG', '...', '...')
Query returned 1 but errno is 0




2nd example:
Thread 0: INSERT INTO main_db.main_tbl (sha256, sha1, md5, created, modified, size, ext, path, orig_path) VALUES
('EF67B758B221755EA2BA2BDEE4BD062832E77833FAE08CEF9113BFB96F2599BD', '004B55023FC3D7984C693D035075BBD581401143', 'F9A8F04D57346B7673305CFC1575FF6E', FROM_UNIXTIME(1247537030), FROM_UNIXTIME(1247531680), 291294, 'dat', '...', '...')

...

Thread 1: INSERT INTO main_db.main_tbl (sha256, sha1, md5, created, modified, size, ext, path, orig_path) VALUES
('EF67B758B221755EA2BA2BDEE4BD062832E77833FAE08CEF9113BFB96F2599BD', '004B55023FC3D7984C693D035075BBD581401143', 'F9A8F04D57346B7673305CFC1575FF6E', FROM_UNIXTIME(1247537030), FROM_UNIXTIME(1247531680), 291294, 'dat', '...', '...')
Query returned 1 but errno is 0




Another example showing that it's erratic (the wrong return value for mysql_errno only occurs after a few inserts):

Thread 0): INSERT INTO main_db.main_tbl (sha256, sha1, md5, created, modified, size, ext, path, orig_path) VALUES ('D4E844561...
Thread 1): INSERT INTO main_db.main_tbl (sha256, sha1, md5, created, modified, size, ext, path, orig_path) VALUES ('D4E844561...
Thread 3): INSERT INTO main_db.main_tbl (sha256, sha1, md5, created, modified, size, ext, path, orig_path) VALUES ('D4E844561...
Thread 2): INSERT INTO main_db.main_tbl (sha256, sha1, md5, created, modified, size, ext, path, orig_path) VALUES ('D4E844561...
Thread 0): INSERT INTO main_db.main_tbl (sha256, sha1, md5, created, modified, size, ext, path, orig_path) VALUES ('D4E844561...
Thread 1): INSERT INTO main_db.main_tbl (sha256, sha1, md5, created, modified, size, ext, path, orig_path) VALUES ('D4E844561...
Thread 3): INSERT INTO main_db.main_tbl (sha256, sha1, md5, created, modified, size, ext, path, orig_path) VALUES ('D4E844561...
Query returned 1 but errno is 0

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.