summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <bar@bar.mysql.r18.ru>2002-10-25 13:58:32 +0500
committerunknown <bar@bar.mysql.r18.ru>2002-10-25 13:58:32 +0500
commite8237515485b53bd0662e5fc5592bea5507594b8 (patch)
treed8d121f81f5cf89edfe070e49636482fd879f1fa /sql/sql_table.cc
parent372b26e7786dcc812bc5fd2e8541d8c58201ea5b (diff)
downloadmariadb-git-e8237515485b53bd0662e5fc5592bea5507594b8.tar.gz
BINARY charset is now used instead of binary_flag
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index bff07809861..75d43e8c419 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -383,6 +383,12 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
it.rewind();
while ((sql_field=it++))
{
+ if(!sql_field->charset)
+ sql_field->charset = create_info->table_charset ?
+ create_info->table_charset :
+ thd->db_charset? thd->db_charset :
+ default_charset_info;
+
switch (sql_field->sql_type) {
case FIELD_TYPE_BLOB:
case FIELD_TYPE_MEDIUM_BLOB:
@@ -391,7 +397,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
sql_field->pack_flag=FIELDFLAG_BLOB |
pack_length_to_packflag(sql_field->pack_length -
portable_sizeof_char_ptr);
- if (sql_field->flags & BINARY_FLAG)
+ if (sql_field->charset->state & MY_CS_BINSORT)
sql_field->pack_flag|=FIELDFLAG_BINARY;
sql_field->length=8; // Unireg field length
sql_field->unireg_check=Field::BLOB_FIELD;
@@ -400,7 +406,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
case FIELD_TYPE_VAR_STRING:
case FIELD_TYPE_STRING:
sql_field->pack_flag=0;
- if (sql_field->flags & BINARY_FLAG)
+ if (sql_field->charset->state & MY_CS_BINSORT)
sql_field->pack_flag|=FIELDFLAG_BINARY;
break;
case FIELD_TYPE_ENUM:
@@ -438,11 +444,6 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
sql_field->offset= pos;
if (MTYP_TYPENR(sql_field->unireg_check) == Field::NEXT_NUMBER)
auto_increment++;
- if(!sql_field->charset)
- sql_field->charset = create_info->table_charset ?
- create_info->table_charset :
- thd->db_charset? thd->db_charset :
- default_charset_info;
pos+=sql_field->pack_length;
}
if (auto_increment > 1)