MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
Find a file
Alexander Barkov 46be31982a MDEV-16094 Crash when using AS OF with a stored function
MDEV-16100 FOR SYSTEM_TIME erroneously resolves string user variables as transaction IDs

Problem:

Vers_history_point::resolve_unit() tested item->result_type() before
item->fix_fields() was called.

- Item_func_get_user_var::result_type() returned REAL_RESULT by default.
  This caused MDEV-16100.
- Item_func_sp::result_type() crashed on assert.
  This caused MDEV-16094

Changes:
1. Adding item->fix_fields() into Vers_history_point::resolve_unit()
   before using data type specific properties of the history point
   expression.

2. Adding a new virtual method Type_handler::Vers_history_point_resolve_unit()

3. Implementing type-specific
   Type_handler_xxx::Type_handler::Vers_history_point_resolve_unit()
    in the way to:
    a. resolve temporal and general purpose string types to TIMESTAMP
    b. resolve BIT and general purpose INT types to TRANSACTION
    c. disallow use of non-relevant data type expressions in FOR SYSTEM_TIME

    Note, DOUBLE and DECIMAL data types are disallowed intentionally.
    - DOUBLE does not have enough precision to hold huge BIGINT UNSIGNED values
    - DECIMAL rounds on conversion to INT
    Both lack of precision and rounding might potentionally lead to
    very unpredictable results when a wrong transaction ID would be chosen.
    If one really wants dangerous use of DOUBLE and DECIMAL, explicit CAST
    can be used:

      FOR SYSTEM_TIME AS OF CAST(double_or_decimal AS UNSIGNED)

    QQ: perhaps DECIMAL(N,0) could still be allowed.

4. Adding a new virtual method Item::type_handler_for_system_time(),
   to make HEX hybrids and bit literals work as TRANSACTION rather
   than TIMESTAMP.

5. sql_yacc.yy: replacing the rule temporal_literal to "TIMESTAMP TEXT_STRING".
   Other temporal literals now resolve to TIMESTAMP through the new
   Type_handler methods. No special grammar needed. This removed
   a few shift/resolve conflicts.
   (TIMESTAMP related conflicts in "history_point:" will be removed separately)

6. Removing the "timestamp_only" parameter from
   vers_select_conds_t::resolve_units() and Vers_history_point::resolve_unit().
   It was a hint telling that a table did not have any TRANSACTION-aware
   system time columns, so it's OK to resolve to TIMESTAMP in case of uncertainty.
   In the new reduction it works as follows:
   - the decision between TIMESTAMP and TRANSACTION is first made
     based only on the expression data type only
   - then, in case if the expression resolved to TRANSACTION, the table
     is checked if TRANSACTION-aware columns really exist.
   This way is safer against possible ALTER TABLE statements changing
   ROW START and ROW END columns from "BIGINT UNSIGNED" to "TIMESTAMP(x)"
   or the other way around.
2018-05-15 09:33:29 +04:00
BUILD Renamed compile-pentium scripts to compile-pentium32 2018-04-16 20:16:43 +03:00
client Removed even more warning that was found with -Wunused 2018-04-30 15:21:52 +03:00
cmake Power8: use C implementation of crc32 instead of ASM 2018-05-07 09:26:12 +10:00
dbug Misc. typos 2018-04-05 15:26:57 +04:00
debian Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
Docs Misc. typos 2018-04-05 15:26:57 +04:00
extra Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
include Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
libmariadb@668757aaa9
libmysqld Add CRC32_VPMSUM_LIBRARY to libmysqld/mysqlserver libraries 2018-05-09 13:11:54 +10:00
libservices
man MDEV-12645 - mysql_install_db: no install test db option 2018-04-30 19:34:08 +04:00
mysql-test MDEV-16094 Crash when using AS OF with a stored function 2018-05-15 09:33:29 +04:00
mysys Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
mysys_ssl
pcre Merge branch '10.1' into 10.2 2018-05-10 13:01:42 +02:00
plugin Merge 10.2 into 10.3 2018-05-12 22:14:59 +03:00
randgen/conf
scripts Merge branch '10.2' into 10.3 2018-05-11 13:15:10 +02:00
sql MDEV-16094 Crash when using AS OF with a stored function 2018-05-15 09:33:29 +04:00
sql-bench Added more test to sql-bench 2018-04-30 14:05:27 +03:00
sql-common User _server_host per discussion. 2018-05-11 16:24:55 +02:00
storage Merge 10.2 into 10.3 2018-05-12 22:14:59 +03:00
strings Add likely/unlikely to speed up execution 2018-05-07 00:07:32 +03:00
support-files
tests Removed even more warning that was found with -Wunused 2018-04-30 15:21:52 +03:00
unittest
vio
win Feedback plugin - MSI installation checkbox switched to OFF again. 2018-04-12 16:50:33 +01:00
wsrep
zlib
.gitattributes Merge branch '10.0' into 10.1 2018-05-05 14:01:59 +02:00
.gitignore
.gitmodules
.travis.compiler.sh
.travis.yml
appveyor.yml
BUILD-CMAKE
CMakeLists.txt MDEV-12924 No --innodb-numa-interleave in mysqld binaries 2018-04-19 13:08:35 +05:30
config.h.cmake Fix a lot of compiler warnings found by -Wunused 2018-04-26 17:35:12 +03:00
configure.cmake Merge branch '10.2' into 10.3 2018-03-28 17:31:57 +02:00
COPYING
COPYING.thirdparty
CREDITS Update contributors 2018-04-05 14:23:18 +04:00
EXCEPTIONS-CLIENT
INSTALL-SOURCE
INSTALL-WIN-SOURCE
KNOWN_BUGS.txt
README.md
VERSION bump the VERSION 2018-05-09 17:43:08 -04:00

MariaDB: drop-in replacement for MySQL

MariaDB is designed as a drop-in replacement of MySQL(R) with more features, new storage engines, fewer bugs, and better performance.

MariaDB is brought to you by the MariaDB Foundation. Please read the CREDITS file for details about the MariaDB Foundation, and who is developing MariaDB.

MariaDB is developed by many of the original developers of MySQL who now work for the MariaDB Foundation and the MariaDB Corporation, and by many people in the community.

MySQL, which is the base of MariaDB, is a product and trademark of Oracle Corporation, Inc. For a list of developers and other contributors, see the Credits appendix. You can also run 'SHOW authors' to get a list of active contributors.

A description of the MariaDB project and a manual can be found at: https://mariadb.org/ https://mariadb.com/kb/en/ https://mariadb.com/kb/en/mariadb-vs-mysql-features/ https://mariadb.com/kb/en/mariadb-versus-mysql-features/ https://mariadb.com/kb/en/mariadb-versus-mysql-compatibility/

As MariaDB is a full replacement of MySQL, the MySQL manual at http://dev.mysql.com/doc is generally applicable.

Help:

More help is available from the Maria Discuss mailing list https://launchpad.net/~maria-discuss and the #maria IRC channel on Freenode.

License:


NOTE:

MariaDB is specifically available only under version 2 of the GNU General Public License (GPLv2). (I.e. Without the "any later version" clause.) This is inherited from MySQL. Please see the README file in the MySQL distribution for more information.

License information can be found in the COPYING, COPYING.LESSER, and COPYING.thirdparty files.


Bug Reports:

Bug and/or error reports regarding MariaDB should be submitted at https://mariadb.org/jira

Bugs in the MySQL code can also be submitted at https://bugs.mysql.com

The code for MariaDB, including all revision history, can be found at: https://github.com/MariaDB/server


Code status:

  • tests status travis-ci.org (10.2 branch)