mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Merge mishka.local:/home/my/mysql-4.1
into mishka.local:/home/my/mysql-5.0 BitKeeper/etc/ignore: auto-union BitKeeper/deleted/.del-Grep.cpp~ad798e9ae519d667: Auto merged BitKeeper/deleted/.del-Grep.hpp~b05e3af6cfabe387: Auto merged BitKeeper/deleted/.del-ctype_cp932.result: Auto merged BitKeeper/deleted/.del-ctype_cp932.test: Auto merged BitKeeper/deleted/.del-have_lowercase0.inc: Delete: mysql-test/include/have_lowercase0.inc VC++Files/mysql-test/mysql_test_run_new.dsp: Auto merged configure.in: Auto merged mysql-test/include/ps_conv.inc: Auto merged mysql-test/mysql-test-run.pl: Auto merged sql/ha_innodb.cc: Auto merged sql/mysql_priv.h: Auto merged sql/set_var.cc: Auto merged sql/examples/ha_archive.cc: Auto merged sql/examples/ha_example.cc: Auto merged sql/sql_table.cc: Auto merged support-files/mysql.spec.sh: Auto merged VC++Files/client/mysqltest.dsp: manual merge VC++Files/sql/mysqld.dsp: manual merge mysql-test/r/grant2.result: patch merge mysql-test/r/subselect2.result: manual merge mysql-test/t/grant2.test: patch merge mysys/charset.c: Remove already deleted function sql/examples/ha_archive.h: Manual merge sql/sql_acl.cc: manual merge sql/sql_db.cc: merge (no differences) sql/sql_select.cc: manual merge sql/table.h: merge (no differences) tests/mysql_client_test.c: patch merge
This commit is contained in:
commit
173e5df37f
33 changed files with 601 additions and 3486 deletions
|
|
@ -5351,6 +5351,7 @@ ha_innobase::info(
|
|||
dict_table_t* ib_table;
|
||||
dict_index_t* index;
|
||||
ha_rows rec_per_key;
|
||||
ib_longlong n_rows;
|
||||
ulong j;
|
||||
ulong i;
|
||||
char path[FN_REFLEN];
|
||||
|
|
@ -5415,7 +5416,30 @@ ha_innobase::info(
|
|||
}
|
||||
|
||||
if (flag & HA_STATUS_VARIABLE) {
|
||||
records = (ha_rows)ib_table->stat_n_rows;
|
||||
n_rows = ib_table->stat_n_rows;
|
||||
|
||||
/* Because we do not protect stat_n_rows by any mutex in a
|
||||
delete, it is theoretically possible that the value can be
|
||||
smaller than zero! TODO: fix this race.
|
||||
|
||||
The MySQL optimizer seems to assume in a left join that n_rows
|
||||
is an accurate estimate if it is zero. Of course, it is not,
|
||||
since we do not have any locks on the rows yet at this phase.
|
||||
Since SHOW TABLE STATUS seems to call this function with the
|
||||
HA_STATUS_TIME flag set, while the left join optizer does not
|
||||
set that flag, we add one to a zero value if the flag is not
|
||||
set. That way SHOW TABLE STATUS will show the best estimate,
|
||||
while the optimizer never sees the table empty. */
|
||||
|
||||
if (n_rows < 0) {
|
||||
n_rows = 0;
|
||||
}
|
||||
|
||||
if (n_rows == 0 && !(flag & HA_STATUS_TIME)) {
|
||||
n_rows++;
|
||||
}
|
||||
|
||||
records = (ha_rows)n_rows;
|
||||
deleted = 0;
|
||||
data_file_length = ((ulonglong)
|
||||
ib_table->stat_clustered_index_size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue