diff options
author | mikael/pappa@dator5.(none) <> | 2006-08-08 08:47:58 -0400 |
---|---|---|
committer | mikael/pappa@dator5.(none) <> | 2006-08-08 08:47:58 -0400 |
commit | 47a8ebe7337d96cd410413930539e841a5ef9d47 (patch) | |
tree | e9467d5bef7c8dce431d02de5f896e482deb5aad /sql/ha_partition.cc | |
parent | a4eb61b88cbe4e8f6e43db2ca841fa60ec73467c (diff) | |
download | mariadb-git-47a8ebe7337d96cd410413930539e841a5ef9d47.tar.gz |
BUG#21173: SHOW TABLE STATUS crashes on InnoDB tables
Don't use get_auto_increment on tables without auto_increment fields
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 615c4bfb1bf..042b23632a6 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4183,9 +4183,15 @@ void ha_partition::info(uint flag) ulonglong nb_reserved_values; DBUG_PRINT("info", ("HA_STATUS_AUTO")); /* we don't want to reserve any values, it's pure information */ - get_auto_increment(0, 0, 0, &stats.auto_increment_value, - &nb_reserved_values); - release_auto_increment(); + + if (table->found_next_number_field) + { + get_auto_increment(0, 0, 0, &stats.auto_increment_value, + &nb_reserved_values); + release_auto_increment(); + } + else + stats.auto_increment_value= ~(ulonglong)(0); } if (flag & HA_STATUS_VARIABLE) { @@ -5363,7 +5369,6 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment, if (increment) // If not check for values *nb_reserved_values= (last_value == ULONGLONG_MAX) ? ULONGLONG_MAX : ((last_value - *first_value) / increment); - DBUG_VOID_RETURN; } |