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 f6138883b1 MDEV-11672 mysql_list_field() returns wrong default values for VIEW
The problem happened because Item_ident_for_show::field_type() always
returned MYSQL_TYPE_DOUBLE and ignored the actual data type of the
referenced Field. As a result, the execution always used
Item_ident_for_show::val_real() to send the default value of the field,
so most default values for non-numeric types were displayed as '0'.

This patch:
1. Cleanup:
   a. Removes Send_field::charsetnr, as it's been unused since
      introduction of Item::charset_for_protocol() in MySQL-5.5.
   b. Adds the "const" qualifier to Field::char_length().
      This is needed for (5.a), see below.

2. Introduces a new virtual method Type_handler::charset_for_protocol(),
   returning item->collation.collation for string data types, or
   &my_charset_bin for non-string data types.

3. Changes Item::charset_for_protocol() from virtual to non-virtual.
   It now calls type_handler()->charset_for_protocol().
   As a good side effect, duplicate code in Item::charset_for_protocol() and
   Item_temporal_hybrid_func::charset_for_protocol() is now gone.

4. Fixes Item_ident_for_show::field_type() to correctly return
   its data type according to the data type of the referenced field.
   This actually fixes the problem reported in MDEV-11672.
   Now the default value is sent using a correct method, e.g.
   val_str() for VARCHAR/TEXT, or val_int() for INT/BIGINT.
   This required additional changes:
   a. in DBUG_ASSERT in Protocol::store(const char *,size_t,CHARSET_INFO),
      This method is now used by mysqld_list_fields(), which
      (unlike normal SELECT queries) does not set
      field_types/field_pos/field_count.
   b. Item_ident_for_show::Item_ident_for_show() now set standard attributes
      (collation, decimals, max_length, unsigned_flag) according to the
      referenced field, to make charset_for_protocol() return the correct
      value and to make mysqld_list_fields() correctly send default
      values.

5. In order to share the code between Item_field::set_field() and
   Item_ident_for_show::Item_ident_for_show():
   a. Introduces a new method Type_std_attributes::set(const Field*)
   b. To make (a) possible, moves Item::fix_char_length() from Item
      to Type_std_attributes, also moves char_to_byte_length_safe()
      from item.h to sql_type.h
   c. Additionally, moves Item::fix_length_and_charset() and
      Item::max_char_length() from Item to Type_std_attributes.
      This is not directly needed for the fix and is done just for symmetry
      with fix_char_length(), as these three methods are directly related
      to each other.
