mariadb/sql
Monty 34eb10e406 MDEV-10138 Support for decimals up to 38 digits
Decimals with float, double and decimal now works the following way:

- DECIMAL_NOT_SPECIFIED is used when declaring DECIMALS without a firm number
  of decimals.  It's only used in asserts and my_decimal_int_part.
- FLOATING_POINT_DECIMALS (31) is used to mark that a FLOAT or DOUBLE
  was defined without decimals. This is regarded as a floating point value.
- Max decimals allowed for FLOAT and DOUBLE is FLOATING_POINT_DECIMALS-1
- Clients assumes that float and double with decimals >= NOT_FIXED_DEC are
  floating point values (no decimals)
- In the .frm decimals=FLOATING_POINT_DECIMALS are used to define
  floating point for float and double (31, like before)

To ensure compatibility with old clients we do:

- When storing float and double, we change NOT_FIXED_DEC to
  FLOATING_POINT_DECIMALS.
- When creating fields from .frm we change for float and double
  FLOATING_POINT_DEC to NOT_FIXED_DEC
- When sending definition for a float/decimal field without decimals
  to the client as part of a result set we convert NOT_FIXED_DEC to
  FLOATING_POINT_DECIMALS.
- variance() and std() has changed to limit the decimals to
  FLOATING_POINT_DECIMALS -1 to not get the double converted floating point.
  (This was to preserve compatiblity)
- FLOAT and DOUBLE still have 30 as max number of decimals.

Bugs fixed:

variance() printed more decimals than we support for double values.

New behaviour:
- Strings now have 38 decimals instead of 30 when converted to decimal
- CREATE ... SELECT with a decimal with > 30 decimals will create a column
  with a smaller range than before as we are trying to preserve the number of
  decimals.


Other changes
- We are now using the obsolete bit FIELDFLAG_LEFT_FULLSCREEN to specify
  decimals > 31
- NOT_FIXED_DEC is now declared in one place
- For clients, NOT_FIXED_DEC is always 31 (to ensure compatibility).
  On the server NOT_FIXED_DEC is DECIMAL_NOT_SPECIFIED (39)
- AUTO_SEC_PART_DIGITS is taken from DECIMAL_NOT_SPECIFIED
- DOUBLE conversion functions are now using DECIMAL_NOT_SPECIFIED instead of
  NOT_FIXED_DEC
