Commit 31560c44 authored by Olivier Bertrand's avatar Olivier Bertrand

- FIX MDEV-5890 and MDEV-5900

modified:
  storage/connect/filamtxt.cpp
  storage/connect/ha_connect.cc
parent db77e643
...@@ -948,7 +948,9 @@ void DOSFAM::CloseTableFile(PGLOBAL g) ...@@ -948,7 +948,9 @@ void DOSFAM::CloseTableFile(PGLOBAL g)
/***********************************************************************/ /***********************************************************************/
void DOSFAM::Rewind(void) void DOSFAM::Rewind(void)
{ {
rewind(Stream); if (Stream) // Can be NULL when making index on void table
rewind(Stream);
Rows = 0; Rows = 0;
OldBlk = CurBlk = -1; OldBlk = CurBlk = -1;
} // end of Rewind } // end of Rewind
......
...@@ -4555,15 +4555,23 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -4555,15 +4555,23 @@ int ha_connect::create(const char *name, TABLE *table_arg,
case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_DATETIME:
case MYSQL_TYPE_YEAR: case MYSQL_TYPE_YEAR:
case MYSQL_TYPE_NEWDATE: case MYSQL_TYPE_NEWDATE:
case MYSQL_TYPE_VARCHAR:
case MYSQL_TYPE_LONGLONG: case MYSQL_TYPE_LONGLONG:
case MYSQL_TYPE_TINY: case MYSQL_TYPE_TINY:
break; // Ok
case MYSQL_TYPE_VAR_STRING:
case MYSQL_TYPE_STRING:
case MYSQL_TYPE_DECIMAL: case MYSQL_TYPE_DECIMAL:
case MYSQL_TYPE_NEWDECIMAL: case MYSQL_TYPE_NEWDECIMAL:
case MYSQL_TYPE_INT24: case MYSQL_TYPE_INT24:
break; // Ok
case MYSQL_TYPE_VARCHAR:
case MYSQL_TYPE_VAR_STRING:
case MYSQL_TYPE_STRING:
if (!fp->field_length) {
sprintf(g->Message, "Unsupported 0 length for column %s",
fp->field_name);
rc= HA_ERR_INTERNAL_ERROR;
my_printf_error(ER_UNKNOWN_ERROR, g->Message, MYF(0));
DBUG_RETURN(rc);
} // endif fp
break; // To be checked break; // To be checked
case MYSQL_TYPE_BIT: case MYSQL_TYPE_BIT:
case MYSQL_TYPE_NULL: case MYSQL_TYPE_NULL:
...@@ -4579,9 +4587,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -4579,9 +4587,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
sprintf(g->Message, "Unsupported type for column %s", sprintf(g->Message, "Unsupported type for column %s",
fp->field_name); fp->field_name);
rc= HA_ERR_INTERNAL_ERROR; rc= HA_ERR_INTERNAL_ERROR;
my_printf_error(ER_UNKNOWN_ERROR, my_printf_error(ER_UNKNOWN_ERROR, g->Message, MYF(0));
"Unsupported type for column '%s'",
MYF(0), fp->field_name);
DBUG_RETURN(rc); DBUG_RETURN(rc);
break; break;
} // endswitch type } // endswitch type
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment