Commit e494b724 authored by unknown's avatar unknown

Fixed key algorithm handling


sql/sql_string.cc:
  Portability fix
parent a8652e99
......@@ -221,9 +221,6 @@ public:
List<key_part_spec> columns;
const char *Name;
Key(enum Keytype type_par,const char *name_arg,List<key_part_spec> &cols)
:type(type_par), columns(cols),Name(name_arg) {}
Key(enum Keytype type_par, enum ha_key_alg alg_par, const char *name_arg, List<key_part_spec> &cols)
:type(type_par), algorithm(alg_par), columns(cols), Name(name_arg)
{}
......
......@@ -2787,14 +2787,14 @@ bool add_field_to_list(char *field_name, enum_field_types type,
if (type_modifier & PRI_KEY_FLAG)
{
lex->col_list.push_back(new key_part_spec(field_name,0));
lex->key_list.push_back(new Key(Key::PRIMARY,NullS,
lex->key_list.push_back(new Key(Key::PRIMARY, HA_KEY_ALG_UNDEF, NullS,
lex->col_list));
lex->col_list.empty();
}
if (type_modifier & (UNIQUE_FLAG | UNIQUE_KEY_FLAG))
{
lex->col_list.push_back(new key_part_spec(field_name,0));
lex->key_list.push_back(new Key(Key::UNIQUE,NullS,
lex->key_list.push_back(new Key(Key::UNIQUE, HA_KEY_ALG_UNDEF, NullS,
lex->col_list));
lex->col_list.empty();
}
......@@ -2858,6 +2858,7 @@ bool add_field_to_list(char *field_name, enum_field_types type,
case FIELD_TYPE_STRING:
case FIELD_TYPE_VAR_STRING:
case FIELD_TYPE_NULL:
case FIELD_TYPE_GEOMETRY:
break;
case FIELD_TYPE_DECIMAL:
if (!length)
......
......@@ -123,7 +123,7 @@ bool String::set(double num,uint decimals)
char *pos,*to;
VOID(fconvert(num,(int) decimals,&decpt,&sign,buff+1));
if (!isdigit(buff[1]))
if (!my_isdigit(system_charset_info, buff[1]))
{ // Nan or Inf
pos=buff+1;
if (sign)
......@@ -490,7 +490,7 @@ void String::qs_append(double d)
void String::qs_append(double *d)
{
double ld;
float8get(ld, d);
float8get(ld, (char*) d);
qs_append(ld);
}
......
......@@ -199,7 +199,12 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
/* Read key types */
keyinfo=outparam->key_info;
for (i=0 ; i < keys ; i++, keyinfo++)
{
keyinfo->algorithm= (enum ha_key_alg) *(strpos++);
/* Temporary fix to get spatial index to work */
if (keyinfo->algorithm == HA_KEY_ALG_RTREE)
keyinfo->flags|= HA_SPATIAL;
}
}
else
{
......
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