diff options
author | hf@genie.(none) <> | 2002-10-07 15:38:07 +0500 |
---|---|---|
committer | hf@genie.(none) <> | 2002-10-07 15:38:07 +0500 |
commit | 55866b061558d13d40f56097ab0bfbbd23e6bf83 (patch) | |
tree | fbfc224eeed4a74ac5f2b5ede3bfe93330151a2d /sql/sql_table.cc | |
parent | 23de67efae0d91e36da5a2de0bbe86ac58f938c7 (diff) | |
parent | 71d0f48f1f927fbe49d2d1b83f66aa55e973bf2d (diff) | |
download | mariadb-git-55866b061558d13d40f56097ab0bfbbd23e6bf83.tar.gz |
Huge pull
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index a71f555cdd7..ccb7b5e5a9a 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -397,6 +397,16 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, sql_field->unireg_check=Field::BLOB_FIELD; blob_columns++; break; + case FIELD_TYPE_GEOMETRY: + sql_field->pack_flag=FIELDFLAG_GEOM | + pack_length_to_packflag(sql_field->pack_length - + portable_sizeof_char_ptr); + if (sql_field->flags & BINARY_FLAG) + sql_field->pack_flag|=FIELDFLAG_BINARY; + sql_field->length=8; // Unireg field length + sql_field->unireg_check=Field::BLOB_FIELD; + blob_columns++; + break; case FIELD_TYPE_VAR_STRING: case FIELD_TYPE_STRING: sql_field->pack_flag=0; @@ -1007,8 +1017,7 @@ static int send_check_errmsg(THD* thd, TABLE_LIST* table, net_store_data(packet, "error"); net_store_data(packet, errmsg); thd->net.last_error[0]=0; - if (my_net_write(&thd->net, (char*) thd->packet.ptr(), - packet->length())) + if (SEND_ROW(thd, &thd->net, 4, (char*) thd->packet.ptr(), packet->length())) return -1; return 1; } @@ -1178,6 +1187,9 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, thd->open_options|= extra_open_options; table->table = open_ltable(thd, table, lock_type); +#ifdef EMBEDDED_LIBRARY + thd->net.last_errno= 0; // these errors shouldn't get client +#endif thd->open_options&= ~extra_open_options; packet->length(0); if (prepare_func) @@ -1199,7 +1211,7 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, err_msg=ER(ER_CHECK_NO_SUCH_TABLE); net_store_data(packet, err_msg); thd->net.last_error[0]=0; - if (my_net_write(&thd->net, (char*) thd->packet.ptr(), + if (SEND_ROW(thd, &thd->net, field_list.elements, (char*) thd->packet.ptr(), packet->length())) goto err; continue; @@ -1214,7 +1226,7 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, net_store_data(packet, buff); close_thread_tables(thd); table->table=0; // For query cache - if (my_net_write(&thd->net, (char*) thd->packet.ptr(), + if (SEND_ROW(thd, &thd->net, field_list.elements, (char*) thd->packet.ptr(), packet->length())) goto err; continue; @@ -1243,6 +1255,9 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, } int result_code = (table->table->file->*operator_func)(thd, check_opt); +#ifdef EMBEDDED_LIBRARY + thd->net.last_errno= 0; // these errors shouldn't get client +#endif packet->length(0); net_store_data(packet, table_name); net_store_data(packet, operator_name); @@ -1298,8 +1313,8 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, } close_thread_tables(thd); table->table=0; // For query cache - if (my_net_write(&thd->net, (char*) packet->ptr(), - packet->length())) + if (SEND_ROW(thd, &thd->net, field_list.elements, + (char *)thd->packet.ptr(), thd->packet.length())) goto err; } |