2016-12-29 07:40:49 +04:00
BUILD Merge branch '10.2' into bb-10.2-jan 2016-09-19 09:47:08 +02:00
client MDEV-11065: Compressed binary log. Merge code into current 10.2. 2016-11-03 14:48:51 +01:00
cmake update RPM metadata (vendor and contact) 2016-12-12 20:27:20 +01:00
dbug Add C/C as a submodule in libmariadb/ 2016-09-12 17:46:35 +02:00
debian update libmariadb, and fix debian packaging for client libs 2016-12-22 10:17:26 +01:00
Docs Merge branch '10.0' into 10.1 2016-03-21 13:02:53 +01:00
extra fix build and some warnings 2016-11-24 17:36:02 +03:00
include MDEV-11562 Assertion `js->state == JST_VALUE' failed in check_contains(json_engine_t*, json_engine_t*). 2016-12-16 12:32:56 +04:00
libmariadb@cae391f7bf update libmariadb, and fix debian packaging for client libs 2016-12-22 10:17:26 +01:00
libmysqld MDEV-9143 JSON_xxx functions. 2016-10-19 14:10:03 +04:00
libservices rename {sys_vars,sql_plugin_services}.h -> *.ic 2015-06-28 12:09:46 +02:00
man Merge pull request #166 from iangilfillan/10.2 2016-03-28 12:55:15 +04:00
mysql-test Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2016-12-27 07:07:36 +04:00
mysys MDEV-5800 MyISAM support for indexed vcols 2016-12-12 20:27:36 +01:00
mysys_ssl Merge branch '10.0' into 10.1 2015-12-21 21:24:22 +01:00
pcre Merge branch '10.0' into 10.1 2016-06-28 22:01:55 +02:00
plugin MDEV-11227 - mysqlimport -l doesn't issue UNLOCK TABLES 2016-12-21 13:18:45 +04:00
randgen/conf Group commit for maria engine. 2010-02-12 15:12:28 +02:00
scripts MDEV-10432: Post-fix after merging PR#205 2016-11-21 15:38:33 -05:00
sql MDEV-11672 mysql_list_field() returns wrong default values for VIEW 2016-12-29 07:40:49 +04:00
sql-bench fix sql-bench test-table-elimination view leak. see MDEV-10310 for details 2016-07-12 22:21:49 +02:00
sql-common fix the ABI and stop slave hang problem 2016-10-21 13:37:48 +02:00
storage Follow-up for MDEV-11630 Call mutex_free() before freeing the mutex list 2016-12-23 09:19:39 +02:00
strings MDEV-11571 JSON_EXTRACT returns wrong results. 2016-12-24 10:51:43 +04:00
support-files buildbot issues 2016-12-13 21:42:30 +01:00
tests MDEV-11672 mysql_list_field() returns wrong default values for VIEW 2016-12-29 07:40:49 +04:00
unittest MDEV-11469 JSON_SEARCH returns incorrect results. 2016-12-09 12:26:32 +04:00
vio Merge branch '10.1' into 10.2 2016-09-09 08:33:08 +02:00
win Merge branch '10.0' into 10.1 2016-06-28 22:01:55 +02:00
wsrep MDEV-8791 - AIX: Unresolved Symbols during linking 2016-10-31 12:18:23 +04:00
zlib Backport from trunk: 2014-05-07 17:09:14 +02:00
.gitattributes Merge branch 'connect/10.1' into 10.1 2016-06-28 22:12:50 +02:00
.gitignore Merge branch '10.2' into bb-10.2-connector-c-integ-subm 2016-09-21 12:54:56 +02:00
.gitmodules really add a submodule 2016-09-12 17:51:52 +02:00
.travis.yml Travis: parallel_jobs=3 2016-12-17 09:56:21 +04:00
BUILD-CMAKE various documentation updates 2012-06-18 16:57:58 -04:00
CMakeLists.txt Merge pull request #253 from grooverdan/10.2-MDEV-11195-numa-build 2016-11-04 17:19:02 +01:00
config.h.cmake MDEV-11195: Correct enablement of NUMA in innodb/xtradb 2016-11-01 11:09:47 +11:00
configure.cmake Merge branch '10.2' into bb-10.2-jan 2016-09-19 09:47:08 +02:00
COPYING Use a new version of "COPYING", the GPL text. 2010-03-04 14:26:27 +01:00
COPYING.LESSER MWL#192: non-blocking client API, after-review fixes. 2012-01-06 12:43:18 +01:00
COPYING.thirdparty split README into the actual README and third-party licenses 2014-05-24 18:23:46 +02:00
CREDITS Update contributors 2016-07-27 15:29:32 +02:00
EXCEPTIONS-CLIENT MDEV-5645 MariaDB-5.5.35 - references are made to an "EXCEPTIONS-CLIENT" file but it does not exist 2014-05-31 13:18:56 +02:00
INSTALL-SOURCE Update AskMonty and Atlassian references to MariaDB 2016-03-08 15:24:01 +02:00
INSTALL-WIN-SOURCE Update AskMonty and Atlassian references to MariaDB 2016-03-08 15:24:01 +02:00
KNOWN_BUGS.txt various documentation updates 2012-06-18 16:57:58 -04:00
README.md Markdown README for a prettier github representation 2016-08-24 15:00:59 +10:00
VERSION bump the VERSION 2016-12-24 09:54:23 -05: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: http://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 http://mariadb.org/jira

Bugs in the MySQL code can also be submitted at http://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)