diff options
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; } |