Bug #21396 Wrong error number generated for a missing table: 1017 vs 1146
Submitted: 1 Aug 2006 17:04 Modified: 15 Aug 2006 3:15
Reporter: Joerg Bruehe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S1 (Critical)
Version:5.0.24 OS:Microsoft Windows (Windows 2003 AMD64)
Assigned to: Georg Richter CPU Architecture:Any

[1 Aug 2006 17:04] Joerg Bruehe
Description:
Release build of 5.0.24 on Windows x64.
Where all other platforms report 
   1146   Table ___ doesn't exist
this build reports
   1017   Can't find file: ___ (errno: 9)

The effect occurs in many tests (list below), is best visible here:

-------------------------------------------------------
--- r/rpl_failed_optimize.result
+++ r/rpl_failed_optimize.reject
@@ -15,7 +15,7 @@
 Error  1205    Lock wait timeout exceeded; try restarting transaction
 OPTIMIZE TABLE non_existing;
 Table  Op      Msg_type        Msg_text
-test.non_existing      optimize        error   Table 'test.non_existing' doesn't exist
+test.non_existing      optimize        error   Can't find file: './test/non_existing.frm' (errno: 9)
 Warnings:
-Error  1146    Table 'test.non_existing' doesn't exist
+Error  1017    Can't find file: './test/non_existing.frm' (errno: 9)
 drop table t1;
-------------------------------------------------------

This is not caused by replication, see here:

-------------------------------------------------------
--- r/myisam.result
+++ r/myisam.reject
@@ -527,21 +527,21 @@
 test.t2        NULL
 test.t3        NULL
 Warnings:
-Error  1146    Table 'test.t3' doesn't exist
+Error  1017    Can't find file: './test/t3.frm' (errno: 9)
 checksum table t1, t2, t3;
 Table  Checksum
 test.t1        2948697075
 test.t2        2948697075
 test.t3        NULL
 Warnings:
-Error  1146    Table 'test.t3' doesn't exist
+Error  1017    Can't find file: './test/t3.frm' (errno: 9)
 checksum table t1, t2, t3 extended;
 Table  Checksum
 test.t1        2948697075
 test.t2        2948697075
 test.t3        NULL
 Warnings:
-Error  1146    Table 'test.t3' doesn't exist
+Error  1017    Can't find file: './test/t3.frm' (errno: 9)
 drop table t1,t2;
 create table t1 (a int, key (a));
 show keys from t1;
-------------------------------------------------------

Another symptom of the same number difference is this style:

=====
create_select_tmp              [ fail ]

Errors are (from C:/cygwin/home/mysqldev/build/mysql-5.0.24-build-x64/mysql-5.0.24/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 17: query 'select * from t2' failed with wrong errno 1017: 'Can't find file: './test/t2.frm' (errno: 9)', instead of 1146...
(the last lines may be the most important ones)
Result from queries before failure can be found in r/create_select_tmp.log
=====

Yet another way:

-------------------------------------------------------
--- r/rpl000009.result
+++ r/rpl000009.reject
@@ -132,7 +132,7 @@
 drop table mysqltest.t1;
 load table mysqltest.t1 from master;
 load table bar.t1 from master;
-ERROR HY000: Error from master: 'Table 'bar.t1' doesn't exist'
+ERROR HY000: Error from master: 'Can't find file: '.\bar\t1.frm' (errno: 9)'
 drop database mysqltest;
 drop database mysqltest2;
 drop database mysqltest2;
-------------------------------------------------------

List of affected test cases:
create, create_select_tmp, 
errors, 
federated, 
handler, 
innodb, 
lock_multi, 
myisam, 
preload, ps_1general, ps, ps_grant, 
query_cache, 
repair, rpl000009, rpl_ddl, rpl_delete_all, rpl_empty_master_crash, rpl_failed_optimize, rpl_multi_delete2, rpl_replicate_do, rpl_view, 
sp, sp-error, sql_mode, subselect, 
trigger, truncate, 
view, view_query_cache.

How to repeat:
Run the test suite on win2003-amd64.
[2 Aug 2006 6:03] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/9923

ChangeSet@1.2229, 2006-08-02 07:59:03+02:00, georg@lmy002.wdf.sap.corp +1 -0
  Bug #21396: Wrong error number generated for a missing table: 1017 vs 114
[2 Aug 2006 8:04] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/9927

ChangeSet@1.2229, 2006-08-02 10:00:28+02:00, georg@lmy002.wdf.sap.corp +2 -0
  Bug #21396: Wrong error number generated for a missing table
[2 Aug 2006 18:19] Paul Dubois
Noted in 5.0.25 changelog.

On 64-bit Windows, a missing table generated error 1017,
not the correct value of 1146.
[15 Aug 2006 3:15] Paul Dubois
Noted in 5.1.12 changelog.