diff options
author | Eugene Kosov <claprix@yandex.ru> | 2019-04-25 16:29:55 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-25 16:29:55 +0300 |
commit | 6c5c1f0b2fc71ab7e90dc7798180135e7967a264 (patch) | |
tree | e12f852c318eea21e71c5f68148eff76aa86c3c2 /storage/innobase/que | |
parent | bc145193c164b895a52b943e73fff53952d48a60 (diff) | |
download | mariadb-git-6c5c1f0b2fc71ab7e90dc7798180135e7967a264.tar.gz |
MDEV-19231 make DB_SUCCESS equal to 0
It's a micro optimization. On most platforms CPUs has instructions to
compare with 0 fast. DB_SUCCESS is the most popular outcome of functions
and this patch optimized code like (err == DB_SUCCESS)
BtrBulk::finish(): bogus assertion fixed
fil_node_t::read_page0(): corrected usage of os_file_read()
que_eval_sql(): bugus assertion removed. Apparently it checked that
the field was assigned after having been zero-initialized at
object creation.
It turns out that the return type of os_file_read_func() was changed
in mysql/mysql-server@98909cefbc37e54efc6452c7e95bccbf64ac9213 (MySQL 5.7)
from ibool to dberr_t. The reviewer (if there was any) failed to
point out that because of future merges, it could be a bad idea to
change the return type of a function without changing the function name.
This change was applied to MariaDB 10.2.2 in
commit 2e814d4702d71a04388386a9f591d14a35980bfe but the
MariaDB-specific code was not fully adjusted accordingly,
e.g. in fil_node_open_file(). Essentially, code like
!os_file_read(...) became dead code in MariaDB and later
in Mariabackup 10.2, and we could be dealing with an uninitialized
buffer after a failed page read.
Diffstat (limited to 'storage/innobase/que')
-rw-r--r-- | storage/innobase/que/que0que.cc | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/storage/innobase/que/que0que.cc b/storage/innobase/que/que0que.cc index 05964403543..57c7a6216de 100644 --- a/storage/innobase/que/que0que.cc +++ b/storage/innobase/que/que0que.cc @@ -1233,7 +1233,5 @@ que_eval_sql( mutex_exit(&dict_sys->mutex); } - ut_a(trx->error_state != 0); - DBUG_RETURN(trx->error_state); } |