2016-06-22 22:04:55 +03:00
..
share MDEV-10102 Disallow CREATE VIEW .. PROCEDURE ANALYSE() syntactically 2016-05-23 16:25:51 +04:00
add_errmsg
authors.h
bounded_queue.h Fixed compiler failures and warnings 2016-03-20 21:00:58 +02:00
client_settings.h
CMakeLists.txt MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
compat56.cc
compat56.h
contributors.h
create_options.cc MDEV-6353 my_ismbchar() and my_mbcharlen() refactoring 2016-05-17 15:27:10 +04:00
create_options.h
custom_conf.h
datadict.cc
datadict.h
debug_sync.cc MDEV-6353 my_ismbchar() and my_mbcharlen() refactoring 2016-05-17 15:27:10 +04:00
debug_sync.h MDEV-6353 my_ismbchar() and my_mbcharlen() refactoring 2016-05-17 15:27:10 +04:00
derror.cc Merge branch '10.2' into bb-10.2-mdev9543 2016-04-07 00:54:39 +03:00
derror.h Added new range of MariaDB error messages, starting from 3000 2016-04-05 18:00:03 +03:00
des_key_file.cc
des_key_file.h
discover.cc fix extension_based_table_discovery for partitioned tables 2016-03-21 11:43:19 +01:00
discover.h
encryption.cc
event_data_objects.cc
event_data_objects.h
event_db_repository.cc Merge branch '10.1' into 10.2 2016-03-23 22:36:46 +01:00
event_db_repository.h
event_parse_data.cc
event_parse_data.h
event_queue.cc
event_queue.h
event_scheduler.cc cleanup: thread_count 2016-06-04 09:06:00 +02:00
event_scheduler.h
events.cc Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
events.h
field.cc MDEV-10138 Support for decimals up to 38 digits 2016-06-22 22:04:55 +03:00
field.h MDEV-10138 Support for decimals up to 38 digits 2016-06-22 22:04:55 +03:00
field_conv.cc Merge branch '10.1' into 10.2 2016-03-23 22:36:46 +01:00
filesort.cc MDEV-9847: Window functions: crash with big_tables=1 2016-04-06 20:34:23 +03:00
filesort.h MDEV-9847: Window functions: crash with big_tables=1 2016-04-06 20:34:23 +03:00
filesort_utils.cc Removed TABLE->sort to make it possible to have multiple active calls to 2016-03-22 23:44:52 +02:00
filesort_utils.h Removed TABLE->sort to make it possible to have multiple active calls to 2016-03-22 23:44:52 +02:00
gcalc_slicescan.cc
gcalc_slicescan.h
gcalc_tools.cc
gcalc_tools.h
gen_lex_hash.cc
gen_lex_token.cc
group_by_handler.cc
group_by_handler.h
gstream.cc
gstream.h
ha_partition.cc Merge branch '10.1' into 10.2 2016-03-23 22:36:46 +01:00
ha_partition.h
handler.cc Merge pull request #181 from ottok/ok-debpkg-10.2 2016-06-14 16:43:08 +04:00
handler.h fix XID comparison 2016-06-04 09:06:00 +02:00
hash_filo.cc
hash_filo.h
hostname.cc
hostname.h
init.cc
init.h
innodb_priv.h
item.cc Window functions: handle window functions as arguments to other functions 2016-04-10 10:13:55 +02:00
item.h MDEV-10138 Support for decimals up to 38 digits 2016-06-22 22:04:55 +03:00
item_buff.cc
item_cmpfunc.cc Merge branch '10.2' into bb-10.2-mdev9543 2016-04-07 00:54:39 +03:00
item_cmpfunc.h Merge branch '10.2' into bb-10.2-mdev9543 2016-03-28 22:18:38 +03:00
item_create.cc
item_create.h
item_func.cc MDEV-10138 Support for decimals up to 38 digits 2016-06-22 22:04:55 +03:00
item_func.h Merge branch '10.2' into bb-10.2-mdev9543 2016-03-28 22:18:38 +03:00
item_geofunc.cc
item_geofunc.h
item_inetfunc.cc
item_inetfunc.h
item_row.cc
item_row.h Merge branch '10.2' into bb-10.2-mdev9543 2016-03-28 22:18:38 +03:00
item_strfunc.cc
item_strfunc.h
item_subselect.cc General spell fixing in comments and strings 2016-06-08 14:17:23 +03:00
item_subselect.h Removed TABLE->sort to make it possible to have multiple active calls to 2016-03-22 23:44:52 +02:00
item_sum.cc MDEV-10138 Support for decimals up to 38 digits 2016-06-22 22:04:55 +03:00
item_sum.h Implement ntile window function. 2016-04-04 22:04:18 +03:00
item_timefunc.cc
item_timefunc.h
item_windowfunc.cc Fix another bug in dense_rank. 2016-04-13 10:39:06 +02:00
item_windowfunc.h Make ntile use args[0] for it's argument. 2016-04-13 11:26:58 +02:00
item_xmlfunc.cc
item_xmlfunc.h
key.cc MDEV-8360 Clean-up CHARSET_INFO: strnncollsp: diff_if_only_endspace_difference 2016-03-31 11:04:48 +04:00
key.h
keycaches.cc
keycaches.h
lex.h Implement ntile window function. 2016-04-04 22:04:18 +03:00
lex_symbol.h
lock.cc
lock.h
log.cc General spell fixing in comments and strings 2016-06-08 14:17:23 +03:00
log.h stop binlog background thread together with others 2016-06-04 09:06:00 +02:00
log_event.cc Merge pull request #181 from ottok/ok-debpkg-10.2 2016-06-14 16:43:08 +04:00
log_event.h
log_event_old.cc Merge branch '10.0' into 10.1 2016-03-21 13:02:53 +01:00
log_event_old.h
log_slow.h
main.cc
mdl.cc
mdl.h
mem_root_array.h
message.h
message.mc
message.rc
mf_iocache.cc
mf_iocache_encr.cc
MSG00001.bin
multi_range_read.cc
multi_range_read.h
my_apc.cc Merge branch '10.0' into 10.1 2016-03-21 13:02:53 +01:00
my_apc.h
my_decimal.cc
my_decimal.h
my_json_writer.cc
my_json_writer.h
mysql_install_db.cc
mysql_upgrade_service.cc
mysqld.cc Merge pull request #181 from ottok/ok-debpkg-10.2 2016-06-14 16:43:08 +04:00
mysqld.h cleanup: thread_count 2016-06-04 09:06:00 +02:00
mysqld_suffix.h
net_serv.cc MDEV-9058: protocol: COM_MULTI command (part 2) 2016-03-18 17:25:29 +01:00
nt_servc.cc
nt_servc.h
opt_index_cond_pushdown.cc
opt_range.cc General spell fixing in comments and strings 2016-06-08 14:17:23 +03:00
opt_range.h Removed TABLE->sort to make it possible to have multiple active calls to 2016-03-22 23:44:52 +02:00
opt_range_mrr.cc
opt_subselect.cc Merge branch '10.2' into bb-10.2-mdev9543 2016-04-07 00:54:39 +03:00
opt_subselect.h
opt_sum.cc
opt_table_elimination.cc The implementation of the template bubble_sort assumed 2016-04-01 12:00:54 -07:00
parse_file.cc General spell fixing in comments and strings 2016-06-08 14:17:23 +03:00
parse_file.h
partition_element.h
partition_info.cc
partition_info.h
password.c
plistsort.c
procedure.cc
procedure.h
protocol.cc MDEV-10138 Support for decimals up to 38 digits 2016-06-22 22:04:55 +03:00
protocol.h MDEV-9947: COM_MULTI united response 2016-05-17 13:31:33 +02:00
records.cc Merge branch '10.2' into bb-10.2-mdev9543 2016-03-28 22:18:38 +03:00
records.h Removed TABLE->sort to make it possible to have multiple active calls to 2016-03-22 23:44:52 +02:00
repl_failsafe.cc
repl_failsafe.h
replication.h
rpl_constants.h
rpl_filter.cc
rpl_filter.h
rpl_gtid.cc Final fixes for Memory_used 2016-04-28 17:15:38 +03:00
rpl_gtid.h Final fixes for Memory_used 2016-04-28 17:15:38 +03:00
rpl_handler.cc
rpl_handler.h
rpl_injector.cc
rpl_injector.h
rpl_mi.cc MDEV-9383: Server fails to read master.info after upgrade 10.0 -> 10.1 2016-04-08 10:31:03 +02:00
rpl_mi.h
rpl_parallel.cc Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
rpl_parallel.h Merge branch '10.0' into 10.1 2016-03-21 13:02:53 +01:00
rpl_record.cc Merge branch '10.0' into 10.1 2016-03-21 13:02:53 +01:00
rpl_record.h
rpl_record_old.cc
rpl_record_old.h
rpl_reporting.cc
rpl_reporting.h
rpl_rli.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
rpl_rli.h MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
rpl_tblmap.cc
rpl_tblmap.h
rpl_utility.cc
rpl_utility.h
scheduler.cc cleanup: thread_count 2016-06-04 09:06:00 +02:00
scheduler.h
set_var.cc Cleanups 2016-04-28 16:36:02 +03:00
set_var.h Cleanups 2016-04-28 16:36:02 +03:00
sha2.cc
signal_handler.cc Merge branch '10.1' into 10.2 2016-03-23 22:36:46 +01:00
slave.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
slave.h
sp.cc Followup for 2783fc7: return an error to the caller if mysql.proc cannot be opened 2016-03-24 09:45:28 +01:00
sp.h MDEV-717 LP:1003679 - Wrong binlog order on concurrent DROP schema and CREATE function. 2016-03-23 12:16:39 +04:00
sp_cache.cc
sp_cache.h
sp_head.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sp_head.h Merge branch '10.1' into 10.2 2016-03-23 22:36:46 +01:00
sp_pcontext.cc
sp_pcontext.h
sp_rcontext.cc
sp_rcontext.h
spatial.cc
spatial.h General spell fixing in comments and strings 2016-06-08 14:17:23 +03:00
sql_acl.cc Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
sql_acl.h
sql_admin.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sql_admin.h
sql_alter.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sql_alter.h
sql_analyse.cc MDEV-10138 Support for decimals up to 38 digits 2016-06-22 22:04:55 +03:00
sql_analyse.h
sql_analyze_stmt.cc MDEV-8646: Re-engineer the code for post-join operations 2016-03-28 12:02:56 +03:00
sql_analyze_stmt.h MDEV-8646: Re-engineer the code for post-join operations 2016-03-28 12:02:56 +03:00
sql_array.h Cleanups 2016-04-28 16:36:02 +03:00
sql_audit.cc Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
sql_audit.h fix most annoying warnings on Windows 2016-03-22 18:46:02 +01:00
sql_base.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:44 -04:00
sql_base.h MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sql_binlog.cc
sql_binlog.h
sql_bitmap.h
sql_bootstrap.cc
sql_bootstrap.h
sql_builtin.cc.in
sql_cache.cc Merge pull request #181 from ottok/ok-debpkg-10.2 2016-06-14 16:43:08 +04:00
sql_cache.h
sql_callback.h
sql_class.cc Merge pull request #181 from ottok/ok-debpkg-10.2 2016-06-14 16:43:08 +04:00
sql_class.h MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sql_client.cc
sql_cmd.h
sql_connect.cc cleanup: thread_count 2016-06-04 09:06:00 +02:00
sql_connect.h Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
sql_const.h Increase value of thread_cache_size to 32 2016-03-22 23:44:52 +02:00
sql_crypt.cc
sql_crypt.h
sql_cte.cc Fixed bug mdev-9937. 2016-04-20 10:55:53 -07:00
sql_cte.h
sql_cursor.cc
sql_cursor.h
sql_db.cc Merge pull request #181 from ottok/ok-debpkg-10.2 2016-06-14 16:43:08 +04:00
sql_db.h
sql_delete.cc MDEV-9847: Window functions: crash with big_tables=1 2016-04-06 20:34:23 +03:00
sql_delete.h
sql_derived.cc MDEV-3944: Allow derived tables in VIEWS 2016-05-28 14:44:21 +02:00
sql_derived.h
sql_digest.cc
sql_digest.h
sql_digest_stream.h
sql_do.cc
sql_do.h
sql_error.cc MDEV-9947: COM_MULTI united response 2016-05-17 13:31:33 +02:00
sql_error.h MDEV-9947: COM_MULTI united response 2016-05-17 13:31:33 +02:00
sql_explain.cc MDEV-9848: Window functions: reuse sorting and/or scanning 2016-04-05 19:10:44 +03:00
sql_explain.h Window functions: Better class names 2016-04-06 18:24:11 +03:00
sql_expression_cache.cc
sql_expression_cache.h
sql_get_diagnostics.cc
sql_get_diagnostics.h
sql_handler.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sql_handler.h
sql_help.cc Removed TABLE->sort to make it possible to have multiple active calls to 2016-03-22 23:44:52 +02:00
sql_help.h
sql_hset.h
sql_insert.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sql_insert.h
sql_join_cache.cc Merge branch '10.0' into 10.1 2016-03-21 13:02:53 +01:00
sql_join_cache.h
sql_lex.cc MDEV-3944: Allow derived tables in VIEWS 2016-05-28 14:44:21 +02:00
sql_lex.h MDEV-3944: Allow derived tables in VIEWS 2016-05-28 14:44:21 +02:00
sql_lifo_buffer.h
sql_list.cc
sql_list.h fix the method name 2016-06-04 09:06:00 +02:00
sql_load.cc Merge branch '10.2' into bb-10.2-mdev9543 2016-04-07 00:54:39 +03:00
sql_load.h
sql_locale.cc
sql_locale.h Added new range of MariaDB error messages, starting from 3000 2016-04-05 18:00:03 +03:00
sql_manager.cc
sql_manager.h
sql_parse.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sql_parse.h MDEV-9947: COM_MULTI united response 2016-05-17 13:31:33 +02:00
sql_partition.cc
sql_partition.h
sql_partition_admin.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sql_partition_admin.h
sql_plist.h
sql_plugin.cc Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
sql_plugin.h
sql_plugin_compat.h
sql_plugin_services.ic
sql_prepare.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sql_prepare.h MDEV-9058: protocol: COM_MULTI command (part 3) 2016-03-18 18:25:37 +01:00
sql_priv.h MDEV-9792 Backport MDEV-8713 to 10.1. 2016-04-27 11:08:46 +04:00
sql_profile.cc Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
sql_profile.h Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
sql_reload.cc Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
sql_reload.h
sql_rename.cc
sql_rename.h
sql_repl.cc Final fixes for Memory_used 2016-04-28 17:15:38 +03:00
sql_repl.h
sql_select.cc General spell fixing in comments and strings 2016-06-08 14:17:23 +03:00
sql_select.h Fixed bug mdev-9897. 2016-04-14 00:47:28 -07:00
sql_servers.cc Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
sql_servers.h
sql_show.cc Merge pull request #181 from ottok/ok-debpkg-10.2 2016-06-14 16:43:08 +04:00
sql_show.h Fixed wrong counting of global Memory_used 2016-04-28 13:39:55 +03:00
sql_signal.cc
sql_signal.h
sql_sort.h Removed TABLE->sort to make it possible to have multiple active calls to 2016-03-22 23:44:52 +02:00
sql_state.c
sql_statistics.cc Removed TABLE->sort to make it possible to have multiple active calls to 2016-03-22 23:44:52 +02:00
sql_statistics.h
sql_string.cc MDEV-10138 Support for decimals up to 38 digits 2016-06-22 22:04:55 +03:00
sql_string.h
sql_table.cc MDEV-10138 Support for decimals up to 38 digits 2016-06-22 22:04:55 +03:00
sql_table.h
sql_tablespace.cc
sql_tablespace.h
sql_test.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sql_test.h
sql_time.cc
sql_time.h
sql_trigger.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sql_trigger.h
sql_truncate.cc
sql_truncate.h
sql_type.cc
sql_type.h
sql_udf.cc Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
sql_udf.h
sql_union.cc Merge branch '10.2' into bb-10.2-mdev9543 2016-03-28 22:18:38 +03:00
sql_union.h
sql_update.cc MDEV-3944: Allow derived tables in VIEWS 2016-05-28 14:44:21 +02:00
sql_update.h
sql_view.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sql_view.h
sql_window.cc Cleanups 2016-04-28 16:36:02 +03:00
sql_window.h Cleanups 2016-04-28 16:36:02 +03:00
sql_yacc.yy General spell fixing in comments and strings 2016-06-08 14:17:23 +03:00
strfunc.cc MDEV-8360 Clean-up CHARSET_INFO: strnncollsp: diff_if_only_endspace_difference 2016-03-31 11:04:48 +04:00
strfunc.h
structs.h
sys_vars.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
sys_vars.ic MDEV-6353 my_ismbchar() and my_mbcharlen() refactoring 2016-05-17 15:27:10 +04:00
sys_vars_shared.h
table.cc MDEV-10138 Support for decimals up to 38 digits 2016-06-22 22:04:55 +03:00
table.h Merge pull request #181 from ottok/ok-debpkg-10.2 2016-06-14 16:43:08 +04:00
table_cache.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
table_cache.h MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
temporary_tables.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
thr_malloc.cc
thr_malloc.h
threadpool.h
threadpool_common.cc cleanup: thread_count 2016-06-04 09:06:00 +02:00
threadpool_unix.cc
threadpool_win.cc MDEV-9154 : Remove workarounds (mainly dynamic function loading) 2016-06-01 20:29:10 +02:00
transaction.cc
transaction.h
tzfile.h
tztime.cc Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
tztime.h
udf_example.c
udf_example.def
uniques.cc Removed TABLE->sort to make it possible to have multiple active calls to 2016-03-22 23:44:52 +02:00
uniques.h Removed TABLE->sort to make it possible to have multiple active calls to 2016-03-22 23:44:52 +02:00
unireg.cc
unireg.h Added new range of MariaDB error messages, starting from 3000 2016-04-05 18:00:03 +03:00
winservice.c
winservice.h
wsrep_applier.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
wsrep_applier.h
wsrep_binlog.cc
wsrep_binlog.h
wsrep_check_opts.cc
wsrep_dummy.cc
wsrep_hton.cc
wsrep_mysqld.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
wsrep_mysqld.h
wsrep_notify.cc
wsrep_priv.h MDEV-6368: assertion xid_seqno > trx_sys_cur_xid_seqno 2016-05-31 20:37:00 -04:00
wsrep_sst.cc MDEV-6368: assertion xid_seqno > trx_sys_cur_xid_seqno 2016-05-31 20:37:00 -04:00
wsrep_sst.h MDEV-6368: assertion xid_seqno > trx_sys_cur_xid_seqno (postfix) 2016-06-01 13:15:38 -04:00
wsrep_thd.cc MDEV-5535: Cannot reopen temporary table 2016-06-10 18:39:43 -04:00
wsrep_thd.h
wsrep_utils.cc Reuse THD for new user connections 2016-06-04 09:06:00 +02:00
wsrep_utils.h Final fixes for Memory_used 2016-04-28 17:15:38 +03:00
wsrep_var.cc MDEV-6368: assertion xid_seqno > trx_sys_cur_xid_seqno 2016-05-31 20:37:00 -04:00
wsrep_var.h MDEV-6368: assertion xid_seqno > trx_sys_cur_xid_seqno 2016-05-31 20:37:00 -04:00
wsrep_xid.cc MDEV-6368: assertion xid_seqno > trx_sys_cur_xid_seqno 2016-05-31 20:37:00 -04:00
wsrep_xid.h MDEV-6368: assertion xid_seqno > trx_sys_cur_xid_seqno 2016-05-31 20:37:00 -04:00