summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorunknown <monty@nosik.monty.fi>2006-11-21 23:12:45 +0200
committerunknown <monty@nosik.monty.fi>2006-11-21 23:12:45 +0200
commit42c4df3fffa094fbdf1a1b0534bd8c219a512f30 (patch)
tree92c5d6bff5c91f7ab015fea75f2a0f3f14accbfa /storage
parenta3fcd8b28d0386e680a356499a47bf6164665c35 (diff)
parent22b80d14be0d7ef91a59c58becb16683ecf89bad (diff)
downloadmariadb-git-42c4df3fffa094fbdf1a1b0534bd8c219a512f30.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into mysql.com:/home/my/mysql-5.1 client/mysql.cc: Auto merged client/mysqlbinlog.cc: Auto merged mysql-test/mysql-test-run-shell.sh: Auto merged mysql-test/lib/mtr_report.pl: Auto merged mysql-test/r/connect.result: Auto merged mysql-test/r/drop.result: Auto merged mysql-test/r/information_schema.result: Auto merged mysql-test/r/rpl_ndb_dd_advance.result: Auto merged mysql-test/r/show_check.result: Auto merged mysql-test/t/information_schema.test: Auto merged mysql-test/t/mysqldump.test: Auto merged mysql-test/t/rpl_ndb_dd_advance.test: Auto merged mysql-test/t/system_mysql_db_fix.test: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/item_sum.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_select.cc: Auto merged sql/table.cc: Auto merged storage/federated/ha_federated.cc: Auto merged storage/myisam/ha_myisam.cc: Auto merged client/mysql_upgrade.c: Manual merge client/mysqltest.c: Manual merge mysql-test/mysql-test-run.pl: Manual merge storage/innobase/handler/ha_innodb.cc: Manual merge
Diffstat (limited to 'storage')
-rw-r--r--storage/archive/ha_archive.cc18
-rw-r--r--storage/federated/ha_federated.cc3
-rw-r--r--storage/innobase/handler/ha_innodb.cc4
-rw-r--r--storage/myisam/ha_myisam.cc14
-rw-r--r--storage/myisam/ha_myisam.h2
-rw-r--r--storage/ndb/tools/restore/Restore.cpp2
6 files changed, 25 insertions, 18 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index b2b07981bdb..83fafe27d21 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -817,10 +817,11 @@ int ha_archive::write_row(byte *buf)
int rc;
byte *read_buf= NULL;
ulonglong temp_auto;
+ byte *record= table->record[0];
DBUG_ENTER("ha_archive::write_row");
if (share->crashed)
- DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
+ DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
ha_statistic_increment(&SSV::ha_write_count);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
@@ -883,7 +884,8 @@ int ha_archive::write_row(byte *buf)
while (!(get_row(&archive, read_buf)))
{
- if (!memcmp(read_buf + mfield->offset(), table->next_number_field->ptr,
+ if (!memcmp(read_buf + mfield->offset(record),
+ table->next_number_field->ptr,
mfield->max_length()))
{
rc= HA_ERR_FOUND_DUPP_KEY;
@@ -914,15 +916,16 @@ int ha_archive::write_row(byte *buf)
for (Field **field=table->field ; *field ; field++)
{
DBUG_PRINT("archive",("Pack is %d\n", (*field)->pack_length()));
- DBUG_PRINT("archive",("MyPack is %d\n", (*field)->data_length((char*) buf + (*field)->offset())));
+ DBUG_PRINT("archive",("MyPack is %d\n", (*field)->data_length((char*) buf + (*field)->offset(record))));
if ((*field)->real_type() == MYSQL_TYPE_VARCHAR)
{
- uint actual_length= (*field)->data_length((char*) buf + (*field)->offset());
- uint offset= (*field)->offset() + actual_length +
+ uint actual_length= (*field)->data_length((char*) buf +
+ (*field)->offset(record));
+ uint offset= (*field)->offset(record) + actual_length +
(actual_length > 255 ? 2 : 1);
DBUG_PRINT("archive",("Offset is %d -> %d\n", actual_length, offset));
/*
- if ((*field)->pack_length() + (*field)->offset() != offset)
+ if ((*field)->pack_length() + (*field)->offset(record) != offset)
bzero(buf + offset, (size_t)((*field)->pack_length() + (actual_length > 255 ? 2 : 1) - (*field)->data_length));
*/
}
@@ -1306,7 +1309,8 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt)
{
Field *field= table->found_next_number_field;
ulonglong auto_value=
- (ulonglong) field->val_int((char*)(buf + field->offset()));
+ (ulonglong) field->val_int((char*)(buf +
+ field->offset(table->record[0])));
if (share->auto_increment_value < auto_value)
stats.auto_increment_value= share->auto_increment_value=
auto_value;
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 53c2ba5a0ee..8897e1ee53a 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -1856,6 +1856,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
String where_string(where_buffer,
sizeof(where_buffer),
&my_charset_bin);
+ byte *record= table->record[0];
DBUG_ENTER("ha_federated::update_row");
/*
set string lengths to 0 to avoid misc chars in string
@@ -1914,7 +1915,7 @@ int ha_federated::update_row(const byte *old_data, byte *new_data)
bool needs_quote= (*field)->str_needs_quotes();
where_string.append(STRING_WITH_LEN(" = "));
(*field)->val_str(&field_value,
- (char*) (old_data + (*field)->offset()));
+ (char*) (old_data + (*field)->offset(record)));
if (needs_quote)
where_string.append('\'');
field_value.print(&where_string);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 83266a22255..cc7be545cf1 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -6630,7 +6630,7 @@ innodb_mutex_show_status(
mutex->count_spin_rounds,
mutex->count_os_wait,
mutex->count_os_yield,
- (ulong) mutex->lspent_time/1000);
+ (ulong) (mutex->lspent_time/1000));
if (stat_print(thd, innobase_hton_name,
hton_name_len, buf1, buf1len,
@@ -6660,7 +6660,7 @@ innodb_mutex_show_status(
rw_lock_count, rw_lock_count_spin_loop,
rw_lock_count_spin_rounds,
rw_lock_count_os_wait, rw_lock_count_os_yield,
- (ulong) rw_lock_wait_time/1000);
+ (ulong) (rw_lock_wait_time/1000));
if (stat_print(thd, innobase_hton_name, hton_name_len,
STRING_WITH_LEN("rw_lock_mutexes"), buf2, buf2len)) {
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 85968110a77..9335b01d008 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -609,7 +609,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
{
param.testflag&= ~T_RETRY_WITHOUT_QUICK;
sql_print_information("Retrying repair of: '%s' without quick",
- table->s->path);
+ table->s->path.str);
continue;
}
param.testflag&= ~T_QUICK;
@@ -617,7 +617,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
{
param.testflag= (param.testflag & ~T_REP_BY_SORT) | T_REP;
sql_print_information("Retrying repair of: '%s' with keycache",
- table->s->path);
+ table->s->path.str);
continue;
}
break;
@@ -629,7 +629,7 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
sql_print_information("Found %s of %s rows when repairing '%s'",
llstr(file->state->records, llbuff),
llstr(start_records, llbuff2),
- table->s->path);
+ table->s->path.str);
}
return error;
}
@@ -1157,7 +1157,7 @@ bool ha_myisam::check_and_repair(THD *thd)
// Don't use quick if deleted rows
if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK))
check_opt.flags|=T_QUICK;
- sql_print_warning("Checking table: '%s'",table->s->path);
+ sql_print_warning("Checking table: '%s'",table->s->path.str);
old_query= thd->query;
old_query_length= thd->query_length;
@@ -1168,7 +1168,7 @@ bool ha_myisam::check_and_repair(THD *thd)
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
{
- sql_print_warning("Recovering table: '%s'",table->s->path);
+ sql_print_warning("Recovering table: '%s'",table->s->path.str);
check_opt.flags=
((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
(marked_crashed ? 0 : T_QUICK) |
@@ -1460,6 +1460,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
bool found_real_auto_increment=0;
enum ha_base_keytype type;
char buff[FN_REFLEN];
+ byte *record;
KEY *pos;
MI_KEYDEF *keydef;
MI_COLUMNDEF *recinfo,*recinfo_pos;
@@ -1564,6 +1565,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
found_real_auto_increment= share->next_number_key_offset == 0;
}
+ record= table_arg->record[0];
recpos=0; recinfo_pos=recinfo;
while (recpos < (uint) share->reclength)
{
@@ -1573,7 +1575,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
for (field=table_arg->field ; *field ; field++)
{
- if ((fieldpos=(*field)->offset()) >= recpos &&
+ if ((fieldpos=(*field)->offset(record)) >= recpos &&
fieldpos <= minpos)
{
/* skip null fields */
diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h
index 7ad938c06a7..6e9108e8731 100644
--- a/storage/myisam/ha_myisam.h
+++ b/storage/myisam/ha_myisam.h
@@ -37,7 +37,7 @@ extern ulong myisam_recover_options;
class ha_myisam: public handler
{
MI_INFO *file;
- ulong int_table_flags;
+ ulonglong int_table_flags;
char *data_file_name, *index_file_name;
bool can_enable_indexes;
int repair(THD *thd, MI_CHECK &param, bool optimize);
diff --git a/storage/ndb/tools/restore/Restore.cpp b/storage/ndb/tools/restore/Restore.cpp
index ef535cf9e26..4e3d299239b 100644
--- a/storage/ndb/tools/restore/Restore.cpp
+++ b/storage/ndb/tools/restore/Restore.cpp
@@ -317,7 +317,7 @@ RestoreMetaData::markSysTables()
Uint32 j;
for (j = 0; j < getNoOfTables(); j++) {
TableS* table = allTables[j];
- if (table->getTableId() == id1) {
+ if (table->getTableId() == (Uint32) id1) {
if (table->isSysTable)
blobTable->isSysTable = true;
break;