summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-05-09 11:28:57 -0700
committerunknown <jimw@mysql.com>2005-05-09 11:28:57 -0700
commita891ab1155d9f43619646d8d0b81c4549b3a73cf (patch)
treea4603694762ae0cf75989b6945f09c60343b9379 /sql/table.cc
parent2279889cc3a34842660c3b38dfc8dcbebf3cd3f2 (diff)
parent577b291895a961a918c09a217ca15bf9e230ad5a (diff)
downloadmariadb-git-a891ab1155d9f43619646d8d0b81c4549b3a73cf.tar.gz
Merge
include/my_global.h: Auto merged mysql-test/r/ctype_utf8.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/t/select.test: Auto merged ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Auto merged ndb/src/mgmapi/mgmapi.cpp: Auto merged ndb/src/ndbapi/NdbIndexOperation.cpp: Auto merged ndb/src/ndbapi/ndberror.c: Auto merged ndb/test/ndbapi/testNodeRestart.cpp: Auto merged sql/item.h: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_sum.h: Auto merged sql/sql_udf.h: Auto merged sql/sql_yacc.yy: Auto merged configure.in: Ignore 4.1 version change ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: merge 4.1 ndb/src/ndbapi/ClusterMgr.cpp: merge ndb/test/run-test/Makefile.am: merge sql/mysql_priv.h: merge from 4.1 sql/table.cc: Merge from 4.1
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 8e0f52e1910..e587660e180 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -59,6 +59,7 @@ static byte* get_field_name(Field **buff,uint *length,
3 Wrong data in .frm file
4 Error (see frm_error)
5 Error (see frm_error: charset unavailable)
+ 6 Unknown .frm version
*/
int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
@@ -135,10 +136,14 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
*fn_ext(share->table_name)='\0'; // Remove extension
*fn_ext(share->path)='\0'; // Remove extension
- if (head[0] != (uchar) 254 || head[1] != 1 ||
- (head[2] != FRM_VER && head[2] != FRM_VER+1 &&
- ! (head[2] >= FRM_VER+3 && head[2] <= FRM_VER+4)))
+ if (head[0] != (uchar) 254 || head[1] != 1)
+ goto err; /* purecov: inspected */
+ if (head[2] != FRM_VER && head[2] != FRM_VER+1 &&
+ ! (head[2] >= FRM_VER+3 && head[2] <= FRM_VER+4))
+ {
+ error= 6;
goto err; /* purecov: inspected */
+ }
new_field_pack_flag=head[27];
new_frm_ver= (head[2] - FRM_VER);
field_pack_length= new_frm_ver < 2 ? 11 : 17;
@@ -1084,6 +1089,12 @@ static void frm_error(int error, TABLE *form, const char *name,
MYF(0), csname, real_name);
break;
}
+ case 6:
+ my_printf_error(ER_NOT_FORM_FILE,
+ "Table '%-.64s' was created with a different version "
+ "of MySQL and cannot be read",
+ MYF(0), name);
+ break;
default: /* Better wrong error than none */
case 4:
my_error(ER_NOT_FORM_FILE, errortype,