summaryrefslogtreecommitdiff
path: root/sql/ha_myisammrg.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-09-30 14:54:16 +0300
committerunknown <monty@hundin.mysql.fi>2002-09-30 14:54:16 +0300
commitd432f39948741befe94ac42a40c1646441294af7 (patch)
tree046141bf31365b6775df78bed13b221523a04f9d /sql/ha_myisammrg.cc
parent948c76cc2e2f981574d24a5d4a93eb802007a33f (diff)
downloadmariadb-git-d432f39948741befe94ac42a40c1646441294af7.tar.gz
Revert change to use ha_rows for number of rows as other code depend of this
Docs/manual.texi: Changelog
Diffstat (limited to 'sql/ha_myisammrg.cc')
-rw-r--r--sql/ha_myisammrg.cc27
1 files changed, 22 insertions, 5 deletions
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index db83732bd50..c35bf657445 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -53,15 +53,23 @@ int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
if (!(test_if_locked & HA_OPEN_WAIT_IF_LOCKED))
myrg_extra(file,HA_EXTRA_WAIT_LOCK,0);
+
if (table->reclength != mean_rec_length && mean_rec_length)
{
DBUG_PRINT("error",("reclength: %d mean_rec_length: %d",
table->reclength, mean_rec_length));
- myrg_close(file);
- file=0;
- return my_errno=HA_ERR_WRONG_TABLE_DEF;
+ goto err;
}
+#if !defined(BIG_TABLES) || SIZEOF_OFF_T == 4
+ /* Merge table has more than 2G rows */
+ if (table->crashed)
+ goto err;
+#endif
return (0);
+err:
+ myrg_close(file);
+ file=0;
+ return (my_errno= HA_ERR_WRONG_TABLE_DEF);
}
int ha_myisammrg::close(void)
@@ -184,8 +192,17 @@ void ha_myisammrg::info(uint flag)
{
MYMERGE_INFO info;
(void) myrg_status(file,&info,flag);
- records = info.records;
- deleted = info.deleted;
+ /*
+ The following fails if one has not compiled MySQL with -DBIG_TABLES
+ and one has more than 2^32 rows in the merge tables.
+ */
+ records = (ha_rows) info.records;
+ deleted = (ha_rows) info.deleted;
+#if !defined(BIG_TABLES) || SIZEOF_OFF_T == 4
+ if ((info.records >= (ulonglong) 1 << 32) ||
+ (info.deleted >= (ulonglong) 1 << 32))
+ table->crashed=1;
+#endif
data_file_length=info.data_file_length;
errkey = info.errkey;
table->keys_in_use= set_bits(key_map, table->keys);