mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
4dabfa5de7
into mysql.com:/home/kent/bk/main/mysql-5.1 BUILD/Makefile.am: Auto merged BitKeeper/deleted/.del-ArrayFifoList.hpp~7036ae04dd7e7bd2: Auto merged BitKeeper/deleted/.del-ArrayList.hpp~44695d09b1a02179: Auto merged BitKeeper/deleted/.del-DbtupLCP.cpp~855b1ed3fbc86a42: Auto merged BitKeeper/deleted/.del-DbtupSystemRestart.cpp~15b54d7e4e75d2d: Auto merged BitKeeper/deleted/.del-DbtupUndoLog.cpp~5a2ef6e86b1404e9: Auto merged Makefile.am: Auto merged BitKeeper/deleted/.del-Makefile.am~2: Auto merged BitKeeper/deleted/.del-Makefile.am~ab5c84d46412dc2e: Auto merged BitKeeper/deleted/.del-Makefile.am~abb265028eb9b6a7: Auto merged BitKeeper/deleted/.del-Makefile.am~de166d6fcac3b9b6: Auto merged BitKeeper/deleted/.del-Makefile.am~e5b911533dad2713: Auto merged BitKeeper/deleted/.del-Makefile.am~ead19441cc5ff35c: Auto merged BitKeeper/deleted/.del-Makefile.am~f87185e232d7c4f: Auto merged BitKeeper/deleted/.del-Makefile.in: Auto merged BitKeeper/deleted/.del-MemoryChannelOSE.hpp: Auto merged BitKeeper/deleted/.del-MetaData.cpp~146ae9865dd35829: Auto merged BitKeeper/deleted/.del-MetaData.hpp~538342afcd8ac53c: Auto merged BitKeeper/deleted/.del-NdbCondition.c~ad83464328ab37af: Auto merged BitKeeper/deleted/.del-NdbCondition.c~ee56562abdd718cf: Auto merged BitKeeper/deleted/.del-NdbConditionOSE.h~455dd2c29c2e6344: Auto merged BitKeeper/deleted/.del-NdbDaemon.c~3b8101f376b28df: Auto merged BitKeeper/deleted/.del-NdbEnv.c~207f9ce9754c9e8a: Auto merged BitKeeper/deleted/.del-NdbEnv.c~bb6fe7572d45288a: Auto merged BitKeeper/deleted/.del-NdbErrHnd.cpp: Auto merged BitKeeper/deleted/.del-NdbHost.c~2c29816c77396d7b: Auto merged BitKeeper/deleted/.del-NdbHost.c~cf18d6b3c825180c: Auto merged BitKeeper/deleted/.del-NdbMem.c~6285b159985d46da: Auto merged BitKeeper/deleted/.del-NdbMem.c~6c2b317c1ce230ab: Auto merged BitKeeper/deleted/.del-NdbMem_SoftOse.cpp~9c61e311ec168d44: Auto merged BitKeeper/deleted/.del-NdbMutex.c~768131269bccca10: Auto merged BitKeeper/deleted/.del-NdbMutex.c~f4bdd19be08b84ab: Auto merged BitKeeper/deleted/.del-NdbOut.cpp~8caa99a0d729540c: Auto merged BitKeeper/deleted/.del-NdbSleep.c~b643ea3e7103eb62: Auto merged BitKeeper/deleted/.del-NdbSleep.c~b88fbc5b140de10d: Auto merged BitKeeper/deleted/.del-NdbTCP.c~1e9f416992352f6d: Auto merged BitKeeper/deleted/.del-NdbTCP.c~b09cdcbef3ea2c57: Auto merged BitKeeper/deleted/.del-NdbThread.c~2fe1fa5f47801772: Auto merged BitKeeper/deleted/.del-NdbThread.c~fe71a67b5c3a4724: Auto merged BitKeeper/deleted/.del-NdbTick.c~aa6385567216509d: Auto merged BitKeeper/deleted/.del-NdbTick.c~b76feba2cf1493d1: Auto merged BitKeeper/deleted/.del-OSE_Receiver.cpp: Auto merged BitKeeper/deleted/.del-OSE_Receiver.hpp: Auto merged BitKeeper/deleted/.del-OSE_Signals.hpp: Auto merged BitKeeper/deleted/.del-OSE_Transporter.cpp: Auto merged BitKeeper/deleted/.del-OSE_Transporter.hpp: Auto merged BitKeeper/deleted/.del-TraceNdbApi.hpp~7a7f0ae5b70358bc: Auto merged BitKeeper/deleted/.del-VerifyNdbApi.hpp~f417f78f7cd05935: Auto merged BitKeeper/deleted/.del-bcd.h~81fbfcc1530534da: Auto merged BitKeeper/deleted/.del-config-os2.h~a16b51851ddd317b: Auto merged BitKeeper/deleted/.del-dbGenerator.c~7509c19f70cad0bf: Auto merged BitKeeper/deleted/.del-dbGenerator.h~63f1aeb98260bcb7: Auto merged BitKeeper/deleted/.del-dbGenerator.h~e1aaa6725999d458: Auto merged BitKeeper/deleted/.del-dbPopulate.c~5dcff1c99783d83b: Auto merged BitKeeper/deleted/.del-dbPopulate.h~229a894b59d4da73: Auto merged BitKeeper/deleted/.del-ha_berkeley.cc: Auto merged BitKeeper/deleted/.del-ha_berkeley.h: Auto merged BitKeeper/deleted/.del-localDbPrepare.c~33a2c46afc8fac9a: Auto merged BitKeeper/deleted/.del-macros.h~58097d584e29b5df: Auto merged BitKeeper/deleted/.del-macros.h~742871fab0681964: Auto merged BitKeeper/deleted/.del-mainGenerator.c~2d1c8016f72b2517: Auto merged BitKeeper/deleted/.del-mainPopulate.c~37def9a44980b8ec: Auto merged BitKeeper/deleted/.del-mgmapi_logevent.cpp~f1e7cf3e70edc4: Auto merged BitKeeper/deleted/.del-mmslist.cpp: Auto merged BitKeeper/deleted/.del-my_lread.c: Auto merged BitKeeper/deleted/.del-my_lwrite.c: Auto merged BitKeeper/deleted/.del-my_os2cond.c~e3b520af1c371bb5: Auto merged BitKeeper/deleted/.del-my_os2dirsrch.c~4e2479b2abb2eb5a: Auto merged BitKeeper/deleted/.del-my_os2dirsrch.h~5011cbc657537d0: Auto merged BitKeeper/deleted/.del-my_os2dlfcn.c~6d94b488717683dd: Auto merged BitKeeper/deleted/.del-my_os2dlfcn.h0~eae8edb8555eff87: Auto merged BitKeeper/deleted/.del-my_os2file64.c~251fb8a1e950c31b: Auto merged BitKeeper/deleted/.del-my_os2thread.c~65dca991548cec2a: Auto merged BitKeeper/deleted/.del-my_os2tls.c~58ade7a0f70ad5ea: Auto merged BitKeeper/deleted/.del-mysqlmanager-pwgen.c~d8f5f91ec54432b9: Auto merged BitKeeper/deleted/.del-mysqlmanager.c~e97636d71145a0b: Auto merged BitKeeper/deleted/.del-mysqlmanagerc.c~4f6e3499e68508f6: Auto merged BitKeeper/deleted/.del-ndb_error.hpp~24468bb7f20a0b41: Auto merged BitKeeper/deleted/.del-ndb_error.hpp~45a2fef922beae3: Auto merged BitKeeper/deleted/.del-ndb_schema.hpp~de9c21185d6bfe4e: Auto merged BitKeeper/deleted/.del-ndbapi_async.cpp~319189569fb659ec: Auto merged BitKeeper/deleted/.del-ndbapi_async1.cpp~2995dac9b963a0d: Auto merged BitKeeper/deleted/.del-ndbapi_event.cpp~c5d949802966180: Auto merged BitKeeper/deleted/.del-ndbapi_retries.cpp~7301496d8c1c310a: Auto merged BitKeeper/deleted/.del-ndbapi_scan.cpp~14ed2aa9a5d9e597: Auto merged BitKeeper/deleted/.del-ndbapi_simple.cpp~80962179f3c2f5b8: Auto merged BitKeeper/deleted/.del-ndbapi_simple_index.cpp~4b95a4d71808b5b6: Auto merged BitKeeper/deleted/.del-print-limit-table~b8e808031daa3758: Auto merged BitKeeper/deleted/.del-raid.cc~488f5fa6538394e1: Auto merged BitKeeper/deleted/.del-raid.h~2d2503a66b128ac6: Auto merged BitKeeper/deleted/.del-raid2.c~fe7aea5fb4b9748c: Auto merged BitKeeper/deleted/.del-sql_manager.h: Auto merged BitKeeper/deleted/.del-testData.h~696038ea2623a90b: Auto merged BitKeeper/deleted/.del-testData.h~898b71d7c639319e: Auto merged BitKeeper/deleted/.del-testDefinitions.h~f18a4553579a3725: Auto merged BitKeeper/deleted/.del-userHandle.h~3275bb415e1ca2c2: Auto merged BitKeeper/deleted/.del-userHandle.h~ec22dc7a7ed2f81b: Auto merged BitKeeper/deleted/.del-userInterface.cpp~82ee612ab14b3d48: Auto merged BitKeeper/deleted/.del-userInterface.c~92a20032f7d1e91: Auto merged BitKeeper/deleted/.del-userInterface.h~1f76ad2f28b283fd: Auto merged BitKeeper/deleted/.del-userInterface.h~49139f029bbdaabc: Auto merged BitKeeper/deleted/.del-userTransaction.c~438012ecc761b776: Auto merged BitKeeper/deleted/.del-userTransaction.c~f50661b4f54b0bdd: Auto merged BitKeeper/deleted/.del-utv.h~f64af026b9705ebb: Auto merged BitKeeper/deleted/.del-vcdrfunc.h~85803875180684cd: Auto merged BitKeeper/deleted/.del-waiter.cpp~b188e4bfddf2cf98: Auto merged Docs/Makefile.am: Auto merged client/Makefile.am: Auto merged client/client_priv.h: Auto merged client/get_password.c: Auto merged client/mysql.cc: Auto merged client/mysql_upgrade.c: Auto merged client/mysqladmin.cc: Auto merged client/mysqlbinlog.cc: Auto merged client/mysqlcheck.c: Auto merged client/mysqldump.c: Auto merged client/mysqlimport.c: Auto merged client/mysqlshow.c: Auto merged client/mysqltest.c: Auto merged dbug/Makefile.am: Auto merged extra/Makefile.am: Auto merged extra/comp_err.c: Auto merged extra/perror.c: Auto merged extra/replace.c: Auto merged extra/resolveip.c: Auto merged include/Makefile.am: Auto merged include/base64.h: Auto merged include/config-netware.h: Auto merged include/config-win.h: Auto merged include/decimal.h: Auto merged include/errmsg.h: Auto merged include/ft_global.h: Auto merged include/heap.h: Auto merged include/m_ctype.h: Auto merged include/m_string.h: Auto merged include/my_base.h: Auto merged include/my_bitmap.h: Auto merged include/my_dbug.h: Auto merged include/my_global.h: Auto merged include/my_net.h: Auto merged include/my_no_pthread.h: Auto merged include/my_nosys.h: Auto merged include/my_pthread.h: Auto merged include/my_sys.h: Auto merged include/my_time.h: Auto merged include/my_tree.h: Auto merged include/my_xml.h: Auto merged include/myisam.h: Auto merged include/myisammrg.h: Auto merged include/mysql.h: Auto merged include/mysql_com.h: Auto merged include/mysys_err.h: Auto merged include/queues.h: Auto merged include/thr_alarm.h: Auto merged include/thr_lock.h: Auto merged include/violite.h: Auto merged libmysqld/Makefile.am: Auto merged libmysqld/emb_qcache.cc: Auto merged libmysqld/embedded_priv.h: Auto merged libmysqld/examples/Makefile.am: Auto merged libmysqld/libmysqld.c: Auto merged mysql-test/Makefile.am: Auto merged mysys/Makefile.am: Auto merged mysys/array.c: Auto merged mysys/base64.c: Auto merged mysys/charset-def.c: Auto merged mysys/default.c: Auto merged mysys/default_modify.c: Auto merged mysys/errors.c: Auto merged mysys/hash.c: Auto merged mysys/mf_dirname.c: Auto merged mysys/mf_format.c: Auto merged mysys/mf_iocache.c: Auto merged mysys/mf_iocache2.c: Auto merged mysys/mf_keycache.c: Auto merged mysys/mf_pack.c: Auto merged mysys/mf_path.c: Auto merged mysys/mf_tempdir.c: Auto merged mysys/mf_tempfile.c: Auto merged mysys/my_access.c: Auto merged mysys/my_alloc.c: Auto merged mysys/my_append.c: Auto merged mysys/my_bit.c: Auto merged mysys/my_bitmap.c: Auto merged mysys/my_clock.c: Auto merged mysys/my_compress.c: Auto merged mysys/my_copy.c: Auto merged mysys/my_create.c: Auto merged mysys/my_dup.c: Auto merged mysys/my_error.c: Auto merged mysys/my_file.c: Auto merged mysys/my_gethostbyname.c: Auto merged mysys/my_getopt.c: Auto merged mysys/my_getwd.c: Auto merged mysys/my_handler.c: Auto merged mysys/my_init.c: Auto merged mysys/my_lib.c: Auto merged mysys/my_lock.c: Auto merged mysys/my_malloc.c: Auto merged mysys/my_mkdir.c: Auto merged mysys/my_mmap.c: Auto merged mysys/my_net.c: Auto merged mysys/my_once.c: Auto merged mysys/my_open.c: Auto merged mysys/my_pread.c: Auto merged mysys/my_pthread.c: Auto merged mysys/my_redel.c: Auto merged mysys/my_rename.c: Auto merged mysys/my_seek.c: Auto merged mysys/my_sleep.c: Auto merged mysys/my_static.c: Auto merged mysys/my_symlink2.c: Auto merged mysys/my_thr_init.c: Auto merged mysys/mysys_priv.h: Auto merged mysys/ptr_cmp.c: Auto merged mysys/queues.c: Auto merged mysys/safemalloc.c: Auto merged mysys/string.c: Auto merged mysys/test_dir.c: Auto merged mysys/testhash.c: Auto merged mysys/thr_alarm.c: Auto merged mysys/thr_lock.c: Auto merged mysys/thr_mutex.c: Auto merged regex/Makefile.am: Auto merged scripts/Makefile.am: Auto merged server-tools/instance-manager/Makefile.am: Auto merged server-tools/instance-manager/buffer.cc: Auto merged server-tools/instance-manager/command.cc: Auto merged server-tools/instance-manager/command.h: Auto merged server-tools/instance-manager/commands.cc: Auto merged server-tools/instance-manager/commands.h: Auto merged server-tools/instance-manager/guardian.cc: Auto merged server-tools/instance-manager/guardian.h: Auto merged server-tools/instance-manager/instance.cc: Auto merged server-tools/instance-manager/instance.h: Auto merged server-tools/instance-manager/instance_map.cc: Auto merged server-tools/instance-manager/instance_map.h: Auto merged server-tools/instance-manager/instance_options.cc: Auto merged server-tools/instance-manager/instance_options.h: Auto merged server-tools/instance-manager/listener.cc: Auto merged server-tools/instance-manager/listener.h: Auto merged server-tools/instance-manager/log.cc: Auto merged server-tools/instance-manager/log.h: Auto merged server-tools/instance-manager/manager.cc: Auto merged server-tools/instance-manager/manager.h: Auto merged server-tools/instance-manager/messages.cc: Auto merged server-tools/instance-manager/mysql_connection.cc: Auto merged server-tools/instance-manager/mysql_connection.h: Auto merged server-tools/instance-manager/mysql_manager_error.h: Auto merged server-tools/instance-manager/mysqlmanager.cc: Auto merged server-tools/instance-manager/options.cc: Auto merged server-tools/instance-manager/options.h: Auto merged server-tools/instance-manager/parse.cc: Auto merged server-tools/instance-manager/parse.h: Auto merged server-tools/instance-manager/parse_output.cc: Auto merged server-tools/instance-manager/parse_output.h: Auto merged server-tools/instance-manager/priv.cc: Auto merged server-tools/instance-manager/priv.h: Auto merged server-tools/instance-manager/protocol.cc: Auto merged server-tools/instance-manager/protocol.h: Auto merged server-tools/instance-manager/thread_registry.cc: Auto merged server-tools/instance-manager/thread_registry.h: Auto merged server-tools/instance-manager/user_map.cc: Auto merged server-tools/instance-manager/user_map.h: Auto merged sql/Makefile.am: Auto merged sql/discover.cc: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/field_conv.cc: Auto merged sql/filesort.cc: Auto merged sql/gen_lex_hash.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/hostname.cc: Auto merged sql/init.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_create.cc: Auto merged sql/item_create.h: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_geofunc.cc: Auto merged sql/item_geofunc.h: Auto merged sql/item_row.cc: Auto merged sql/item_row.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/item_subselect.cc: Auto merged sql/item_subselect.h: Auto merged sql/item_sum.cc: Auto merged sql/item_sum.h: Auto merged sql/item_timefunc.cc: Auto merged sql/item_timefunc.h: Auto merged sql/item_uniq.cc: Auto merged sql/key.cc: Auto merged sql/lex.h: Auto merged sql/lex_symbol.h: Auto merged sql/lock.cc: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/log_event.h: Auto merged sql/my_decimal.cc: Auto merged sql/my_decimal.h: Auto merged sql/my_lock.c: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/net_serv.cc: Auto merged sql/opt_range.cc: Auto merged sql/opt_range.h: Auto merged sql/opt_sum.cc: Auto merged sql/parse_file.cc: Auto merged sql/parse_file.h: Auto merged sql/password.c: Auto merged sql/procedure.h: Auto merged sql/protocol.cc: Auto merged sql/protocol.h: Auto merged sql/records.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged sql/slave.cc: Auto merged sql/slave.h: Auto merged sql/sp.cc: Auto merged sql/sp.h: Auto merged sql/sp_cache.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/spatial.cc: Auto merged sql/spatial.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_acl.h: Auto merged sql/sql_analyse.cc: Auto merged sql/sql_analyse.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_bitmap.h: Auto merged sql/sql_cache.cc: Auto merged sql/sql_cache.h: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_crypt.cc: Auto merged sql/sql_cursor.cc: Auto merged sql/sql_db.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_derived.cc: Auto merged sql/sql_do.cc: Auto merged sql/sql_error.cc: Auto merged sql/sql_error.h: Auto merged sql/sql_handler.cc: Auto merged sql/sql_help.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_list.h: Auto merged sql/sql_load.cc: Auto merged sql/sql_manager.cc: Auto merged sql/sql_map.cc: Auto merged sql/sql_olap.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_rename.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_repl.h: Auto merged sql/sql_select.cc: Auto merged sql/sql_select.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_string.cc: Auto merged sql/sql_string.h: Auto merged sql/sql_table.cc: Auto merged sql/sql_test.cc: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_trigger.h: Auto merged sql/sql_udf.cc: Auto merged sql/sql_union.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_view.cc: Auto merged sql-bench/Makefile.am: Auto merged sql-bench/as3ap.sh: Auto merged sql-bench/bench-count-distinct.sh: Auto merged sql-bench/bench-init.pl.sh: Auto merged sql-bench/compare-results.sh: Auto merged sql-bench/copy-db.sh: Auto merged sql/share/charsets/Index.xml: Auto merged sql/share/charsets/cp1250.xml: Auto merged sql/sql_view.h: Auto merged sql/sql_yacc.yy: Auto merged sql/stacktrace.c: Auto merged sql/stacktrace.h: Auto merged sql/strfunc.cc: Auto merged sql/structs.h: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged sql/time.cc: Auto merged sql/tztime.cc: Auto merged sql/tztime.h: Auto merged sql/udf_example.c: Auto merged sql/unireg.cc: Auto merged sql/unireg.h: Auto merged sql-bench/crash-me.sh: Auto merged sql-bench/run-all-tests.sh: Auto merged sql-bench/server-cfg.sh: Auto merged sql-bench/test-ATIS.sh: Auto merged sql-bench/test-alter-table.sh: Auto merged sql-bench/test-big-tables.sh: Auto merged sql-bench/test-connect.sh: Auto merged sql-bench/test-create.sh: Auto merged sql-bench/test-insert.sh: Auto merged sql-bench/test-select.sh: Auto merged sql-bench/test-transactions.sh: Auto merged sql-bench/test-wisconsin.sh: Auto merged sql-common/client.c: Auto merged sql-common/my_time.c: Auto merged storage/archive/ha_archive.cc: Auto merged storage/archive/ha_archive.h: Auto merged storage/blackhole/ha_blackhole.cc: Auto merged storage/blackhole/ha_blackhole.h: Auto merged storage/csv/ha_tina.cc: Auto merged storage/csv/ha_tina.h: Auto merged storage/example/ha_example.cc: Auto merged storage/example/ha_example.h: Auto merged storage/federated/ha_federated.cc: Auto merged storage/federated/ha_federated.h: Auto merged storage/heap/Makefile.am: Auto merged storage/heap/_check.c: Auto merged storage/heap/_rectest.c: Auto merged storage/heap/ha_heap.cc: Auto merged storage/heap/ha_heap.h: Auto merged storage/heap/heapdef.h: Auto merged storage/heap/hp_block.c: Auto merged storage/heap/hp_clear.c: Auto merged storage/heap/hp_close.c: Auto merged storage/heap/hp_create.c: Auto merged storage/heap/hp_delete.c: Auto merged storage/heap/hp_extra.c: Auto merged storage/heap/hp_hash.c: Auto merged storage/heap/hp_info.c: Auto merged storage/heap/hp_open.c: Auto merged storage/heap/hp_panic.c: Auto merged storage/heap/hp_rename.c: Auto merged storage/heap/hp_rfirst.c: Auto merged storage/heap/hp_rkey.c: Auto merged storage/heap/hp_rlast.c: Auto merged storage/heap/hp_rnext.c: Auto merged storage/heap/hp_rprev.c: Auto merged storage/heap/hp_rrnd.c: Auto merged storage/heap/hp_rsame.c: Auto merged storage/heap/hp_scan.c: Auto merged storage/heap/hp_static.c: Auto merged storage/heap/hp_test1.c: Auto merged storage/heap/hp_test2.c: Auto merged storage/heap/hp_update.c: Auto merged storage/heap/hp_write.c: Auto merged storage/innobase/Makefile.am: Auto merged storage/innobase/btr/Makefile.am: Auto merged storage/innobase/buf/Makefile.am: Auto merged storage/innobase/data/Makefile.am: Auto merged storage/innobase/dict/Makefile.am: Auto merged storage/innobase/dyn/Makefile.am: Auto merged storage/innobase/eval/Makefile.am: Auto merged storage/innobase/fil/Makefile.am: Auto merged storage/innobase/fsp/Makefile.am: Auto merged storage/innobase/fut/Makefile.am: Auto merged storage/innobase/ha/Makefile.am: Auto merged storage/innobase/handler/ha_innodb.cc: Auto merged storage/innobase/handler/ha_innodb.h: Auto merged storage/innobase/ibuf/Makefile.am: Auto merged storage/innobase/lock/Makefile.am: Auto merged storage/innobase/log/Makefile.am: Auto merged storage/innobase/mach/Makefile.am: Auto merged storage/innobase/mem/Makefile.am: Auto merged storage/innobase/mtr/Makefile.am: Auto merged storage/innobase/os/Makefile.am: Auto merged storage/innobase/page/Makefile.am: Auto merged storage/innobase/pars/Makefile.am: Auto merged storage/innobase/que/Makefile.am: Auto merged storage/innobase/read/Makefile.am: Auto merged storage/innobase/rem/Makefile.am: Auto merged storage/innobase/row/Makefile.am: Auto merged storage/innobase/srv/Makefile.am: Auto merged storage/innobase/sync/Makefile.am: Auto merged storage/innobase/thr/Makefile.am: Auto merged storage/innobase/trx/Makefile.am: Auto merged storage/innobase/usr/Makefile.am: Auto merged storage/innobase/ut/Makefile.am: Auto merged storage/myisam/Makefile.am: Auto merged storage/myisam/ft_boolean_search.c: Auto merged storage/myisam/ft_eval.c: Auto merged storage/myisam/ft_eval.h: Auto merged storage/myisam/ft_nlq_search.c: Auto merged storage/myisam/ft_parser.c: Auto merged storage/myisam/ft_static.c: Auto merged storage/myisam/ft_stem.c: Auto merged storage/myisam/ft_stopwords.c: Auto merged storage/myisam/ft_test1.c: Auto merged storage/myisam/ft_test1.h: Auto merged storage/myisam/ft_update.c: Auto merged storage/myisam/ftdefs.h: Auto merged storage/myisam/fulltext.h: Auto merged storage/myisam/ha_myisam.cc: Auto merged storage/myisam/ha_myisam.h: Auto merged storage/myisam/mi_cache.c: Auto merged storage/myisam/mi_changed.c: Auto merged storage/myisam/mi_check.c: Auto merged storage/myisam/mi_checksum.c: Auto merged storage/myisam/mi_close.c: Auto merged storage/myisam/mi_create.c: Auto merged storage/myisam/mi_dbug.c: Auto merged storage/myisam/mi_delete.c: Auto merged storage/myisam/mi_delete_all.c: Auto merged storage/myisam/mi_delete_table.c: Auto merged storage/myisam/mi_dynrec.c: Auto merged storage/myisam/mi_extra.c: Auto merged storage/myisam/mi_info.c: Auto merged storage/myisam/mi_key.c: Auto merged storage/myisam/mi_keycache.c: Auto merged storage/myisam/mi_locking.c: Auto merged storage/myisam/mi_log.c: Auto merged storage/myisam/mi_open.c: Auto merged storage/myisam/mi_packrec.c: Auto merged storage/myisam/mi_page.c: Auto merged storage/myisam/mi_panic.c: Auto merged storage/myisam/mi_preload.c: Auto merged storage/myisam/mi_range.c: Auto merged storage/myisam/mi_rename.c: Auto merged storage/myisam/mi_rfirst.c: Auto merged storage/myisam/mi_rkey.c: Auto merged storage/myisam/mi_rlast.c: Auto merged storage/myisam/mi_rnext.c: Auto merged storage/myisam/mi_rnext_same.c: Auto merged storage/myisam/mi_rprev.c: Auto merged storage/myisam/mi_rrnd.c: Auto merged storage/myisam/mi_rsame.c: Auto merged storage/myisam/mi_rsamepos.c: Auto merged storage/myisam/mi_scan.c: Auto merged storage/myisam/mi_search.c: Auto merged storage/myisam/mi_static.c: Auto merged storage/myisam/mi_statrec.c: Auto merged storage/myisam/mi_test1.c: Auto merged storage/myisam/mi_test2.c: Auto merged storage/myisam/mi_test3.c: Auto merged storage/myisam/mi_unique.c: Auto merged storage/myisam/mi_update.c: Auto merged storage/myisam/mi_write.c: Auto merged storage/myisam/myisam_ftdump.c: Auto merged storage/myisam/myisamchk.c: Auto merged storage/myisam/myisamdef.h: Auto merged storage/myisam/myisamlog.c: Auto merged storage/myisam/myisampack.c: Auto merged storage/myisam/rt_index.c: Auto merged storage/myisam/rt_index.h: Auto merged storage/myisam/rt_key.c: Auto merged storage/myisam/rt_key.h: Auto merged storage/myisam/rt_mbr.c: Auto merged storage/myisam/rt_mbr.h: Auto merged storage/myisam/rt_split.c: Auto merged storage/myisam/rt_test.c: Auto merged storage/myisam/sort.c: Auto merged storage/myisam/sp_defs.h: Auto merged storage/myisam/sp_key.c: Auto merged storage/myisam/sp_test.c: Auto merged storage/myisammrg/Makefile.am: Auto merged storage/myisammrg/ha_myisammrg.cc: Auto merged storage/myisammrg/ha_myisammrg.h: Auto merged storage/myisammrg/myrg_close.c: Auto merged storage/myisammrg/myrg_create.c: Auto merged storage/myisammrg/myrg_def.h: Auto merged storage/myisammrg/myrg_delete.c: Auto merged storage/myisammrg/myrg_extra.c: Auto merged storage/myisammrg/myrg_info.c: Auto merged storage/myisammrg/myrg_locking.c: Auto merged storage/myisammrg/myrg_open.c: Auto merged storage/myisammrg/myrg_panic.c: Auto merged storage/myisammrg/myrg_queue.c: Auto merged storage/myisammrg/myrg_range.c: Auto merged storage/myisammrg/myrg_rfirst.c: Auto merged storage/myisammrg/myrg_rkey.c: Auto merged storage/myisammrg/myrg_rlast.c: Auto merged storage/myisammrg/myrg_rnext.c: Auto merged storage/myisammrg/myrg_rnext_same.c: Auto merged storage/myisammrg/myrg_rprev.c: Auto merged storage/myisammrg/myrg_rrnd.c: Auto merged storage/myisammrg/myrg_rsame.c: Auto merged storage/myisammrg/myrg_static.c: Auto merged storage/myisammrg/myrg_update.c: Auto merged storage/myisammrg/myrg_write.c: Auto merged storage/ndb/include/debugger/DebuggerNames.hpp: Auto merged storage/ndb/include/debugger/EventLogger.hpp: Auto merged storage/ndb/include/debugger/GrepError.hpp: Auto merged storage/ndb/include/debugger/SignalLoggerManager.hpp: Auto merged storage/ndb/include/ndb_constants.h: Auto merged storage/ndb/include/ndb_global.h.in: Auto merged storage/ndb/include/ndb_init.h: Auto merged storage/ndb/include/ndb_types.h.in: Auto merged storage/ndb/include/ndb_version.h.in: Auto merged storage/ndb/include/editline/editline.h: Auto merged storage/ndb/include/kernel/AttributeDescriptor.hpp: Auto merged storage/ndb/include/kernel/AttributeHeader.hpp: Auto merged storage/ndb/include/kernel/AttributeList.hpp: Auto merged storage/ndb/include/kernel/BlockNumbers.h: Auto merged storage/ndb/include/kernel/GlobalSignalNumbers.h: Auto merged storage/ndb/include/kernel/GrepEvent.hpp: Auto merged storage/ndb/include/kernel/Interpreter.hpp: Auto merged storage/ndb/include/kernel/LogLevel.hpp: Auto merged storage/ndb/include/kernel/NodeBitmask.hpp: Auto merged storage/ndb/include/kernel/NodeInfo.hpp: Auto merged storage/ndb/include/kernel/NodeState.hpp: Auto merged storage/ndb/include/kernel/RefConvert.hpp: Auto merged storage/ndb/include/kernel/kernel_types.h: Auto merged storage/ndb/include/kernel/ndb_limits.h: Auto merged storage/ndb/include/kernel/signaldata/AbortAll.hpp: Auto merged storage/ndb/include/kernel/signaldata/AccFrag.hpp: Auto merged storage/ndb/include/kernel/signaldata/AccLock.hpp: Auto merged storage/ndb/include/kernel/signaldata/AccScan.hpp: Auto merged storage/ndb/include/kernel/signaldata/AccSizeAltReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/AlterIndx.hpp: Auto merged storage/ndb/include/kernel/signaldata/AlterTab.hpp: Auto merged storage/ndb/include/kernel/signaldata/AlterTable.hpp: Auto merged storage/ndb/include/kernel/signaldata/AlterTrig.hpp: Auto merged storage/ndb/include/kernel/signaldata/ApiBroadcast.hpp: Auto merged storage/ndb/include/kernel/signaldata/ApiRegSignalData.hpp: Auto merged storage/ndb/include/kernel/signaldata/ApiVersion.hpp: Auto merged storage/ndb/include/kernel/signaldata/ArbitSignalData.hpp: Auto merged storage/ndb/include/kernel/signaldata/AttrInfo.hpp: Auto merged storage/ndb/include/kernel/signaldata/BackupContinueB.hpp: Auto merged storage/ndb/include/kernel/signaldata/BackupImpl.hpp: Auto merged storage/ndb/include/kernel/signaldata/BackupSignalData.hpp: Auto merged storage/ndb/include/kernel/signaldata/BlockCommitOrd.hpp: Auto merged storage/ndb/include/kernel/signaldata/BuildIndx.hpp: Auto merged storage/ndb/include/kernel/signaldata/CheckNodeGroups.hpp: Auto merged storage/ndb/include/kernel/signaldata/CloseComReqConf.hpp: Auto merged storage/ndb/include/kernel/signaldata/CmInit.hpp: Auto merged storage/ndb/include/kernel/trigger_definitions.h: Auto merged storage/ndb/include/kernel/signaldata/CmRegSignalData.hpp: Auto merged storage/ndb/include/kernel/signaldata/CmvmiCfgConf.hpp: Auto merged storage/ndb/include/kernel/signaldata/CntrMasterConf.hpp: Auto merged storage/ndb/include/kernel/signaldata/CntrMasterReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/ConfigParamId.hpp: Auto merged storage/ndb/include/kernel/signaldata/ContinueFragmented.hpp: Auto merged storage/ndb/include/kernel/signaldata/CopyActive.hpp: Auto merged storage/ndb/include/kernel/signaldata/CopyFrag.hpp: Auto merged storage/ndb/include/kernel/signaldata/CopyGCIReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/CreateEvnt.hpp: Auto merged storage/ndb/include/kernel/signaldata/CreateFrag.hpp: Auto merged storage/ndb/include/kernel/signaldata/CreateFragmentation.hpp: Auto merged storage/ndb/include/kernel/signaldata/CreateIndx.hpp: Auto merged storage/ndb/include/kernel/signaldata/CreateTab.hpp: Auto merged storage/ndb/include/kernel/signaldata/CreateTable.hpp: Auto merged storage/ndb/include/kernel/signaldata/CreateTrig.hpp: Auto merged storage/ndb/include/kernel/signaldata/DiAddTab.hpp: Auto merged storage/ndb/include/kernel/signaldata/DiGetNodes.hpp: Auto merged storage/ndb/include/kernel/signaldata/DictLock.hpp: Auto merged storage/ndb/include/kernel/signaldata/DictSchemaInfo.hpp: Auto merged storage/ndb/include/kernel/signaldata/DictSizeAltReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/DictStart.hpp: Auto merged storage/ndb/include/kernel/signaldata/DictTabInfo.hpp: Auto merged storage/ndb/include/kernel/signaldata/DihAddFrag.hpp: Auto merged storage/ndb/include/kernel/signaldata/DihContinueB.hpp: Auto merged storage/ndb/include/kernel/signaldata/DihSizeAltReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/DihStartTab.hpp: Auto merged storage/ndb/include/kernel/signaldata/DihSwitchReplica.hpp: Auto merged storage/ndb/include/kernel/signaldata/DisconnectRep.hpp: Auto merged storage/ndb/include/kernel/signaldata/DropIndx.hpp: Auto merged storage/ndb/include/kernel/signaldata/DropTab.hpp: Auto merged storage/ndb/include/kernel/signaldata/DropTabFile.hpp: Auto merged storage/ndb/include/kernel/signaldata/DropTable.hpp: Auto merged storage/ndb/include/kernel/signaldata/DropTrig.hpp: Auto merged storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp: Auto merged storage/ndb/include/kernel/signaldata/EmptyLcp.hpp: Auto merged storage/ndb/include/kernel/signaldata/EndTo.hpp: Auto merged storage/ndb/include/kernel/signaldata/EventReport.hpp: Auto merged storage/ndb/include/kernel/signaldata/EventSubscribeReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/ExecFragReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/FailRep.hpp: Auto merged storage/ndb/include/kernel/signaldata/FireTrigOrd.hpp: Auto merged storage/ndb/include/kernel/signaldata/FsAppendReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/FsCloseReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/FsConf.hpp: Auto merged storage/ndb/include/kernel/signaldata/FsOpenReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/FsReadWriteReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/FsRef.hpp: Auto merged storage/ndb/include/kernel/signaldata/FsRemoveReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/GCPSave.hpp: Auto merged storage/ndb/include/kernel/signaldata/GetTabInfo.hpp: Auto merged storage/ndb/include/kernel/signaldata/GetTableId.hpp: Auto merged storage/ndb/include/kernel/signaldata/GrepImpl.hpp: Auto merged storage/ndb/include/kernel/signaldata/HotSpareRep.hpp: Auto merged storage/ndb/include/kernel/signaldata/IndxAttrInfo.hpp: Auto merged storage/ndb/include/kernel/signaldata/IndxKeyInfo.hpp: Auto merged storage/ndb/include/kernel/signaldata/InvalidateNodeLCPConf.hpp: Auto merged storage/ndb/include/kernel/signaldata/InvalidateNodeLCPReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/KeyInfo.hpp: Auto merged storage/ndb/include/kernel/signaldata/LCP.hpp: Auto merged storage/ndb/include/kernel/signaldata/ListTables.hpp: Auto merged storage/ndb/include/kernel/signaldata/LqhFrag.hpp: Auto merged storage/ndb/include/kernel/signaldata/LqhKey.hpp: Auto merged storage/ndb/include/kernel/signaldata/LqhSizeAltReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/LqhTransConf.hpp: Auto merged storage/ndb/include/kernel/signaldata/ManagementServer.hpp: Auto merged storage/ndb/include/kernel/signaldata/MasterGCP.hpp: Auto merged storage/ndb/include/kernel/signaldata/MasterLCP.hpp: Auto merged storage/ndb/include/kernel/signaldata/NFCompleteRep.hpp: Auto merged storage/ndb/include/kernel/signaldata/NdbSttor.hpp: Auto merged storage/ndb/include/kernel/signaldata/NdbfsContinueB.hpp: Auto merged storage/ndb/include/kernel/signaldata/NextScan.hpp: Auto merged storage/ndb/include/kernel/signaldata/NodeFailRep.hpp: Auto merged storage/ndb/include/kernel/signaldata/NodeStateSignalData.hpp: Auto merged storage/ndb/include/kernel/signaldata/PackedSignal.hpp: Auto merged storage/ndb/include/kernel/signaldata/PrepDropTab.hpp: Auto merged storage/ndb/include/kernel/signaldata/PrepFailReqRef.hpp: Auto merged storage/ndb/include/kernel/signaldata/ReadNodesConf.hpp: Auto merged storage/ndb/include/kernel/signaldata/RelTabMem.hpp: Auto merged storage/ndb/include/kernel/signaldata/RepImpl.hpp: Auto merged storage/ndb/include/kernel/signaldata/ResumeReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/ScanFrag.hpp: Auto merged storage/ndb/include/kernel/signaldata/ScanTab.hpp: Auto merged storage/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp: Auto merged storage/ndb/include/kernel/signaldata/SetVarReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/SignalData.hpp: Auto merged storage/ndb/include/kernel/signaldata/SignalDataPrint.hpp: Auto merged storage/ndb/include/kernel/signaldata/SignalDroppedRep.hpp: Auto merged storage/ndb/include/kernel/signaldata/SrFragidConf.hpp: Auto merged storage/ndb/include/kernel/signaldata/StartFragReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/StartInfo.hpp: Auto merged storage/ndb/include/kernel/signaldata/StartMe.hpp: Auto merged storage/ndb/include/kernel/signaldata/StartOrd.hpp: Auto merged storage/ndb/include/kernel/signaldata/StartPerm.hpp: Auto merged storage/ndb/include/kernel/signaldata/StartRec.hpp: Auto merged storage/ndb/include/kernel/signaldata/StartTo.hpp: Auto merged storage/ndb/include/kernel/signaldata/StopMe.hpp: Auto merged storage/ndb/include/kernel/signaldata/StopPerm.hpp: Auto merged storage/ndb/include/kernel/signaldata/StopReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/SumaImpl.hpp: Auto merged storage/ndb/include/kernel/signaldata/SystemError.hpp: Auto merged storage/ndb/include/kernel/signaldata/TamperOrd.hpp: Auto merged storage/ndb/include/kernel/signaldata/TcCommit.hpp: Auto merged storage/ndb/include/kernel/signaldata/TcContinueB.hpp: Auto merged storage/ndb/include/kernel/signaldata/TcHbRep.hpp: Auto merged storage/ndb/include/kernel/signaldata/TcIndx.hpp: Auto merged storage/ndb/include/kernel/signaldata/TcKeyConf.hpp: Auto merged storage/ndb/include/kernel/signaldata/TcKeyFailConf.hpp: Auto merged storage/ndb/include/kernel/signaldata/TcKeyRef.hpp: Auto merged storage/ndb/include/kernel/signaldata/TcKeyReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/TcRollbackRep.hpp: Auto merged storage/ndb/include/kernel/signaldata/TcSizeAltReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/TestOrd.hpp: Auto merged storage/ndb/include/kernel/signaldata/TransIdAI.hpp: Auto merged storage/ndb/include/kernel/signaldata/TrigAttrInfo.hpp: Auto merged storage/ndb/include/kernel/signaldata/TupCommit.hpp: Auto merged storage/ndb/include/kernel/signaldata/TupFrag.hpp: Auto merged storage/ndb/include/kernel/signaldata/TupKey.hpp: Auto merged storage/ndb/include/kernel/signaldata/TupSizeAltReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/TuxBound.hpp: Auto merged storage/ndb/include/kernel/signaldata/TuxContinueB.hpp: Auto merged storage/ndb/include/kernel/signaldata/TuxMaint.hpp: Auto merged storage/ndb/include/kernel/signaldata/TuxSizeAltReq.hpp: Auto merged storage/ndb/include/kernel/signaldata/UpdateTo.hpp: Auto merged storage/ndb/include/kernel/signaldata/UtilDelete.hpp: Auto merged storage/ndb/include/kernel/signaldata/UtilExecute.hpp: Auto merged storage/ndb/include/kernel/signaldata/UtilLock.hpp: Auto merged storage/ndb/include/kernel/signaldata/UtilPrepare.hpp: Auto merged storage/ndb/include/kernel/signaldata/UtilRelease.hpp: Auto merged storage/ndb/include/kernel/signaldata/UtilSequence.hpp: Auto merged storage/ndb/include/kernel/signaldata/WaitGCP.hpp: Auto merged storage/ndb/include/logger/ConsoleLogHandler.hpp: Auto merged storage/ndb/include/logger/FileLogHandler.hpp: Auto merged storage/ndb/include/logger/LogHandler.hpp: Auto merged storage/ndb/include/logger/Logger.hpp: Auto merged storage/ndb/include/logger/SysLogHandler.hpp: Auto merged storage/ndb/include/mgmapi/mgmapi.h: Auto merged storage/ndb/include/mgmapi/mgmapi_debug.h: Auto merged storage/ndb/include/mgmapi/ndb_logevent.h: Auto merged storage/ndb/include/mgmapi/ndbd_exit_codes.h: Auto merged storage/ndb/include/mgmcommon/ConfigRetriever.hpp: Auto merged storage/ndb/include/mgmcommon/IPCConfig.hpp: Auto merged storage/ndb/include/mgmcommon/MgmtErrorReporter.hpp: Auto merged storage/ndb/include/ndbapi/Ndb.hpp: Auto merged storage/ndb/include/ndbapi/NdbApi.hpp: Auto merged storage/ndb/include/ndbapi/NdbBlob.hpp: Auto merged storage/ndb/include/ndbapi/NdbDictionary.hpp: Auto merged storage/ndb/include/ndbapi/NdbError.hpp: Auto merged storage/ndb/include/ndbapi/NdbEventOperation.hpp: Auto merged storage/ndb/include/ndbapi/NdbIndexOperation.hpp: Auto merged storage/ndb/include/ndbapi/NdbIndexScanOperation.hpp: Auto merged storage/ndb/include/ndbapi/NdbOperation.hpp: Auto merged storage/ndb/include/ndbapi/NdbPool.hpp: Auto merged storage/ndb/include/ndbapi/NdbRecAttr.hpp: Auto merged storage/ndb/include/ndbapi/NdbReceiver.hpp: Auto merged storage/ndb/include/ndbapi/NdbScanFilter.hpp: Auto merged storage/ndb/include/ndbapi/NdbScanOperation.hpp: Auto merged storage/ndb/include/ndbapi/NdbTransaction.hpp: Auto merged storage/ndb/include/ndbapi/ndb_cluster_connection.hpp: Auto merged storage/ndb/include/ndbapi/ndb_opt_defaults.h: Auto merged storage/ndb/include/ndbapi/ndbapi_limits.h: Auto merged storage/ndb/include/ndbapi/ndberror.h: Auto merged storage/ndb/include/newtonapi/dba.h: Auto merged storage/ndb/include/newtonapi/defs/pcn_types.h: Auto merged storage/ndb/include/portlib/NdbCondition.h: Auto merged storage/ndb/include/portlib/NdbConfig.h: Auto merged storage/ndb/include/portlib/NdbDaemon.h: Auto merged storage/ndb/include/portlib/NdbEnv.h: Auto merged storage/ndb/include/portlib/NdbHost.h: Auto merged storage/ndb/include/portlib/NdbMain.h: Auto merged storage/ndb/include/portlib/NdbMem.h: Auto merged storage/ndb/include/portlib/NdbMutex.h: Auto merged storage/ndb/include/portlib/NdbSleep.h: Auto merged storage/ndb/include/portlib/NdbTCP.h: Auto merged storage/ndb/include/portlib/NdbThread.h: Auto merged storage/ndb/include/portlib/NdbTick.h: Auto merged storage/ndb/include/portlib/PortDefs.h: Auto merged storage/ndb/include/portlib/prefetch.h: Auto merged storage/ndb/include/transporter/TransporterCallback.hpp: Auto merged storage/ndb/include/transporter/TransporterDefinitions.hpp: Auto merged storage/ndb/include/transporter/TransporterRegistry.hpp: Auto merged storage/ndb/include/util/BaseString.hpp: Auto merged storage/ndb/include/util/Bitmask.hpp: Auto merged storage/ndb/include/util/File.hpp: Auto merged storage/ndb/include/util/InputStream.hpp: Auto merged storage/ndb/include/util/NdbAutoPtr.hpp: Auto merged storage/ndb/include/util/NdbOut.hpp: Auto merged storage/ndb/include/util/NdbSqlUtil.hpp: Auto merged storage/ndb/include/util/OutputStream.hpp: Auto merged storage/ndb/include/util/Parser.hpp: Auto merged storage/ndb/include/util/Properties.hpp: Auto merged storage/ndb/include/util/SimpleProperties.hpp: Auto merged storage/ndb/include/util/SocketAuthenticator.hpp: Auto merged storage/ndb/include/util/SocketClient.hpp: Auto merged storage/ndb/include/util/SocketServer.hpp: Auto merged storage/ndb/include/util/UtilBuffer.hpp: Auto merged storage/ndb/include/util/Vector.hpp: Auto merged storage/ndb/include/util/basestring_vsnprintf.h: Auto merged storage/ndb/include/util/md5_hash.hpp: Auto merged storage/ndb/include/util/ndb_opts.h: Auto merged storage/ndb/include/util/random.h: Auto merged storage/ndb/include/util/socket_io.h: Auto merged storage/ndb/include/util/uucode.h: Auto merged storage/ndb/include/util/version.h: Auto merged storage/ndb/src/common/debugger/BlockNames.cpp: Auto merged storage/ndb/src/common/debugger/DebuggerNames.cpp: Auto merged storage/ndb/src/common/debugger/EventLogger.cpp: Auto merged storage/ndb/src/common/debugger/GrepError.cpp: Auto merged storage/ndb/src/common/debugger/SignalLoggerManager.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/AccLock.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/AlterIndx.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/AlterTab.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/AlterTable.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/AlterTrig.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/BackupImpl.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/CloseComReqConf.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/ContinueB.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/CopyGCI.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/CreateEvnt.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/CreateFragmentation.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/CreateIndx.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/CreateTrig.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/DihContinueB.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/DihSwitchReplicaReq.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/DisconnectRep.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/DropIndx.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/DropTab.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/DropTrig.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/FailRep.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/FireTrigOrd.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/FsAppendReq.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/FsCloseReq.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/FsConf.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/FsOpenReq.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/FsRef.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/GCPSave.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/IndxAttrInfo.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/IndxKeyInfo.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/LCP.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/LqhFrag.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/LqhKey.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/LqhTrans.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/MasterLCP.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/NdbSttor.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/NdbfsContinueB.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/PackedSignal.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/PrepDropTab.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/PrepFailReqRef.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/ScanFrag.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/ScanTab.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/SignalDroppedRep.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/SignalNames.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/StartRec.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/SumaImpl.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/SystemError.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/TcIndx.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/TcKeyConf.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/TcKeyRef.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/TcKeyReq.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/TcRollbackRep.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/TrigAttrInfo.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/TupCommit.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/TupKey.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/TuxMaint.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/UtilDelete.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/UtilExecute.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/UtilLock.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/UtilPrepare.cpp: Auto merged storage/ndb/src/common/debugger/signaldata/UtilSequence.cpp: Auto merged storage/ndb/src/common/logger/ConsoleLogHandler.cpp: Auto merged storage/ndb/src/common/logger/FileLogHandler.cpp: Auto merged storage/ndb/src/common/logger/LogHandler.cpp: Auto merged storage/ndb/src/common/logger/LogHandlerList.cpp: Auto merged storage/ndb/src/common/logger/LogHandlerList.hpp: Auto merged storage/ndb/src/common/logger/Logger.cpp: Auto merged storage/ndb/src/common/logger/SysLogHandler.cpp: Auto merged storage/ndb/src/common/logger/listtest/LogHandlerListUnitTest.cpp: Auto merged storage/ndb/src/common/logger/listtest/LogHandlerListUnitTest.hpp: Auto merged storage/ndb/src/common/logger/loggertest/LoggerUnitTest.cpp: Auto merged storage/ndb/src/common/logger/loggertest/LoggerUnitTest.hpp: Auto merged storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp: Auto merged storage/ndb/src/common/mgmcommon/IPCConfig.cpp: Auto merged storage/ndb/src/common/mgmcommon/printConfig/printConfig.cpp: Auto merged storage/ndb/src/common/portlib/NdbCondition.c: Auto merged storage/ndb/src/common/portlib/NdbConfig.c: Auto merged storage/ndb/src/common/portlib/NdbDaemon.c: Auto merged storage/ndb/src/common/portlib/NdbEnv.c: Auto merged storage/ndb/src/common/portlib/NdbHost.c: Auto merged storage/ndb/src/common/portlib/NdbMem.c: Auto merged storage/ndb/src/common/portlib/NdbMutex.c: Auto merged storage/ndb/src/common/portlib/NdbPortLibTest.cpp: Auto merged storage/ndb/src/common/portlib/NdbSleep.c: Auto merged storage/ndb/src/common/portlib/NdbTCP.cpp: Auto merged storage/ndb/src/common/portlib/NdbThread.c: Auto merged storage/ndb/src/common/portlib/NdbTick.c: Auto merged storage/ndb/src/common/portlib/memtest.c: Auto merged storage/ndb/src/common/portlib/mmstest.cpp: Auto merged storage/ndb/src/common/portlib/munmaptest.cpp: Auto merged storage/ndb/src/common/portlib/win32/NdbCondition.c: Auto merged storage/ndb/src/common/portlib/win32/NdbDaemon.c: Auto merged storage/ndb/src/common/portlib/win32/NdbEnv.c: Auto merged storage/ndb/src/common/portlib/win32/NdbHost.c: Auto merged storage/ndb/src/common/portlib/win32/NdbMem.c: Auto merged storage/ndb/src/common/portlib/win32/NdbMutex.c: Auto merged storage/ndb/src/common/portlib/win32/NdbSleep.c: Auto merged storage/ndb/src/common/portlib/win32/NdbTCP.c: Auto merged storage/ndb/src/common/portlib/win32/NdbThread.c: Auto merged storage/ndb/src/common/portlib/win32/NdbTick.c: Auto merged storage/ndb/src/common/transporter/Packer.cpp: Auto merged storage/ndb/src/common/transporter/Packer.hpp: Auto merged storage/ndb/src/common/transporter/SCI_Transporter.cpp: Auto merged storage/ndb/src/common/transporter/SCI_Transporter.hpp: Auto merged storage/ndb/src/common/transporter/SHM_Buffer.hpp: Auto merged storage/ndb/src/common/transporter/SHM_Transporter.cpp: Auto merged storage/ndb/src/common/transporter/SHM_Transporter.hpp: Auto merged storage/ndb/src/common/transporter/SHM_Transporter.unix.cpp: Auto merged storage/ndb/src/common/transporter/SHM_Transporter.win32.cpp: Auto merged storage/ndb/src/common/transporter/SendBuffer.cpp: Auto merged storage/ndb/src/common/transporter/SendBuffer.hpp: Auto merged storage/ndb/src/common/transporter/TCP_Transporter.cpp: Auto merged storage/ndb/src/common/transporter/TCP_Transporter.hpp: Auto merged storage/ndb/src/common/transporter/Transporter.cpp: Auto merged storage/ndb/src/common/transporter/Transporter.hpp: Auto merged storage/ndb/src/common/transporter/TransporterInternalDefinitions.hpp: Auto merged storage/ndb/src/common/transporter/TransporterRegistry.cpp: Auto merged storage/ndb/src/common/transporter/basictest/basicTransporterTest.cpp: Auto merged storage/ndb/src/common/transporter/buddy.cpp: Auto merged storage/ndb/src/common/transporter/buddy.hpp: Auto merged storage/ndb/src/common/transporter/failoverSCI/failoverSCI.cpp: Auto merged storage/ndb/src/common/transporter/perftest/perfTransporterTest.cpp: Auto merged storage/ndb/src/common/transporter/priotest/prioSCI/prioSCI.cpp: Auto merged storage/ndb/src/common/transporter/priotest/prioSHM/prioSHM.cpp: Auto merged storage/ndb/src/common/transporter/priotest/prioTCP/prioTCP.cpp: Auto merged storage/ndb/src/common/transporter/priotest/prioTransporterTest.cpp: Auto merged storage/ndb/src/common/transporter/priotest/prioTransporterTest.hpp: Auto merged storage/ndb/src/common/util/BaseString.cpp: Auto merged storage/ndb/src/common/util/File.cpp: Auto merged storage/ndb/src/common/util/InputStream.cpp: Auto merged storage/ndb/src/common/util/NdbOut.cpp: Auto merged storage/ndb/src/common/util/NdbSqlUtil.cpp: Auto merged storage/ndb/src/common/util/OutputStream.cpp: Auto merged storage/ndb/src/common/util/Parser.cpp: Auto merged storage/ndb/src/common/util/Properties.cpp: Auto merged storage/ndb/src/common/util/SimpleProperties.cpp: Auto merged storage/ndb/src/common/util/SocketAuthenticator.cpp: Auto merged storage/ndb/src/common/util/SocketClient.cpp: Auto merged storage/ndb/src/common/util/SocketServer.cpp: Auto merged storage/ndb/src/common/util/basestring_vsnprintf.c: Auto merged storage/ndb/src/common/util/md5_hash.cpp: Auto merged storage/ndb/src/common/util/ndb_init.c: Auto merged storage/ndb/src/common/util/random.c: Auto merged storage/ndb/src/common/util/socket_io.cpp: Auto merged storage/ndb/src/common/util/strdup.c: Auto merged storage/ndb/src/common/util/filetest/FileUnitTest.cpp: Auto merged storage/ndb/src/common/util/filetest/FileUnitTest.hpp: Auto merged storage/ndb/src/common/util/testProperties/testProperties.cpp: Auto merged storage/ndb/src/common/util/testSimpleProperties/sp_test.cpp: Auto merged storage/ndb/src/common/util/uucode.c: Auto merged storage/ndb/src/common/util/version.c: Auto merged storage/ndb/src/cw/cpcc-win32/C++/CPC_GUI.cpp: Auto merged storage/ndb/src/cw/cpcc-win32/C++/CPC_GUI.h: Auto merged storage/ndb/src/cw/cpcc-win32/C++/NdbControls.cpp: Auto merged storage/ndb/src/cw/cpcc-win32/C++/StdAfx.cpp: Auto merged storage/ndb/src/cw/cpcc-win32/C++/StdAfx.h: Auto merged storage/ndb/src/cw/cpcc-win32/C++/TreeView.cpp: Auto merged storage/ndb/src/cw/cpcc-win32/C++/TreeView.h: Auto merged storage/ndb/src/cw/cpcc-win32/C++/resource.h: Auto merged storage/ndb/src/cw/cpcd/APIService.cpp: Auto merged storage/ndb/src/cw/cpcd/APIService.hpp: Auto merged storage/ndb/src/cw/cpcd/CPCD.cpp: Auto merged storage/ndb/src/cw/cpcd/CPCD.hpp: Auto merged storage/ndb/src/cw/cpcd/Monitor.cpp: Auto merged storage/ndb/src/cw/cpcd/Process.cpp: Auto merged storage/ndb/src/cw/cpcd/common.cpp: Auto merged storage/ndb/src/cw/cpcd/common.hpp: Auto merged storage/ndb/src/cw/cpcd/main.cpp: Auto merged storage/ndb/src/cw/test/socketclient/socketClientTest.cpp: Auto merged storage/ndb/src/cw/util/ClientInterface.cpp: Auto merged storage/ndb/src/cw/util/ClientInterface.hpp: Auto merged storage/ndb/src/cw/util/SocketRegistry.cpp: Auto merged storage/ndb/src/cw/util/SocketRegistry.hpp: Auto merged storage/ndb/src/cw/util/SocketService.cpp: Auto merged storage/ndb/src/cw/util/SocketService.hpp: Auto merged storage/ndb/src/kernel/SimBlockList.cpp: Auto merged storage/ndb/src/kernel/blocks/mutexes.hpp: Auto merged storage/ndb/src/kernel/main.cpp: Auto merged storage/ndb/src/kernel/blocks/backup/Backup.cpp: Auto merged storage/ndb/src/kernel/blocks/backup/Backup.hpp: Auto merged storage/ndb/src/kernel/blocks/backup/BackupFormat.hpp: Auto merged storage/ndb/src/kernel/blocks/backup/BackupInit.cpp: Auto merged storage/ndb/src/kernel/blocks/backup/FsBuffer.hpp: Auto merged storage/ndb/src/kernel/blocks/backup/read.cpp: Auto merged storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Auto merged storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp: Auto merged storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp: Auto merged storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp: Auto merged storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp: Auto merged storage/ndb/src/kernel/blocks/dbdict/SchemaFile.hpp: Auto merged storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp: Auto merged storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Auto merged storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp: Auto merged storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dbdih/Sysfile.hpp: Auto merged storage/ndb/src/kernel/blocks/dbdih/printSysfile/printSysfile.cpp: Auto merged storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Auto merged storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp: Auto merged storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp: Auto merged storage/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp: Auto merged storage/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Auto merged storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/AttributeOffset.hpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupBuffer.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupDebug.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupIndex.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupPageMap.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupTabDesMan.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp: Auto merged storage/ndb/src/kernel/blocks/dbtux/DbtuxCmp.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtux/DbtuxMaint.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp: Auto merged storage/ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp: Auto merged storage/ndb/src/kernel/blocks/dbutil/DbUtil.cpp: Auto merged storage/ndb/src/kernel/blocks/dbutil/DbUtil.hpp: Auto merged storage/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp: Auto merged storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrSysTable.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/AsyncFileTest/AsyncFileTest.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/CircularIndex.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/CircularIndex.hpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/Filename.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/Filename.hpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.hpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/OpenFiles.hpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/Pool.hpp: Auto merged storage/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp: Auto merged storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp: Auto merged storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp: Auto merged storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: Auto merged storage/ndb/src/kernel/blocks/qmgr/timer.hpp: Auto merged storage/ndb/src/kernel/blocks/suma/Suma.cpp: Auto merged storage/ndb/src/kernel/blocks/suma/Suma.hpp: Auto merged storage/ndb/src/kernel/blocks/suma/SumaInit.cpp: Auto merged storage/ndb/src/kernel/blocks/trix/Trix.cpp: Auto merged storage/ndb/src/kernel/blocks/trix/Trix.hpp: Auto merged storage/ndb/src/kernel/error/ErrorHandlingMacros.hpp: Auto merged storage/ndb/src/kernel/error/ErrorReporter.cpp: Auto merged storage/ndb/src/kernel/error/ErrorReporter.hpp: Auto merged storage/ndb/src/kernel/error/TimeModule.cpp: Auto merged storage/ndb/src/kernel/error/TimeModule.hpp: Auto merged storage/ndb/src/kernel/error/ndbd_exit_codes.c: Auto merged storage/ndb/src/kernel/vm/Array.hpp: Auto merged storage/ndb/src/kernel/vm/ArrayPool.hpp: Auto merged storage/ndb/src/kernel/vm/CArray.hpp: Auto merged storage/ndb/src/kernel/vm/Callback.hpp: Auto merged storage/ndb/src/kernel/vm/ClusterConfiguration.cpp: Auto merged storage/ndb/src/kernel/vm/ClusterConfiguration.hpp: Auto merged storage/ndb/src/kernel/vm/Configuration.cpp: Auto merged storage/ndb/src/kernel/vm/Configuration.hpp: Auto merged storage/ndb/src/kernel/vm/DLFifoList.hpp: Auto merged storage/ndb/src/kernel/vm/DLHashTable.hpp: Auto merged storage/ndb/src/kernel/vm/DLHashTable2.hpp: Auto merged storage/ndb/src/kernel/vm/DLList.hpp: Auto merged storage/ndb/src/kernel/vm/DataBuffer.hpp: Auto merged storage/ndb/src/kernel/vm/Emulator.cpp: Auto merged storage/ndb/src/kernel/vm/Emulator.hpp: Auto merged storage/ndb/src/kernel/vm/FastScheduler.cpp: Auto merged storage/ndb/src/kernel/vm/FastScheduler.hpp: Auto merged storage/ndb/src/kernel/vm/GlobalData.hpp: Auto merged storage/ndb/src/kernel/vm/KeyDescriptor.hpp: Auto merged storage/ndb/src/kernel/vm/KeyTable.hpp: Auto merged storage/ndb/src/kernel/vm/KeyTable2.hpp: Auto merged storage/ndb/src/kernel/vm/LongSignal.hpp: Auto merged storage/ndb/src/kernel/vm/Mutex.cpp: Auto merged storage/ndb/src/kernel/vm/Mutex.hpp: Auto merged storage/ndb/src/kernel/vm/Prio.hpp: Auto merged storage/ndb/src/kernel/vm/RequestTracker.hpp: Auto merged storage/ndb/src/kernel/vm/SLList.hpp: Auto merged storage/ndb/src/kernel/vm/SafeCounter.cpp: Auto merged storage/ndb/src/kernel/vm/SafeCounter.hpp: Auto merged storage/ndb/src/kernel/vm/SectionReader.cpp: Auto merged storage/ndb/src/kernel/vm/SectionReader.hpp: Auto merged storage/ndb/src/kernel/vm/SignalCounter.hpp: Auto merged storage/ndb/src/kernel/vm/SimBlockList.hpp: Auto merged storage/ndb/src/kernel/vm/SimplePropertiesSection.cpp: Auto merged storage/ndb/src/kernel/vm/SimulatedBlock.cpp: Auto merged storage/ndb/src/kernel/vm/SimulatedBlock.hpp: Auto merged storage/ndb/src/kernel/vm/SuperPool.cpp: Auto merged storage/ndb/src/kernel/vm/SuperPool.hpp: Auto merged storage/ndb/src/kernel/vm/ThreadConfig.cpp: Auto merged storage/ndb/src/kernel/vm/ThreadConfig.hpp: Auto merged storage/ndb/src/kernel/vm/TimeQueue.cpp: Auto merged storage/ndb/src/kernel/vm/TimeQueue.hpp: Auto merged storage/ndb/src/kernel/vm/TransporterCallback.cpp: Auto merged storage/ndb/src/kernel/vm/VMSignal.cpp: Auto merged storage/ndb/src/kernel/vm/VMSignal.hpp: Auto merged storage/ndb/src/kernel/vm/WaitQueue.hpp: Auto merged storage/ndb/src/kernel/vm/WatchDog.cpp: Auto merged storage/ndb/src/kernel/vm/WatchDog.hpp: Auto merged storage/ndb/src/kernel/vm/al_test/arrayListTest.cpp: Auto merged storage/ndb/src/kernel/vm/al_test/arrayPoolTest.cpp: Auto merged storage/ndb/src/kernel/vm/al_test/main.cpp: Auto merged storage/ndb/src/kernel/vm/ndbd_malloc.cpp: Auto merged storage/ndb/src/kernel/vm/ndbd_malloc.hpp: Auto merged storage/ndb/src/kernel/vm/pc.hpp: Auto merged storage/ndb/src/kernel/vm/testCopy/rr.cpp: Auto merged storage/ndb/src/kernel/vm/testCopy/testCopy.cpp: Auto merged storage/ndb/src/kernel/vm/testDataBuffer/testDataBuffer.cpp: Auto merged storage/ndb/src/kernel/vm/testLongSig/testLongSig.cpp: Auto merged storage/ndb/src/kernel/vm/testSimplePropertiesSection/test.cpp: Auto merged storage/ndb/src/kernel/vm/testSuperPool.cpp: Auto merged storage/ndb/src/mgmapi/LocalConfig.cpp: Auto merged storage/ndb/src/mgmapi/LocalConfig.hpp: Auto merged storage/ndb/src/mgmapi/mgmapi.cpp: Auto merged storage/ndb/src/mgmapi/mgmapi_configuration.hpp: Auto merged storage/ndb/src/mgmapi/mgmapi_internal.h: Auto merged storage/ndb/src/mgmapi/ndb_logevent.cpp: Auto merged storage/ndb/src/mgmapi/ndb_logevent.hpp: Auto merged storage/ndb/src/mgmapi/test/keso.c: Auto merged storage/ndb/src/mgmapi/test/mgmSrvApi.cpp: Auto merged storage/ndb/src/mgmclient/CommandInterpreter.cpp: Auto merged storage/ndb/src/mgmclient/main.cpp: Auto merged storage/ndb/src/mgmclient/ndb_mgmclient.hpp: Auto merged storage/ndb/src/mgmclient/ndb_mgmclient.h: Auto merged storage/ndb/src/mgmclient/test_cpcd/test_cpcd.cpp: Auto merged storage/ndb/src/mgmsrv/Config.cpp: Auto merged storage/ndb/src/mgmsrv/Config.hpp: Auto merged storage/ndb/src/mgmsrv/ConfigInfo.cpp: Auto merged storage/ndb/src/mgmsrv/ConfigInfo.hpp: Auto merged storage/ndb/src/mgmsrv/InitConfigFileParser.cpp: Auto merged storage/ndb/src/mgmsrv/InitConfigFileParser.hpp: Auto merged storage/ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged storage/ndb/src/mgmsrv/MgmtSrvr.hpp: Auto merged storage/ndb/src/mgmsrv/MgmtSrvrConfig.cpp: Auto merged storage/ndb/src/mgmsrv/MgmtSrvrGeneralSignalHandling.cpp: Auto merged storage/ndb/src/mgmsrv/Services.cpp: Auto merged storage/ndb/src/mgmsrv/Services.hpp: Auto merged storage/ndb/src/mgmsrv/SignalQueue.cpp: Auto merged storage/ndb/src/mgmsrv/SignalQueue.hpp: Auto merged storage/ndb/src/mgmsrv/convertStrToInt.cpp: Auto merged storage/ndb/src/mgmsrv/convertStrToInt.hpp: Auto merged storage/ndb/src/mgmsrv/main.cpp: Auto merged storage/ndb/src/mgmsrv/mkconfig/mkconfig.cpp: Auto merged storage/ndb/src/ndbapi/API.hpp: Auto merged storage/ndb/src/ndbapi/ClusterMgr.cpp: Auto merged storage/ndb/src/ndbapi/ClusterMgr.hpp: Auto merged storage/ndb/src/ndbapi/DictCache.cpp: Auto merged storage/ndb/src/ndbapi/DictCache.hpp: Auto merged storage/ndb/src/ndbapi/Ndb.cpp: Auto merged storage/ndb/src/ndbapi/NdbApiSignal.cpp: Auto merged storage/ndb/src/ndbapi/NdbApiSignal.hpp: Auto merged storage/ndb/src/ndbapi/NdbBlob.cpp: Auto merged storage/ndb/src/ndbapi/NdbBlobImpl.hpp: Auto merged storage/ndb/src/ndbapi/NdbDictionary.cpp: Auto merged storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp: Auto merged storage/ndb/src/ndbapi/NdbErrorOut.cpp: Auto merged storage/ndb/src/ndbapi/NdbEventOperation.cpp: Auto merged storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp: Auto merged storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp: Auto merged storage/ndb/src/ndbapi/NdbImpl.hpp: Auto merged storage/ndb/src/ndbapi/NdbIndexOperation.cpp: Auto merged storage/ndb/src/ndbapi/NdbLinHash.hpp: Auto merged storage/ndb/src/ndbapi/NdbOperation.cpp: Auto merged storage/ndb/src/ndbapi/NdbOperationDefine.cpp: Auto merged storage/ndb/src/ndbapi/NdbOperationExec.cpp: Auto merged storage/ndb/src/ndbapi/NdbOperationInt.cpp: Auto merged storage/ndb/src/ndbapi/NdbOperationScan.cpp: Auto merged storage/ndb/src/ndbapi/NdbOperationSearch.cpp: Auto merged storage/ndb/src/ndbapi/NdbPool.cpp: Auto merged storage/ndb/src/ndbapi/NdbPoolImpl.cpp: Auto merged storage/ndb/src/ndbapi/NdbPoolImpl.hpp: Auto merged storage/ndb/src/ndbapi/NdbRecAttr.cpp: Auto merged storage/ndb/src/ndbapi/NdbReceiver.cpp: Auto merged storage/ndb/src/ndbapi/NdbScanFilter.cpp: Auto merged storage/ndb/src/ndbapi/NdbScanOperation.cpp: Auto merged storage/ndb/src/ndbapi/NdbTransaction.cpp: Auto merged storage/ndb/src/ndbapi/NdbTransactionScan.cpp: Auto merged storage/ndb/src/ndbapi/NdbUtil.cpp: Auto merged storage/ndb/src/ndbapi/NdbUtil.hpp: Auto merged storage/ndb/src/ndbapi/NdbWaiter.hpp: Auto merged storage/ndb/src/ndbapi/Ndberr.cpp: Auto merged storage/ndb/src/ndbapi/Ndbif.cpp: Auto merged storage/ndb/src/ndbapi/Ndbinit.cpp: Auto merged storage/ndb/src/ndbapi/Ndblist.cpp: Auto merged storage/ndb/src/ndbapi/ObjectMap.hpp: Auto merged storage/ndb/src/ndbapi/SignalSender.cpp: Auto merged storage/ndb/src/ndbapi/SignalSender.hpp: Auto merged storage/ndb/src/ndbapi/TransporterFacade.cpp: Auto merged storage/ndb/src/ndbapi/TransporterFacade.hpp: Auto merged storage/ndb/src/ndbapi/ndb_cluster_connection.cpp: Auto merged storage/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp: Auto merged storage/ndb/src/ndbapi/ndberror.c: Auto merged storage/ndb/src/ndbapi/signal-sender/SignalSender.cpp: Auto merged storage/ndb/src/ndbapi/signal-sender/SignalSender.hpp: Auto merged storage/ndb/test/include/CpcClient.hpp: Auto merged storage/ndb/test/include/HugoAsynchTransactions.hpp: Auto merged storage/ndb/test/include/HugoCalculator.hpp: Auto merged storage/ndb/test/include/HugoOperations.hpp: Auto merged storage/ndb/test/include/HugoTransactions.hpp: Auto merged storage/ndb/test/include/NDBT.hpp: Auto merged storage/ndb/test/include/NDBT_DataSet.hpp: Auto merged storage/ndb/test/include/NDBT_DataSetTransaction.hpp: Auto merged storage/ndb/test/include/NDBT_Error.hpp: Auto merged storage/ndb/test/include/NDBT_Output.hpp: Auto merged storage/ndb/test/include/NDBT_ResultRow.hpp: Auto merged storage/ndb/test/include/NDBT_ReturnCodes.h: Auto merged storage/ndb/test/include/NDBT_Stats.hpp: Auto merged storage/ndb/test/include/NDBT_Table.hpp: Auto merged storage/ndb/test/include/NDBT_Tables.hpp: Auto merged storage/ndb/test/include/NDBT_Test.hpp: Auto merged storage/ndb/test/include/NdbBackup.hpp: Auto merged storage/ndb/test/include/NdbConfig.hpp: Auto merged storage/ndb/test/include/NdbGrep.hpp: Auto merged storage/ndb/test/include/NdbRestarter.hpp: Auto merged storage/ndb/test/include/NdbRestarts.hpp: Auto merged storage/ndb/test/include/NdbSchemaCon.hpp: Auto merged storage/ndb/test/include/NdbSchemaOp.hpp: Auto merged storage/ndb/test/include/NdbTest.hpp: Auto merged storage/ndb/test/include/NdbTimer.hpp: Auto merged storage/ndb/test/include/TestNdbEventOperation.hpp: Auto merged storage/ndb/test/include/UtilTransactions.hpp: Auto merged storage/ndb/test/include/getarg.h: Auto merged storage/ndb/test/ndbapi/InsertRecs.cpp: Auto merged storage/ndb/test/ndbapi/ScanFilter.hpp: Auto merged storage/ndb/test/ndbapi/ScanFunctions.hpp: Auto merged storage/ndb/test/ndbapi/ScanInterpretTest.hpp: Auto merged storage/ndb/test/ndbapi/TraceNdbApi.cpp: Auto merged storage/ndb/test/ndbapi/VerifyNdbApi.cpp: Auto merged storage/ndb/test/ndbapi/acid.cpp: Auto merged storage/ndb/test/ndbapi/acid2.cpp: Auto merged storage/ndb/test/ndbapi/adoInsertRecs.cpp: Auto merged storage/ndb/test/ndbapi/asyncGenerator.cpp: Auto merged storage/ndb/test/ndbapi/benchronja.cpp: Auto merged storage/ndb/test/ndbapi/bulk_copy.cpp: Auto merged storage/ndb/test/ndbapi/cdrserver.cpp: Auto merged storage/ndb/test/ndbapi/celloDb.cpp: Auto merged storage/ndb/test/ndbapi/create_all_tabs.cpp: Auto merged storage/ndb/test/ndbapi/create_tab.cpp: Auto merged storage/ndb/test/ndbapi/drop_all_tabs.cpp: Auto merged storage/ndb/test/ndbapi/flexAsynch.cpp: Auto merged storage/ndb/test/ndbapi/flexBench.cpp: Auto merged storage/ndb/test/ndbapi/flexHammer.cpp: Auto merged storage/ndb/test/ndbapi/flexScan.cpp: Auto merged storage/ndb/test/ndbapi/flexTT.cpp: Auto merged storage/ndb/test/ndbapi/flexTimedAsynch.cpp: Auto merged storage/ndb/test/ndbapi/flex_bench_mysql.cpp: Auto merged storage/ndb/test/ndbapi/index.cpp: Auto merged storage/ndb/test/ndbapi/index2.cpp: Auto merged storage/ndb/test/ndbapi/initronja.cpp: Auto merged storage/ndb/test/ndbapi/interpreterInTup.cpp: Auto merged storage/ndb/test/ndbapi/mainAsyncGenerator.cpp: Auto merged storage/ndb/test/ndbapi/msa.cpp: Auto merged storage/ndb/test/ndbapi/ndb_async1.cpp: Auto merged storage/ndb/test/ndbapi/ndb_async2.cpp: Auto merged storage/ndb/test/ndbapi/ndb_user_populate.cpp: Auto merged storage/ndb/test/ndbapi/ndb_user_transaction.cpp: Auto merged storage/ndb/test/ndbapi/ndb_user_transaction2.cpp: Auto merged storage/ndb/test/ndbapi/ndb_user_transaction3.cpp: Auto merged storage/ndb/test/ndbapi/ndb_user_transaction4.cpp: Auto merged storage/ndb/test/ndbapi/ndb_user_transaction5.cpp: Auto merged storage/ndb/test/ndbapi/ndb_user_transaction6.cpp: Auto merged storage/ndb/test/ndbapi/restarter.cpp: Auto merged storage/ndb/test/ndbapi/restarter2.cpp: Auto merged storage/ndb/test/ndbapi/restarts.cpp: Auto merged storage/ndb/test/ndbapi/size.cpp: Auto merged storage/ndb/test/ndbapi/testBackup.cpp: Auto merged storage/ndb/test/ndbapi/testBasic.cpp: Auto merged storage/ndb/test/ndbapi/testBasicAsynch.cpp: Auto merged storage/ndb/test/ndbapi/testBlobs.cpp: Auto merged storage/ndb/test/ndbapi/testDataBuffers.cpp: Auto merged storage/ndb/test/ndbapi/testDeadlock.cpp: Auto merged storage/ndb/test/ndbapi/testDict.cpp: Auto merged storage/ndb/test/ndbapi/testGrepVerify.cpp: Auto merged storage/ndb/test/ndbapi/testIndex.cpp: Auto merged storage/ndb/test/ndbapi/testInterpreter.cpp: Auto merged storage/ndb/test/ndbapi/testMgm.cpp: Auto merged storage/ndb/test/ndbapi/testNdbApi.cpp: Auto merged storage/ndb/test/ndbapi/testNodeRestart.cpp: Auto merged storage/ndb/test/ndbapi/testOIBasic.cpp: Auto merged storage/ndb/test/ndbapi/testOperations.cpp: Auto merged storage/ndb/test/ndbapi/testOrderedIndex.cpp: Auto merged storage/ndb/test/ndbapi/testPartitioning.cpp: Auto merged storage/ndb/test/ndbapi/testReadPerf.cpp: Auto merged storage/ndb/test/ndbapi/bank/Bank.cpp: Auto merged storage/ndb/test/ndbapi/bank/Bank.hpp: Auto merged storage/ndb/test/ndbapi/bank/BankLoad.cpp: Auto merged storage/ndb/test/ndbapi/bank/bankCreator.cpp: Auto merged storage/ndb/test/ndbapi/bank/bankMakeGL.cpp: Auto merged storage/ndb/test/ndbapi/bank/bankSumAccounts.cpp: Auto merged storage/ndb/test/ndbapi/bank/bankTimer.cpp: Auto merged storage/ndb/test/ndbapi/bank/bankTransactionMaker.cpp: Auto merged storage/ndb/test/ndbapi/bank/bankValidateAllGLs.cpp: Auto merged storage/ndb/test/ndbapi/bank/testBank.cpp: Auto merged storage/ndb/test/ndbapi/bench/asyncGenerator.cpp: Auto merged storage/ndb/test/ndbapi/bench/dbGenerator.h: Auto merged storage/ndb/test/ndbapi/bench/dbPopulate.cpp: Auto merged storage/ndb/test/ndbapi/bench/dbPopulate.h: Auto merged storage/ndb/test/ndbapi/bench/macros.h: Auto merged storage/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp: Auto merged storage/ndb/test/ndbapi/bench/mainPopulate.cpp: Auto merged storage/ndb/test/ndbapi/bench/ndb_async1.cpp: Auto merged storage/ndb/test/ndbapi/bench/ndb_async2.cpp: Auto merged storage/ndb/test/ndbapi/testRestartGci.cpp: Auto merged storage/ndb/test/ndbapi/testSRBank.cpp: Auto merged storage/ndb/test/ndbapi/testScan.cpp: Auto merged storage/ndb/test/ndbapi/testScanInterpreter.cpp: Auto merged storage/ndb/test/ndbapi/testScanPerf.cpp: Auto merged storage/ndb/test/ndbapi/testSystemRestart.cpp: Auto merged storage/ndb/test/ndbapi/testTimeout.cpp: Auto merged storage/ndb/test/ndbapi/testTransactions.cpp: Auto merged storage/ndb/test/ndbapi/test_event.cpp: Auto merged storage/ndb/test/ndbapi/test_event_merge.cpp: Auto merged storage/ndb/test/ndbapi/test_event_multi_table.cpp: Auto merged storage/ndb/test/ndbapi/userInterface.cpp: Auto merged storage/ndb/test/ndbapi/bench/ndb_error.hpp: Auto merged storage/ndb/test/ndbapi/bench/ndb_schema.hpp: Auto merged storage/ndb/test/ndbapi/bench/ndb_user_transaction.cpp: Auto merged storage/ndb/test/ndbapi/bench/ndb_user_transaction2.cpp: Auto merged storage/ndb/test/ndbapi/bench/ndb_user_transaction3.cpp: Auto merged storage/ndb/test/ndbapi/bench/ndb_user_transaction4.cpp: Auto merged storage/ndb/test/ndbapi/bench/ndb_user_transaction5.cpp: Auto merged storage/ndb/test/ndbapi/bench/ndb_user_transaction6.cpp: Auto merged storage/ndb/test/ndbapi/bench/testData.h: Auto merged storage/ndb/test/ndbapi/bench/testDefinitions.h: Auto merged storage/ndb/test/ndbapi/bench/userInterface.cpp: Auto merged storage/ndb/test/ndbapi/bench/userInterface.h: Auto merged storage/ndb/test/newtonapi/basic_test/basic/basic.cpp: Auto merged storage/ndb/test/newtonapi/basic_test/bulk_read/br_test.cpp: Auto merged storage/ndb/test/newtonapi/basic_test/common.cpp: Auto merged storage/ndb/test/newtonapi/basic_test/common.hpp: Auto merged storage/ndb/test/newtonapi/basic_test/ptr_binding/ptr_binding_test.cpp: Auto merged storage/ndb/test/newtonapi/basic_test/too_basic.cpp: Auto merged storage/ndb/test/newtonapi/perf_test/perf.cpp: Auto merged storage/ndb/test/odbc/SQL99_test/SQL99_test.cpp: Auto merged storage/ndb/test/odbc/SQL99_test/SQL99_test.h: Auto merged storage/ndb/test/odbc/client/NDBT_ALLOCHANDLE.cpp: Auto merged storage/ndb/test/odbc/client/NDBT_ALLOCHANDLE_HDBC.cpp: Auto merged storage/ndb/test/odbc/client/NDBT_SQLConnect.cpp: Auto merged storage/ndb/test/odbc/client/NDBT_SQLPrepare.cpp: Auto merged storage/ndb/test/odbc/client/SQLAllocEnvTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLAllocHandleTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLAllocHandleTest_bf.cpp: Auto merged storage/ndb/test/odbc/client/SQLBindColTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLBindParameterTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLCancelTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLCloseCursorTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLColAttributeTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLColAttributeTest1.cpp: Auto merged storage/ndb/test/odbc/client/SQLColAttributeTest2.cpp: Auto merged storage/ndb/test/odbc/client/SQLColAttributeTest3.cpp: Auto merged storage/ndb/test/odbc/client/SQLConnectTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLCopyDescTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLDescribeColTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLDisconnectTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLDriverConnectTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLEndTranTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLErrorTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLExecDirectTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLExecuteTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLFetchScrollTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLFetchTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLFreeHandleTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLFreeStmtTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetConnectAttrTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetCursorNameTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetDataTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetDescFieldTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetDescRecTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetDiagFieldTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetDiagRecSimpleTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetDiagRecTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetEnvAttrTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetFunctionsTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetInfoTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetStmtAttrTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLGetTypeInfoTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLMoreResultsTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLNumResultColsTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLParamDataTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLPrepareTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLPutDataTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLRowCountTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLSetConnectAttrTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLSetCursorNameTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLSetDescFieldTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLSetDescRecTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLSetEnvAttrTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLSetStmtAttrTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLTablesTest.cpp: Auto merged storage/ndb/test/odbc/client/SQLTransactTest.cpp: Auto merged storage/ndb/test/odbc/client/common.hpp: Auto merged storage/ndb/test/odbc/client/main.cpp: Auto merged storage/ndb/test/odbc/driver/testOdbcDriver.cpp: Auto merged storage/ndb/test/odbc/test_compiler/test_compiler.cpp: Auto merged storage/ndb/test/run-test/main.cpp: Auto merged storage/ndb/test/run-test/run-test.hpp: Auto merged storage/ndb/test/src/CpcClient.cpp: Auto merged storage/ndb/test/src/HugoAsynchTransactions.cpp: Auto merged storage/ndb/test/src/HugoCalculator.cpp: Auto merged storage/ndb/test/src/HugoOperations.cpp: Auto merged storage/ndb/test/src/HugoTransactions.cpp: Auto merged storage/ndb/test/src/NDBT_Error.cpp: Auto merged storage/ndb/test/src/NDBT_Output.cpp: Auto merged storage/ndb/test/src/NDBT_ResultRow.cpp: Auto merged storage/ndb/test/src/NDBT_ReturnCodes.cpp: Auto merged storage/ndb/test/src/NDBT_Table.cpp: Auto merged storage/ndb/test/src/NDBT_Tables.cpp: Auto merged storage/ndb/test/src/NDBT_Test.cpp: Auto merged storage/ndb/test/src/NdbBackup.cpp: Auto merged storage/ndb/test/src/NdbConfig.cpp: Auto merged storage/ndb/test/src/NdbGrep.cpp: Auto merged storage/ndb/test/src/NdbRestarter.cpp: Auto merged storage/ndb/test/src/NdbRestarts.cpp: Auto merged storage/ndb/test/src/NdbSchemaCon.cpp: Auto merged storage/ndb/test/src/NdbSchemaOp.cpp: Auto merged storage/ndb/test/src/UtilTransactions.cpp: Auto merged storage/ndb/test/tools/copy_tab.cpp: Auto merged storage/ndb/test/tools/cpcc.cpp: Auto merged storage/ndb/test/tools/create_index.cpp: Auto merged storage/ndb/test/tools/hugoCalculator.cpp: Auto merged storage/ndb/test/tools/hugoFill.cpp: Auto merged storage/ndb/test/tools/hugoLoad.cpp: Auto merged storage/ndb/test/tools/hugoLockRecords.cpp: Auto merged storage/ndb/test/tools/hugoPkDelete.cpp: Auto merged storage/ndb/test/tools/hugoPkRead.cpp: Auto merged storage/ndb/test/tools/hugoPkReadRecord.cpp: Auto merged storage/ndb/test/tools/hugoPkUpdate.cpp: Auto merged storage/ndb/test/tools/hugoScanRead.cpp: Auto merged storage/ndb/test/tools/hugoScanUpdate.cpp: Auto merged storage/ndb/test/tools/restart.cpp: Auto merged storage/ndb/test/tools/transproxy.cpp: Auto merged storage/ndb/test/tools/verify_index.cpp: Auto merged storage/ndb/tools/delete_all.cpp: Auto merged storage/ndb/tools/desc.cpp: Auto merged storage/ndb/tools/drop_index.cpp: Auto merged storage/ndb/tools/drop_tab.cpp: Auto merged storage/ndb/tools/listTables.cpp: Auto merged storage/ndb/tools/ndb_condig.cpp: Auto merged storage/ndb/tools/ndb_test_platform.cpp: Auto merged storage/ndb/tools/ndbsql.cpp: Auto merged storage/ndb/tools/restore/Restore.cpp: Auto merged storage/ndb/tools/restore/Restore.hpp: Auto merged storage/ndb/tools/restore/consumer.cpp: Auto merged storage/ndb/tools/restore/consumer.hpp: Auto merged storage/ndb/tools/restore/consumer_printer.cpp: Auto merged storage/ndb/tools/restore/consumer_printer.hpp: Auto merged storage/ndb/tools/restore/consumer_restore.cpp: Auto merged storage/ndb/tools/restore/consumer_restore.hpp: Auto merged storage/ndb/tools/restore/consumer_restorem.cpp: Auto merged storage/ndb/tools/restore/restore_main.cpp: Auto merged storage/ndb/tools/select_all.cpp: Auto merged storage/ndb/tools/select_count.cpp: Auto merged storage/ndb/tools/waiter.cpp: Auto merged strings/Makefile.am: Auto merged strings/ctype-big5.c: Auto merged strings/ctype-bin.c: Auto merged strings/ctype-cp932.c: Auto merged strings/ctype-euc_kr.c: Auto merged strings/ctype-eucjpms.c: Auto merged strings/ctype-gb2312.c: Auto merged strings/ctype-gbk.c: Auto merged strings/ctype-latin1.c: Auto merged strings/ctype-mb.c: Auto merged strings/ctype-simple.c: Auto merged strings/ctype-sjis.c: Auto merged strings/ctype-tis620.c: Auto merged strings/ctype-ucs2.c: Auto merged strings/ctype-ujis.c: Auto merged strings/ctype-utf8.c: Auto merged strings/ctype-win1250ch.c: Auto merged strings/ctype.c: Auto merged strings/decimal.c: Auto merged strings/strxnmov.c: Auto merged strings/xml.c: Auto merged tests/Makefile.am: Auto merged tests/mysql_client_test.c: Auto merged vio/Makefile.am: Auto merged vio/vio.c: Auto merged vio/viosocket.c: Auto merged vio/viossl.c: Auto merged vio/viosslfactories.c: Auto merged zlib/Makefile.am: Auto merged
3248 lines
83 KiB
C++
3248 lines
83 KiB
C++
/* Copyright (C) 2000-2003 MySQL AB
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
|
|
/* This file defines all time functions */
|
|
|
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
|
#pragma implementation // gcc: Class implementation
|
|
#endif
|
|
|
|
#include "mysql_priv.h"
|
|
#include <m_ctype.h>
|
|
#include <time.h>
|
|
|
|
/* TODO: Move month and days to language files */
|
|
|
|
/* Day number for Dec 31st, 9999 */
|
|
#define MAX_DAY_NUMBER 3652424L
|
|
|
|
/*
|
|
OPTIMIZATION TODO:
|
|
- Replace the switch with a function that should be called for each
|
|
date type.
|
|
- Remove sprintf and opencode the conversion, like we do in
|
|
Field_datetime.
|
|
|
|
The reason for this functions existence is that as we don't have a
|
|
way to know if a datetime/time value has microseconds in them
|
|
we are now only adding microseconds to the output if the
|
|
value has microseconds.
|
|
|
|
We can't use a standard make_date_time() for this as we don't know
|
|
if someone will use %f in the format specifier in which case we would get
|
|
the microseconds twice.
|
|
*/
|
|
|
|
static bool make_datetime(date_time_format_types format, TIME *ltime,
|
|
String *str)
|
|
{
|
|
char *buff;
|
|
CHARSET_INFO *cs= &my_charset_bin;
|
|
uint length= 30;
|
|
|
|
if (str->alloc(length))
|
|
return 1;
|
|
buff= (char*) str->ptr();
|
|
|
|
switch (format) {
|
|
case TIME_ONLY:
|
|
length= cs->cset->snprintf(cs, buff, length, "%s%02d:%02d:%02d",
|
|
ltime->neg ? "-" : "",
|
|
ltime->hour, ltime->minute, ltime->second);
|
|
break;
|
|
case TIME_MICROSECOND:
|
|
length= cs->cset->snprintf(cs, buff, length, "%s%02d:%02d:%02d.%06ld",
|
|
ltime->neg ? "-" : "",
|
|
ltime->hour, ltime->minute, ltime->second,
|
|
ltime->second_part);
|
|
break;
|
|
case DATE_ONLY:
|
|
length= cs->cset->snprintf(cs, buff, length, "%04d-%02d-%02d",
|
|
ltime->year, ltime->month, ltime->day);
|
|
break;
|
|
case DATE_TIME:
|
|
length= cs->cset->snprintf(cs, buff, length,
|
|
"%04d-%02d-%02d %02d:%02d:%02d",
|
|
ltime->year, ltime->month, ltime->day,
|
|
ltime->hour, ltime->minute, ltime->second);
|
|
break;
|
|
case DATE_TIME_MICROSECOND:
|
|
length= cs->cset->snprintf(cs, buff, length,
|
|
"%04d-%02d-%02d %02d:%02d:%02d.%06ld",
|
|
ltime->year, ltime->month, ltime->day,
|
|
ltime->hour, ltime->minute, ltime->second,
|
|
ltime->second_part);
|
|
break;
|
|
}
|
|
|
|
str->length(length);
|
|
str->set_charset(cs);
|
|
return 0;
|
|
}
|
|
|
|
|
|
/*
|
|
Wrapper over make_datetime() with validation of the input TIME value
|
|
|
|
NOTE
|
|
see make_datetime() for more information
|
|
|
|
RETURN
|
|
1 if there was an error during converion
|
|
0 otherwise
|
|
*/
|
|
|
|
static bool make_datetime_with_warn(date_time_format_types format, TIME *ltime,
|
|
String *str)
|
|
{
|
|
int warning= 0;
|
|
|
|
if (make_datetime(format, ltime, str))
|
|
return 1;
|
|
if (check_time_range(ltime, &warning))
|
|
return 1;
|
|
if (!warning)
|
|
return 0;
|
|
|
|
make_truncated_value_warning(current_thd, str->ptr(), str->length(),
|
|
MYSQL_TIMESTAMP_TIME, NullS);
|
|
return make_datetime(format, ltime, str);
|
|
}
|
|
|
|
|
|
/*
|
|
Wrapper over make_time() with validation of the input TIME value
|
|
|
|
NOTE
|
|
see make_time() for more info
|
|
|
|
RETURN
|
|
1 if there was an error during conversion
|
|
0 otherwise
|
|
*/
|
|
|
|
static bool make_time_with_warn(const DATE_TIME_FORMAT *format,
|
|
TIME *l_time, String *str)
|
|
{
|
|
int warning= 0;
|
|
make_time(format, l_time, str);
|
|
if (check_time_range(l_time, &warning))
|
|
return 1;
|
|
if (warning)
|
|
{
|
|
make_truncated_value_warning(current_thd, str->ptr(), str->length(),
|
|
MYSQL_TIMESTAMP_TIME, NullS);
|
|
make_time(format, l_time, str);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
/*
|
|
Convert seconds to TIME value with overflow checking
|
|
|
|
SYNOPSIS:
|
|
sec_to_time()
|
|
seconds number of seconds
|
|
unsigned_flag 1, if 'seconds' is unsigned, 0, otherwise
|
|
ltime output TIME value
|
|
|
|
DESCRIPTION
|
|
If the 'seconds' argument is inside TIME data range, convert it to a
|
|
corresponding value.
|
|
Otherwise, truncate the resulting value to the nearest endpoint, and
|
|
produce a warning message.
|
|
|
|
RETURN
|
|
1 if the value was truncated during conversion
|
|
0 otherwise
|
|
*/
|
|
|
|
static bool sec_to_time(longlong seconds, bool unsigned_flag, TIME *ltime)
|
|
{
|
|
uint sec;
|
|
|
|
bzero((char *)ltime, sizeof(*ltime));
|
|
|
|
if (seconds < 0)
|
|
{
|
|
if (unsigned_flag)
|
|
goto overflow;
|
|
ltime->neg= 1;
|
|
if (seconds < -3020399)
|
|
goto overflow;
|
|
seconds= -seconds;
|
|
}
|
|
else if (seconds > 3020399)
|
|
goto overflow;
|
|
|
|
sec= (uint) ((ulonglong) seconds % 3600);
|
|
ltime->hour= (uint) (seconds/3600);
|
|
ltime->minute= sec/60;
|
|
ltime->second= sec % 60;
|
|
|
|
return 0;
|
|
|
|
overflow:
|
|
ltime->hour= TIME_MAX_HOUR;
|
|
ltime->minute= TIME_MAX_MINUTE;
|
|
ltime->second= TIME_MAX_SECOND;
|
|
|
|
char buf[22];
|
|
int len= (int)(longlong10_to_str(seconds, buf, unsigned_flag ? 10 : -10)
|
|
- buf);
|
|
make_truncated_value_warning(current_thd, buf, len, MYSQL_TIMESTAMP_TIME,
|
|
NullS);
|
|
|
|
return 1;
|
|
}
|
|
|
|
|
|
/*
|
|
Date formats corresponding to compound %r and %T conversion specifiers
|
|
|
|
Note: We should init at least first element of "positions" array
|
|
(first member) or hpux11 compiler will die horribly.
|
|
*/
|
|
static DATE_TIME_FORMAT time_ampm_format= {{0}, '\0', 0,
|
|
{(char *)"%I:%i:%S %p", 11}};
|
|
static DATE_TIME_FORMAT time_24hrs_format= {{0}, '\0', 0,
|
|
{(char *)"%H:%i:%S", 8}};
|
|
|
|
/*
|
|
Extract datetime value to TIME struct from string value
|
|
according to format string.
|
|
|
|
SYNOPSIS
|
|
extract_date_time()
|
|
format date/time format specification
|
|
val String to decode
|
|
length Length of string
|
|
l_time Store result here
|
|
cached_timestamp_type
|
|
It uses to get an appropriate warning
|
|
in the case when the value is truncated.
|
|
sub_pattern_end if non-zero then we are parsing string which
|
|
should correspond compound specifier (like %T or
|
|
%r) and this parameter is pointer to place where
|
|
pointer to end of string matching this specifier
|
|
should be stored.
|
|
NOTE
|
|
Possibility to parse strings matching to patterns equivalent to compound
|
|
specifiers is mainly intended for use from inside of this function in
|
|
order to understand %T and %r conversion specifiers, so number of
|
|
conversion specifiers that can be used in such sub-patterns is limited.
|
|
Also most of checks are skipped in this case.
|
|
|
|
If one adds new format specifiers to this function he should also
|
|
consider adding them to get_date_time_result_type() function.
|
|
|
|
RETURN
|
|
0 ok
|
|
1 error
|
|
*/
|
|
|
|
static bool extract_date_time(DATE_TIME_FORMAT *format,
|
|
const char *val, uint length, TIME *l_time,
|
|
timestamp_type cached_timestamp_type,
|
|
const char **sub_pattern_end,
|
|
const char *date_time_type)
|
|
{
|
|
int weekday= 0, yearday= 0, daypart= 0;
|
|
int week_number= -1;
|
|
int error= 0;
|
|
int strict_week_number_year= -1;
|
|
int frac_part;
|
|
bool usa_time= 0;
|
|
bool sunday_first_n_first_week_non_iso;
|
|
bool strict_week_number;
|
|
bool strict_week_number_year_type;
|
|
const char *val_begin= val;
|
|
const char *val_end= val + length;
|
|
const char *ptr= format->format.str;
|
|
const char *end= ptr + format->format.length;
|
|
CHARSET_INFO *cs= &my_charset_bin;
|
|
DBUG_ENTER("extract_date_time");
|
|
|
|
LINT_INIT(strict_week_number);
|
|
/* Remove valgrind varnings when using gcc 3.3 and -O1 */
|
|
PURIFY_OR_LINT_INIT(strict_week_number_year_type);
|
|
PURIFY_OR_LINT_INIT(sunday_first_n_first_week_non_iso);
|
|
|
|
if (!sub_pattern_end)
|
|
bzero((char*) l_time, sizeof(*l_time));
|
|
|
|
for (; ptr != end && val != val_end; ptr++)
|
|
{
|
|
/* Skip pre-space between each argument */
|
|
while (val != val_end && my_isspace(cs, *val))
|
|
val++;
|
|
|
|
if (*ptr == '%' && ptr+1 != end)
|
|
{
|
|
int val_len;
|
|
char *tmp;
|
|
|
|
error= 0;
|
|
|
|
val_len= (uint) (val_end - val);
|
|
switch (*++ptr) {
|
|
/* Year */
|
|
case 'Y':
|
|
tmp= (char*) val + min(4, val_len);
|
|
l_time->year= (int) my_strtoll10(val, &tmp, &error);
|
|
val= tmp;
|
|
break;
|
|
case 'y':
|
|
tmp= (char*) val + min(2, val_len);
|
|
l_time->year= (int) my_strtoll10(val, &tmp, &error);
|
|
val= tmp;
|
|
l_time->year+= (l_time->year < YY_PART_YEAR ? 2000 : 1900);
|
|
break;
|
|
|
|
/* Month */
|
|
case 'm':
|
|
case 'c':
|
|
tmp= (char*) val + min(2, val_len);
|
|
l_time->month= (int) my_strtoll10(val, &tmp, &error);
|
|
val= tmp;
|
|
break;
|
|
case 'M':
|
|
if ((l_time->month= check_word(my_locale_en_US.month_names,
|
|
val, val_end, &val)) <= 0)
|
|
goto err;
|
|
break;
|
|
case 'b':
|
|
if ((l_time->month= check_word(my_locale_en_US.ab_month_names,
|
|
val, val_end, &val)) <= 0)
|
|
goto err;
|
|
break;
|
|
/* Day */
|
|
case 'd':
|
|
case 'e':
|
|
tmp= (char*) val + min(2, val_len);
|
|
l_time->day= (int) my_strtoll10(val, &tmp, &error);
|
|
val= tmp;
|
|
break;
|
|
case 'D':
|
|
tmp= (char*) val + min(2, val_len);
|
|
l_time->day= (int) my_strtoll10(val, &tmp, &error);
|
|
/* Skip 'st, 'nd, 'th .. */
|
|
val= tmp + min((int) (val_end-tmp), 2);
|
|
break;
|
|
|
|
/* Hour */
|
|
case 'h':
|
|
case 'I':
|
|
case 'l':
|
|
usa_time= 1;
|
|
/* fall through */
|
|
case 'k':
|
|
case 'H':
|
|
tmp= (char*) val + min(2, val_len);
|
|
l_time->hour= (int) my_strtoll10(val, &tmp, &error);
|
|
val= tmp;
|
|
break;
|
|
|
|
/* Minute */
|
|
case 'i':
|
|
tmp= (char*) val + min(2, val_len);
|
|
l_time->minute= (int) my_strtoll10(val, &tmp, &error);
|
|
val= tmp;
|
|
break;
|
|
|
|
/* Second */
|
|
case 's':
|
|
case 'S':
|
|
tmp= (char*) val + min(2, val_len);
|
|
l_time->second= (int) my_strtoll10(val, &tmp, &error);
|
|
val= tmp;
|
|
break;
|
|
|
|
/* Second part */
|
|
case 'f':
|
|
tmp= (char*) val_end;
|
|
if (tmp - val > 6)
|
|
tmp= (char*) val + 6;
|
|
l_time->second_part= (int) my_strtoll10(val, &tmp, &error);
|
|
frac_part= 6 - (tmp - val);
|
|
if (frac_part > 0)
|
|
l_time->second_part*= (ulong) log_10_int[frac_part];
|
|
val= tmp;
|
|
break;
|
|
|
|
/* AM / PM */
|
|
case 'p':
|
|
if (val_len < 2 || ! usa_time)
|
|
goto err;
|
|
if (!my_strnncoll(&my_charset_latin1,
|
|
(const uchar *) val, 2,
|
|
(const uchar *) "PM", 2))
|
|
daypart= 12;
|
|
else if (my_strnncoll(&my_charset_latin1,
|
|
(const uchar *) val, 2,
|
|
(const uchar *) "AM", 2))
|
|
goto err;
|
|
val+= 2;
|
|
break;
|
|
|
|
/* Exotic things */
|
|
case 'W':
|
|
if ((weekday= check_word(my_locale_en_US.day_names, val, val_end, &val)) <= 0)
|
|
goto err;
|
|
break;
|
|
case 'a':
|
|
if ((weekday= check_word(my_locale_en_US.ab_day_names, val, val_end, &val)) <= 0)
|
|
goto err;
|
|
break;
|
|
case 'w':
|
|
tmp= (char*) val + 1;
|
|
if ((weekday= (int) my_strtoll10(val, &tmp, &error)) < 0 ||
|
|
weekday >= 7)
|
|
goto err;
|
|
/* We should use the same 1 - 7 scale for %w as for %W */
|
|
if (!weekday)
|
|
weekday= 7;
|
|
val= tmp;
|
|
break;
|
|
case 'j':
|
|
tmp= (char*) val + min(val_len, 3);
|
|
yearday= (int) my_strtoll10(val, &tmp, &error);
|
|
val= tmp;
|
|
break;
|
|
|
|
/* Week numbers */
|
|
case 'V':
|
|
case 'U':
|
|
case 'v':
|
|
case 'u':
|
|
sunday_first_n_first_week_non_iso= (*ptr=='U' || *ptr== 'V');
|
|
strict_week_number= (*ptr=='V' || *ptr=='v');
|
|
tmp= (char*) val + min(val_len, 2);
|
|
if ((week_number= (int) my_strtoll10(val, &tmp, &error)) < 0 ||
|
|
strict_week_number && !week_number ||
|
|
week_number > 53)
|
|
goto err;
|
|
val= tmp;
|
|
break;
|
|
|
|
/* Year used with 'strict' %V and %v week numbers */
|
|
case 'X':
|
|
case 'x':
|
|
strict_week_number_year_type= (*ptr=='X');
|
|
tmp= (char*) val + min(4, val_len);
|
|
strict_week_number_year= (int) my_strtoll10(val, &tmp, &error);
|
|
val= tmp;
|
|
break;
|
|
|
|
/* Time in AM/PM notation */
|
|
case 'r':
|
|
/*
|
|
We can't just set error here, as we don't want to generate two
|
|
warnings in case of errors
|
|
*/
|
|
if (extract_date_time(&time_ampm_format, val,
|
|
(uint)(val_end - val), l_time,
|
|
cached_timestamp_type, &val, "time"))
|
|
DBUG_RETURN(1);
|
|
break;
|
|
|
|
/* Time in 24-hour notation */
|
|
case 'T':
|
|
if (extract_date_time(&time_24hrs_format, val,
|
|
(uint)(val_end - val), l_time,
|
|
cached_timestamp_type, &val, "time"))
|
|
DBUG_RETURN(1);
|
|
break;
|
|
|
|
/* Conversion specifiers that match classes of characters */
|
|
case '.':
|
|
while (my_ispunct(cs, *val) && val != val_end)
|
|
val++;
|
|
break;
|
|
case '@':
|
|
while (my_isalpha(cs, *val) && val != val_end)
|
|
val++;
|
|
break;
|
|
case '#':
|
|
while (my_isdigit(cs, *val) && val != val_end)
|
|
val++;
|
|
break;
|
|
default:
|
|
goto err;
|
|
}
|
|
if (error) // Error from my_strtoll10
|
|
goto err;
|
|
}
|
|
else if (!my_isspace(cs, *ptr))
|
|
{
|
|
if (*val != *ptr)
|
|
goto err;
|
|
val++;
|
|
}
|
|
}
|
|
if (usa_time)
|
|
{
|
|
if (l_time->hour > 12 || l_time->hour < 1)
|
|
goto err;
|
|
l_time->hour= l_time->hour%12+daypart;
|
|
}
|
|
|
|
/*
|
|
If we are recursively called for parsing string matching compound
|
|
specifiers we are already done.
|
|
*/
|
|
if (sub_pattern_end)
|
|
{
|
|
*sub_pattern_end= val;
|
|
DBUG_RETURN(0);
|
|
}
|
|
|
|
if (yearday > 0)
|
|
{
|
|
uint days= calc_daynr(l_time->year,1,1) + yearday - 1;
|
|
if (days <= 0 || days > MAX_DAY_NUMBER)
|
|
goto err;
|
|
get_date_from_daynr(days,&l_time->year,&l_time->month,&l_time->day);
|
|
}
|
|
|
|
if (week_number >= 0 && weekday)
|
|
{
|
|
int days;
|
|
uint weekday_b;
|
|
|
|
/*
|
|
%V,%v require %X,%x resprectively,
|
|
%U,%u should be used with %Y and not %X or %x
|
|
*/
|
|
if (strict_week_number &&
|
|
(strict_week_number_year < 0 ||
|
|
strict_week_number_year_type != sunday_first_n_first_week_non_iso) ||
|
|
!strict_week_number && strict_week_number_year >= 0)
|
|
goto err;
|
|
|
|
/* Number of days since year 0 till 1st Jan of this year */
|
|
days= calc_daynr((strict_week_number ? strict_week_number_year :
|
|
l_time->year),
|
|
1, 1);
|
|
/* Which day of week is 1st Jan of this year */
|
|
weekday_b= calc_weekday(days, sunday_first_n_first_week_non_iso);
|
|
|
|
/*
|
|
Below we are going to sum:
|
|
1) number of days since year 0 till 1st day of 1st week of this year
|
|
2) number of days between 1st week and our week
|
|
3) and position of our day in the week
|
|
*/
|
|
if (sunday_first_n_first_week_non_iso)
|
|
{
|
|
days+= ((weekday_b == 0) ? 0 : 7) - weekday_b +
|
|
(week_number - 1) * 7 +
|
|
weekday % 7;
|
|
}
|
|
else
|
|
{
|
|
days+= ((weekday_b <= 3) ? 0 : 7) - weekday_b +
|
|
(week_number - 1) * 7 +
|
|
(weekday - 1);
|
|
}
|
|
|
|
if (days <= 0 || days > MAX_DAY_NUMBER)
|
|
goto err;
|
|
get_date_from_daynr(days,&l_time->year,&l_time->month,&l_time->day);
|
|
}
|
|
|
|
if (l_time->month > 12 || l_time->day > 31 || l_time->hour > 23 ||
|
|
l_time->minute > 59 || l_time->second > 59)
|
|
goto err;
|
|
|
|
if (val != val_end)
|
|
{
|
|
do
|
|
{
|
|
if (!my_isspace(&my_charset_latin1,*val))
|
|
{
|
|
make_truncated_value_warning(current_thd, val_begin, length,
|
|
cached_timestamp_type, NullS);
|
|
break;
|
|
}
|
|
} while (++val != val_end);
|
|
}
|
|
DBUG_RETURN(0);
|
|
|
|
err:
|
|
{
|
|
char buff[128];
|
|
strmake(buff, val_begin, min(length, sizeof(buff)-1));
|
|
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
|
|
ER_WRONG_VALUE_FOR_TYPE, ER(ER_WRONG_VALUE_FOR_TYPE),
|
|
date_time_type, buff, "str_to_time");
|
|
}
|
|
DBUG_RETURN(1);
|
|
}
|
|
|
|
|
|
/*
|
|
Create a formated date/time value in a string
|
|
*/
|
|
|
|
bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
|
|
timestamp_type type, String *str)
|
|
{
|
|
char intbuff[15];
|
|
uint hours_i;
|
|
uint weekday;
|
|
ulong length;
|
|
const char *ptr, *end;
|
|
MY_LOCALE *locale;
|
|
THD *thd= current_thd;
|
|
char buf[STRING_BUFFER_USUAL_SIZE];
|
|
String tmp(buf, sizeof(buf), thd->variables.character_set_results);
|
|
uint errors= 0;
|
|
|
|
tmp.length(0);
|
|
str->length(0);
|
|
str->set_charset(&my_charset_bin);
|
|
locale = thd->variables.lc_time_names;
|
|
|
|
if (l_time->neg)
|
|
str->append('-');
|
|
|
|
end= (ptr= format->format.str) + format->format.length;
|
|
for (; ptr != end ; ptr++)
|
|
{
|
|
if (*ptr != '%' || ptr+1 == end)
|
|
str->append(*ptr);
|
|
else
|
|
{
|
|
switch (*++ptr) {
|
|
case 'M':
|
|
if (!l_time->month)
|
|
return 1;
|
|
tmp.copy(locale->month_names->type_names[l_time->month-1],
|
|
strlen(locale->month_names->type_names[l_time->month-1]),
|
|
system_charset_info, tmp.charset(), &errors);
|
|
str->append(tmp.ptr(), tmp.length());
|
|
break;
|
|
case 'b':
|
|
if (!l_time->month)
|
|
return 1;
|
|
tmp.copy(locale->ab_month_names->type_names[l_time->month-1],
|
|
strlen(locale->ab_month_names->type_names[l_time->month-1]),
|
|
system_charset_info, tmp.charset(), &errors);
|
|
str->append(tmp.ptr(), tmp.length());
|
|
break;
|
|
case 'W':
|
|
if (type == MYSQL_TIMESTAMP_TIME)
|
|
return 1;
|
|
weekday= calc_weekday(calc_daynr(l_time->year,l_time->month,
|
|
l_time->day),0);
|
|
tmp.copy(locale->day_names->type_names[weekday],
|
|
strlen(locale->day_names->type_names[weekday]),
|
|
system_charset_info, tmp.charset(), &errors);
|
|
str->append(tmp.ptr(), tmp.length());
|
|
break;
|
|
case 'a':
|
|
if (type == MYSQL_TIMESTAMP_TIME)
|
|
return 1;
|
|
weekday=calc_weekday(calc_daynr(l_time->year,l_time->month,
|
|
l_time->day),0);
|
|
tmp.copy(locale->ab_day_names->type_names[weekday],
|
|
strlen(locale->ab_day_names->type_names[weekday]),
|
|
system_charset_info, tmp.charset(), &errors);
|
|
str->append(tmp.ptr(), tmp.length());
|
|
break;
|
|
case 'D':
|
|
if (type == MYSQL_TIMESTAMP_TIME)
|
|
return 1;
|
|
length= int10_to_str(l_time->day, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 1, '0');
|
|
if (l_time->day >= 10 && l_time->day <= 19)
|
|
str->append(STRING_WITH_LEN("th"));
|
|
else
|
|
{
|
|
switch (l_time->day %10) {
|
|
case 1:
|
|
str->append(STRING_WITH_LEN("st"));
|
|
break;
|
|
case 2:
|
|
str->append(STRING_WITH_LEN("nd"));
|
|
break;
|
|
case 3:
|
|
str->append(STRING_WITH_LEN("rd"));
|
|
break;
|
|
default:
|
|
str->append(STRING_WITH_LEN("th"));
|
|
break;
|
|
}
|
|
}
|
|
break;
|
|
case 'Y':
|
|
length= int10_to_str(l_time->year, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 4, '0');
|
|
break;
|
|
case 'y':
|
|
length= int10_to_str(l_time->year%100, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 2, '0');
|
|
break;
|
|
case 'm':
|
|
length= int10_to_str(l_time->month, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 2, '0');
|
|
break;
|
|
case 'c':
|
|
length= int10_to_str(l_time->month, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 1, '0');
|
|
break;
|
|
case 'd':
|
|
length= int10_to_str(l_time->day, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 2, '0');
|
|
break;
|
|
case 'e':
|
|
length= int10_to_str(l_time->day, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 1, '0');
|
|
break;
|
|
case 'f':
|
|
length= int10_to_str(l_time->second_part, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 6, '0');
|
|
break;
|
|
case 'H':
|
|
length= int10_to_str(l_time->hour, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 2, '0');
|
|
break;
|
|
case 'h':
|
|
case 'I':
|
|
hours_i= (l_time->hour%24 + 11)%12+1;
|
|
length= int10_to_str(hours_i, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 2, '0');
|
|
break;
|
|
case 'i': /* minutes */
|
|
length= int10_to_str(l_time->minute, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 2, '0');
|
|
break;
|
|
case 'j':
|
|
if (type == MYSQL_TIMESTAMP_TIME)
|
|
return 1;
|
|
length= int10_to_str(calc_daynr(l_time->year,l_time->month,
|
|
l_time->day) -
|
|
calc_daynr(l_time->year,1,1) + 1, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 3, '0');
|
|
break;
|
|
case 'k':
|
|
length= int10_to_str(l_time->hour, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 1, '0');
|
|
break;
|
|
case 'l':
|
|
hours_i= (l_time->hour%24 + 11)%12+1;
|
|
length= int10_to_str(hours_i, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 1, '0');
|
|
break;
|
|
case 'p':
|
|
hours_i= l_time->hour%24;
|
|
str->append(hours_i < 12 ? "AM" : "PM",2);
|
|
break;
|
|
case 'r':
|
|
length= my_sprintf(intbuff,
|
|
(intbuff,
|
|
((l_time->hour % 24) < 12) ?
|
|
"%02d:%02d:%02d AM" : "%02d:%02d:%02d PM",
|
|
(l_time->hour+11)%12+1,
|
|
l_time->minute,
|
|
l_time->second));
|
|
str->append(intbuff, length);
|
|
break;
|
|
case 'S':
|
|
case 's':
|
|
length= int10_to_str(l_time->second, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 2, '0');
|
|
break;
|
|
case 'T':
|
|
length= my_sprintf(intbuff,
|
|
(intbuff,
|
|
"%02d:%02d:%02d",
|
|
l_time->hour,
|
|
l_time->minute,
|
|
l_time->second));
|
|
str->append(intbuff, length);
|
|
break;
|
|
case 'U':
|
|
case 'u':
|
|
{
|
|
uint year;
|
|
if (type == MYSQL_TIMESTAMP_TIME)
|
|
return 1;
|
|
length= int10_to_str(calc_week(l_time,
|
|
(*ptr) == 'U' ?
|
|
WEEK_FIRST_WEEKDAY : WEEK_MONDAY_FIRST,
|
|
&year),
|
|
intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 2, '0');
|
|
}
|
|
break;
|
|
case 'v':
|
|
case 'V':
|
|
{
|
|
uint year;
|
|
if (type == MYSQL_TIMESTAMP_TIME)
|
|
return 1;
|
|
length= int10_to_str(calc_week(l_time,
|
|
((*ptr) == 'V' ?
|
|
(WEEK_YEAR | WEEK_FIRST_WEEKDAY) :
|
|
(WEEK_YEAR | WEEK_MONDAY_FIRST)),
|
|
&year),
|
|
intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 2, '0');
|
|
}
|
|
break;
|
|
case 'x':
|
|
case 'X':
|
|
{
|
|
uint year;
|
|
if (type == MYSQL_TIMESTAMP_TIME)
|
|
return 1;
|
|
(void) calc_week(l_time,
|
|
((*ptr) == 'X' ?
|
|
WEEK_YEAR | WEEK_FIRST_WEEKDAY :
|
|
WEEK_YEAR | WEEK_MONDAY_FIRST),
|
|
&year);
|
|
length= int10_to_str(year, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 4, '0');
|
|
}
|
|
break;
|
|
case 'w':
|
|
if (type == MYSQL_TIMESTAMP_TIME)
|
|
return 1;
|
|
weekday=calc_weekday(calc_daynr(l_time->year,l_time->month,
|
|
l_time->day),1);
|
|
length= int10_to_str(weekday, intbuff, 10) - intbuff;
|
|
str->append_with_prefill(intbuff, length, 1, '0');
|
|
break;
|
|
|
|
default:
|
|
str->append(*ptr);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
/*
|
|
Get a array of positive numbers from a string object.
|
|
Each number is separated by 1 non digit character
|
|
Return error if there is too many numbers.
|
|
If there is too few numbers, assume that the numbers are left out
|
|
from the high end. This allows one to give:
|
|
DAY_TO_SECOND as "D MM:HH:SS", "MM:HH:SS" "HH:SS" or as seconds.
|
|
|
|
SYNOPSIS
|
|
str: string value
|
|
length: length of str
|
|
cs: charset of str
|
|
values: array of results
|
|
count: count of elements in result array
|
|
transform_msec: if value is true we suppose
|
|
that the last part of string value is microseconds
|
|
and we should transform value to six digit value.
|
|
For example, '1.1' -> '1.100000'
|
|
*/
|
|
|
|
static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
|
|
uint count, ulonglong *values,
|
|
bool transform_msec)
|
|
{
|
|
const char *end=str+length;
|
|
uint i;
|
|
while (str != end && !my_isdigit(cs,*str))
|
|
str++;
|
|
|
|
for (i=0 ; i < count ; i++)
|
|
{
|
|
longlong value;
|
|
const char *start= str;
|
|
for (value=0; str != end && my_isdigit(cs,*str) ; str++)
|
|
value= value*LL(10) + (longlong) (*str - '0');
|
|
if (transform_msec && i == count - 1) // microseconds always last
|
|
{
|
|
long msec_length= 6 - (str - start);
|
|
if (msec_length > 0)
|
|
value*= (long) log_10_int[msec_length];
|
|
}
|
|
values[i]= value;
|
|
while (str != end && !my_isdigit(cs,*str))
|
|
str++;
|
|
if (str == end && i != count-1)
|
|
{
|
|
i++;
|
|
/* Change values[0...i-1] -> values[0...count-1] */
|
|
bmove_upp((char*) (values+count), (char*) (values+i),
|
|
sizeof(*values)*i);
|
|
bzero((char*) values, sizeof(*values)*(count-i));
|
|
break;
|
|
}
|
|
}
|
|
return (str != end);
|
|
}
|
|
|
|
|
|
longlong Item_func_period_add::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
ulong period=(ulong) args[0]->val_int();
|
|
int months=(int) args[1]->val_int();
|
|
|
|
if ((null_value=args[0]->null_value || args[1]->null_value) ||
|
|
period == 0L)
|
|
return 0; /* purecov: inspected */
|
|
return (longlong)
|
|
convert_month_to_period((uint) ((int) convert_period_to_month(period)+
|
|
months));
|
|
}
|
|
|
|
|
|
longlong Item_func_period_diff::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
ulong period1=(ulong) args[0]->val_int();
|
|
ulong period2=(ulong) args[1]->val_int();
|
|
|
|
if ((null_value=args[0]->null_value || args[1]->null_value))
|
|
return 0; /* purecov: inspected */
|
|
return (longlong) ((long) convert_period_to_month(period1)-
|
|
(long) convert_period_to_month(period2));
|
|
}
|
|
|
|
|
|
|
|
longlong Item_func_to_days::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
if (get_arg0_date(<ime, TIME_NO_ZERO_DATE))
|
|
return 0;
|
|
return (longlong) calc_daynr(ltime.year,ltime.month,ltime.day);
|
|
}
|
|
|
|
|
|
/*
|
|
Get information about this Item tree monotonicity
|
|
|
|
SYNOPSIS
|
|
Item_func_to_days::get_monotonicity_info()
|
|
|
|
DESCRIPTION
|
|
Get information about monotonicity of the function represented by this item
|
|
tree.
|
|
|
|
RETURN
|
|
See enum_monotonicity_info.
|
|
*/
|
|
|
|
enum_monotonicity_info Item_func_to_days::get_monotonicity_info() const
|
|
{
|
|
if (args[0]->type() == Item::FIELD_ITEM)
|
|
{
|
|
if (args[0]->field_type() == MYSQL_TYPE_DATE)
|
|
return MONOTONIC_STRICT_INCREASING;
|
|
if (args[0]->field_type() == MYSQL_TYPE_DATETIME)
|
|
return MONOTONIC_INCREASING;
|
|
}
|
|
return NON_MONOTONIC;
|
|
}
|
|
|
|
|
|
longlong Item_func_dayofyear::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
if (get_arg0_date(<ime,TIME_NO_ZERO_DATE))
|
|
return 0;
|
|
return (longlong) calc_daynr(ltime.year,ltime.month,ltime.day) -
|
|
calc_daynr(ltime.year,1,1) + 1;
|
|
}
|
|
|
|
longlong Item_func_dayofmonth::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
(void) get_arg0_date(<ime, TIME_FUZZY_DATE);
|
|
return (longlong) ltime.day;
|
|
}
|
|
|
|
longlong Item_func_month::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
(void) get_arg0_date(<ime, TIME_FUZZY_DATE);
|
|
return (longlong) ltime.month;
|
|
}
|
|
|
|
|
|
String* Item_func_monthname::val_str(String* str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
const char *month_name;
|
|
uint month= (uint) val_int();
|
|
THD *thd= current_thd;
|
|
|
|
if (null_value || !month)
|
|
{
|
|
null_value=1;
|
|
return (String*) 0;
|
|
}
|
|
null_value=0;
|
|
month_name= thd->variables.lc_time_names->month_names->type_names[month-1];
|
|
str->set(month_name, strlen(month_name), system_charset_info);
|
|
return str;
|
|
}
|
|
|
|
|
|
// Returns the quarter of the year
|
|
|
|
longlong Item_func_quarter::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
(void) get_arg0_date(<ime, TIME_FUZZY_DATE);
|
|
return (longlong) ((ltime.month+2)/3);
|
|
}
|
|
|
|
longlong Item_func_hour::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
(void) get_arg0_time(<ime);
|
|
return ltime.hour;
|
|
}
|
|
|
|
longlong Item_func_minute::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
(void) get_arg0_time(<ime);
|
|
return ltime.minute;
|
|
}
|
|
// Returns the second in time_exp in the range of 0 - 59
|
|
|
|
longlong Item_func_second::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
(void) get_arg0_time(<ime);
|
|
return ltime.second;
|
|
}
|
|
|
|
|
|
uint week_mode(uint mode)
|
|
{
|
|
uint week_format= (mode & 7);
|
|
if (!(week_format & WEEK_MONDAY_FIRST))
|
|
week_format^= WEEK_FIRST_WEEKDAY;
|
|
return week_format;
|
|
}
|
|
|
|
/*
|
|
The bits in week_format(for calc_week() function) has the following meaning:
|
|
WEEK_MONDAY_FIRST (0) If not set Sunday is first day of week
|
|
If set Monday is first day of week
|
|
WEEK_YEAR (1) If not set Week is in range 0-53
|
|
|
|
Week 0 is returned for the the last week of the previous year (for
|
|
a date at start of january) In this case one can get 53 for the
|
|
first week of next year. This flag ensures that the week is
|
|
relevant for the given year. Note that this flag is only
|
|
releveant if WEEK_JANUARY is not set.
|
|
|
|
If set Week is in range 1-53.
|
|
|
|
In this case one may get week 53 for a date in January (when
|
|
the week is that last week of previous year) and week 1 for a
|
|
date in December.
|
|
|
|
WEEK_FIRST_WEEKDAY (2) If not set Weeks are numbered according
|
|
to ISO 8601:1988
|
|
If set The week that contains the first
|
|
'first-day-of-week' is week 1.
|
|
|
|
ISO 8601:1988 means that if the week containing January 1 has
|
|
four or more days in the new year, then it is week 1;
|
|
Otherwise it is the last week of the previous year, and the
|
|
next week is week 1.
|
|
*/
|
|
|
|
longlong Item_func_week::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
uint year;
|
|
TIME ltime;
|
|
if (get_arg0_date(<ime, TIME_NO_ZERO_DATE))
|
|
return 0;
|
|
return (longlong) calc_week(<ime,
|
|
week_mode((uint) args[1]->val_int()),
|
|
&year);
|
|
}
|
|
|
|
|
|
longlong Item_func_yearweek::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
uint year,week;
|
|
TIME ltime;
|
|
if (get_arg0_date(<ime, TIME_NO_ZERO_DATE))
|
|
return 0;
|
|
week= calc_week(<ime,
|
|
(week_mode((uint) args[1]->val_int()) | WEEK_YEAR),
|
|
&year);
|
|
return week+year*100;
|
|
}
|
|
|
|
|
|
longlong Item_func_weekday::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
|
|
if (get_arg0_date(<ime, TIME_NO_ZERO_DATE))
|
|
return 0;
|
|
|
|
return (longlong) calc_weekday(calc_daynr(ltime.year, ltime.month,
|
|
ltime.day),
|
|
odbc_type) + test(odbc_type);
|
|
}
|
|
|
|
|
|
String* Item_func_dayname::val_str(String* str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
uint weekday=(uint) val_int(); // Always Item_func_daynr()
|
|
const char *name;
|
|
THD *thd= current_thd;
|
|
|
|
if (null_value)
|
|
return (String*) 0;
|
|
|
|
name= thd->variables.lc_time_names->day_names->type_names[weekday];
|
|
str->set(name, strlen(name), system_charset_info);
|
|
return str;
|
|
}
|
|
|
|
|
|
longlong Item_func_year::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
(void) get_arg0_date(<ime, TIME_FUZZY_DATE);
|
|
return (longlong) ltime.year;
|
|
}
|
|
|
|
|
|
/*
|
|
Get information about this Item tree monotonicity
|
|
|
|
SYNOPSIS
|
|
Item_func_to_days::get_monotonicity_info()
|
|
|
|
DESCRIPTION
|
|
Get information about monotonicity of the function represented by this item
|
|
tree.
|
|
|
|
RETURN
|
|
See enum_monotonicity_info.
|
|
*/
|
|
|
|
enum_monotonicity_info Item_func_year::get_monotonicity_info() const
|
|
{
|
|
if (args[0]->type() == Item::FIELD_ITEM &&
|
|
(args[0]->field_type() == MYSQL_TYPE_DATE ||
|
|
args[0]->field_type() == MYSQL_TYPE_DATETIME))
|
|
return MONOTONIC_INCREASING;
|
|
return NON_MONOTONIC;
|
|
}
|
|
|
|
longlong Item_func_unix_timestamp::val_int()
|
|
{
|
|
TIME ltime;
|
|
my_bool not_used;
|
|
|
|
DBUG_ASSERT(fixed == 1);
|
|
if (arg_count == 0)
|
|
return (longlong) current_thd->query_start();
|
|
if (args[0]->type() == FIELD_ITEM)
|
|
{ // Optimize timestamp field
|
|
Field *field=((Item_field*) args[0])->field;
|
|
if (field->type() == MYSQL_TYPE_TIMESTAMP)
|
|
return ((Field_timestamp*) field)->get_timestamp(&null_value);
|
|
}
|
|
|
|
if (get_arg0_date(<ime, 0))
|
|
{
|
|
/*
|
|
We have to set null_value again because get_arg0_date will also set it
|
|
to true if we have wrong datetime parameter (and we should return 0 in
|
|
this case).
|
|
*/
|
|
null_value= args[0]->null_value;
|
|
return 0;
|
|
}
|
|
|
|
return (longlong) TIME_to_timestamp(current_thd, <ime, ¬_used);
|
|
}
|
|
|
|
|
|
longlong Item_func_time_to_sec::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
longlong seconds;
|
|
(void) get_arg0_time(<ime);
|
|
seconds=ltime.hour*3600L+ltime.minute*60+ltime.second;
|
|
return ltime.neg ? -seconds : seconds;
|
|
}
|
|
|
|
|
|
/*
|
|
Convert a string to a interval value
|
|
To make code easy, allow interval objects without separators.
|
|
*/
|
|
|
|
bool get_interval_value(Item *args,interval_type int_type,
|
|
String *str_value, INTERVAL *interval)
|
|
{
|
|
ulonglong array[5];
|
|
longlong value;
|
|
const char *str;
|
|
uint32 length;
|
|
CHARSET_INFO *cs=str_value->charset();
|
|
|
|
LINT_INIT(value);
|
|
LINT_INIT(str);
|
|
LINT_INIT(length);
|
|
|
|
bzero((char*) interval,sizeof(*interval));
|
|
if ((int) int_type <= INTERVAL_MICROSECOND)
|
|
{
|
|
value= args->val_int();
|
|
if (args->null_value)
|
|
return 1;
|
|
if (value < 0)
|
|
{
|
|
interval->neg=1;
|
|
value= -value;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
String *res;
|
|
if (!(res=args->val_str(str_value)))
|
|
return (1);
|
|
|
|
/* record negative intervalls in interval->neg */
|
|
str=res->ptr();
|
|
const char *end=str+res->length();
|
|
while (str != end && my_isspace(cs,*str))
|
|
str++;
|
|
if (str != end && *str == '-')
|
|
{
|
|
interval->neg=1;
|
|
str++;
|
|
}
|
|
length=(uint32) (end-str); // Set up pointers to new str
|
|
}
|
|
|
|
switch (int_type) {
|
|
case INTERVAL_YEAR:
|
|
interval->year= (ulong) value;
|
|
break;
|
|
case INTERVAL_QUARTER:
|
|
interval->month= (ulong)(value*3);
|
|
break;
|
|
case INTERVAL_MONTH:
|
|
interval->month= (ulong) value;
|
|
break;
|
|
case INTERVAL_WEEK:
|
|
interval->day= (ulong)(value*7);
|
|
break;
|
|
case INTERVAL_DAY:
|
|
interval->day= (ulong) value;
|
|
break;
|
|
case INTERVAL_HOUR:
|
|
interval->hour= (ulong) value;
|
|
break;
|
|
case INTERVAL_MICROSECOND:
|
|
interval->second_part=value;
|
|
break;
|
|
case INTERVAL_MINUTE:
|
|
interval->minute=value;
|
|
break;
|
|
case INTERVAL_SECOND:
|
|
interval->second=value;
|
|
break;
|
|
case INTERVAL_YEAR_MONTH: // Allow YEAR-MONTH YYYYYMM
|
|
if (get_interval_info(str,length,cs,2,array,0))
|
|
return (1);
|
|
interval->year= (ulong) array[0];
|
|
interval->month= (ulong) array[1];
|
|
break;
|
|
case INTERVAL_DAY_HOUR:
|
|
if (get_interval_info(str,length,cs,2,array,0))
|
|
return (1);
|
|
interval->day= (ulong) array[0];
|
|
interval->hour= (ulong) array[1];
|
|
break;
|
|
case INTERVAL_DAY_MICROSECOND:
|
|
if (get_interval_info(str,length,cs,5,array,1))
|
|
return (1);
|
|
interval->day= (ulong) array[0];
|
|
interval->hour= (ulong) array[1];
|
|
interval->minute= array[2];
|
|
interval->second= array[3];
|
|
interval->second_part= array[4];
|
|
break;
|
|
case INTERVAL_DAY_MINUTE:
|
|
if (get_interval_info(str,length,cs,3,array,0))
|
|
return (1);
|
|
interval->day= (ulong) array[0];
|
|
interval->hour= (ulong) array[1];
|
|
interval->minute= array[2];
|
|
break;
|
|
case INTERVAL_DAY_SECOND:
|
|
if (get_interval_info(str,length,cs,4,array,0))
|
|
return (1);
|
|
interval->day= (ulong) array[0];
|
|
interval->hour= (ulong) array[1];
|
|
interval->minute= array[2];
|
|
interval->second= array[3];
|
|
break;
|
|
case INTERVAL_HOUR_MICROSECOND:
|
|
if (get_interval_info(str,length,cs,4,array,1))
|
|
return (1);
|
|
interval->hour= (ulong) array[0];
|
|
interval->minute= array[1];
|
|
interval->second= array[2];
|
|
interval->second_part= array[3];
|
|
break;
|
|
case INTERVAL_HOUR_MINUTE:
|
|
if (get_interval_info(str,length,cs,2,array,0))
|
|
return (1);
|
|
interval->hour= (ulong) array[0];
|
|
interval->minute= array[1];
|
|
break;
|
|
case INTERVAL_HOUR_SECOND:
|
|
if (get_interval_info(str,length,cs,3,array,0))
|
|
return (1);
|
|
interval->hour= (ulong) array[0];
|
|
interval->minute= array[1];
|
|
interval->second= array[2];
|
|
break;
|
|
case INTERVAL_MINUTE_MICROSECOND:
|
|
if (get_interval_info(str,length,cs,3,array,1))
|
|
return (1);
|
|
interval->minute= array[0];
|
|
interval->second= array[1];
|
|
interval->second_part= array[2];
|
|
break;
|
|
case INTERVAL_MINUTE_SECOND:
|
|
if (get_interval_info(str,length,cs,2,array,0))
|
|
return (1);
|
|
interval->minute= array[0];
|
|
interval->second= array[1];
|
|
break;
|
|
case INTERVAL_SECOND_MICROSECOND:
|
|
if (get_interval_info(str,length,cs,2,array,1))
|
|
return (1);
|
|
interval->second= array[0];
|
|
interval->second_part= array[1];
|
|
break;
|
|
case INTERVAL_LAST: /* purecov: begin deadcode */
|
|
DBUG_ASSERT(0);
|
|
break; /* purecov: end */
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
String *Item_date::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
if (get_date(<ime, TIME_FUZZY_DATE))
|
|
return (String *) 0;
|
|
if (str->alloc(11))
|
|
{
|
|
null_value= 1;
|
|
return (String *) 0;
|
|
}
|
|
make_date((DATE_TIME_FORMAT *) 0, <ime, str);
|
|
return str;
|
|
}
|
|
|
|
|
|
longlong Item_date::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
if (get_date(<ime, TIME_FUZZY_DATE))
|
|
return 0;
|
|
return (longlong) (ltime.year*10000L+ltime.month*100+ltime.day);
|
|
}
|
|
|
|
|
|
bool Item_func_from_days::get_date(TIME *ltime, uint fuzzy_date)
|
|
{
|
|
longlong value=args[0]->val_int();
|
|
if ((null_value=args[0]->null_value))
|
|
return 1;
|
|
bzero(ltime, sizeof(TIME));
|
|
get_date_from_daynr((long) value, <ime->year, <ime->month, <ime->day);
|
|
ltime->time_type= MYSQL_TIMESTAMP_DATE;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_curdate::fix_length_and_dec()
|
|
{
|
|
collation.set(&my_charset_bin);
|
|
decimals=0;
|
|
max_length=MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
|
|
|
|
store_now_in_TIME(<ime);
|
|
|
|
/* We don't need to set second_part and neg because they already 0 */
|
|
ltime.hour= ltime.minute= ltime.second= 0;
|
|
ltime.time_type= MYSQL_TIMESTAMP_DATE;
|
|
value= (longlong) TIME_to_ulonglong_date(<ime);
|
|
}
|
|
|
|
String *Item_func_curdate::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
if (str->alloc(11))
|
|
{
|
|
null_value= 1;
|
|
return (String *) 0;
|
|
}
|
|
make_date((DATE_TIME_FORMAT *) 0, <ime, str);
|
|
return str;
|
|
}
|
|
|
|
/*
|
|
Converts current time in my_time_t to TIME represenatation for local
|
|
time zone. Defines time zone (local) used for whole CURDATE function.
|
|
*/
|
|
void Item_func_curdate_local::store_now_in_TIME(TIME *now_time)
|
|
{
|
|
THD *thd= current_thd;
|
|
thd->variables.time_zone->gmt_sec_to_TIME(now_time,
|
|
(my_time_t)thd->query_start());
|
|
thd->time_zone_used= 1;
|
|
}
|
|
|
|
|
|
/*
|
|
Converts current time in my_time_t to TIME represenatation for UTC
|
|
time zone. Defines time zone (UTC) used for whole UTC_DATE function.
|
|
*/
|
|
void Item_func_curdate_utc::store_now_in_TIME(TIME *now_time)
|
|
{
|
|
my_tz_UTC->gmt_sec_to_TIME(now_time,
|
|
(my_time_t)(current_thd->query_start()));
|
|
/*
|
|
We are not flagging this query as using time zone, since it uses fixed
|
|
UTC-SYSTEM time-zone.
|
|
*/
|
|
}
|
|
|
|
|
|
bool Item_func_curdate::get_date(TIME *res,
|
|
uint fuzzy_date __attribute__((unused)))
|
|
{
|
|
*res=ltime;
|
|
return 0;
|
|
}
|
|
|
|
|
|
String *Item_func_curtime::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
str_value.set(buff, buff_length, &my_charset_bin);
|
|
return &str_value;
|
|
}
|
|
|
|
|
|
void Item_func_curtime::fix_length_and_dec()
|
|
{
|
|
TIME ltime;
|
|
|
|
decimals= DATETIME_DEC;
|
|
collation.set(&my_charset_bin);
|
|
store_now_in_TIME(<ime);
|
|
value= TIME_to_ulonglong_time(<ime);
|
|
buff_length= (uint) my_time_to_str(<ime, buff);
|
|
max_length= buff_length;
|
|
}
|
|
|
|
|
|
/*
|
|
Converts current time in my_time_t to TIME represenatation for local
|
|
time zone. Defines time zone (local) used for whole CURTIME function.
|
|
*/
|
|
void Item_func_curtime_local::store_now_in_TIME(TIME *now_time)
|
|
{
|
|
THD *thd= current_thd;
|
|
thd->variables.time_zone->gmt_sec_to_TIME(now_time,
|
|
(my_time_t)thd->query_start());
|
|
thd->time_zone_used= 1;
|
|
}
|
|
|
|
|
|
/*
|
|
Converts current time in my_time_t to TIME represenatation for UTC
|
|
time zone. Defines time zone (UTC) used for whole UTC_TIME function.
|
|
*/
|
|
void Item_func_curtime_utc::store_now_in_TIME(TIME *now_time)
|
|
{
|
|
my_tz_UTC->gmt_sec_to_TIME(now_time,
|
|
(my_time_t)(current_thd->query_start()));
|
|
/*
|
|
We are not flagging this query as using time zone, since it uses fixed
|
|
UTC-SYSTEM time-zone.
|
|
*/
|
|
}
|
|
|
|
|
|
String *Item_func_now::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
str_value.set(buff,buff_length, &my_charset_bin);
|
|
return &str_value;
|
|
}
|
|
|
|
|
|
void Item_func_now::fix_length_and_dec()
|
|
{
|
|
decimals= DATETIME_DEC;
|
|
collation.set(&my_charset_bin);
|
|
|
|
store_now_in_TIME(<ime);
|
|
value= (longlong) TIME_to_ulonglong_datetime(<ime);
|
|
|
|
buff_length= (uint) my_datetime_to_str(<ime, buff);
|
|
max_length= buff_length;
|
|
}
|
|
|
|
|
|
/*
|
|
Converts current time in my_time_t to TIME represenatation for local
|
|
time zone. Defines time zone (local) used for whole NOW function.
|
|
*/
|
|
void Item_func_now_local::store_now_in_TIME(TIME *now_time)
|
|
{
|
|
THD *thd= current_thd;
|
|
thd->variables.time_zone->gmt_sec_to_TIME(now_time,
|
|
(my_time_t)thd->query_start());
|
|
thd->time_zone_used= 1;
|
|
}
|
|
|
|
|
|
/*
|
|
Converts current time in my_time_t to TIME represenatation for UTC
|
|
time zone. Defines time zone (UTC) used for whole UTC_TIMESTAMP function.
|
|
*/
|
|
void Item_func_now_utc::store_now_in_TIME(TIME *now_time)
|
|
{
|
|
my_tz_UTC->gmt_sec_to_TIME(now_time,
|
|
(my_time_t)(current_thd->query_start()));
|
|
/*
|
|
We are not flagging this query as using time zone, since it uses fixed
|
|
UTC-SYSTEM time-zone.
|
|
*/
|
|
}
|
|
|
|
|
|
bool Item_func_now::get_date(TIME *res,
|
|
uint fuzzy_date __attribute__((unused)))
|
|
{
|
|
*res= ltime;
|
|
return 0;
|
|
}
|
|
|
|
|
|
int Item_func_now::save_in_field(Field *to, bool no_conversions)
|
|
{
|
|
to->set_notnull();
|
|
to->store_time(<ime, MYSQL_TIMESTAMP_DATETIME);
|
|
return 0;
|
|
}
|
|
|
|
|
|
/*
|
|
Converts current time in my_time_t to TIME represenatation for local
|
|
time zone. Defines time zone (local) used for whole SYSDATE function.
|
|
*/
|
|
void Item_func_sysdate_local::store_now_in_TIME(TIME *now_time)
|
|
{
|
|
THD *thd= current_thd;
|
|
thd->variables.time_zone->gmt_sec_to_TIME(now_time, time(NULL));
|
|
thd->time_zone_used= 1;
|
|
}
|
|
|
|
|
|
String *Item_func_sysdate_local::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
store_now_in_TIME(<ime);
|
|
buff_length= (uint) my_datetime_to_str(<ime, buff);
|
|
str_value.set(buff, buff_length, &my_charset_bin);
|
|
return &str_value;
|
|
}
|
|
|
|
|
|
longlong Item_func_sysdate_local::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
store_now_in_TIME(<ime);
|
|
return (longlong) TIME_to_ulonglong_datetime(<ime);
|
|
}
|
|
|
|
|
|
double Item_func_sysdate_local::val_real()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
store_now_in_TIME(<ime);
|
|
return ulonglong2double(TIME_to_ulonglong_datetime(<ime));
|
|
}
|
|
|
|
|
|
void Item_func_sysdate_local::fix_length_and_dec()
|
|
{
|
|
decimals= 0;
|
|
collation.set(&my_charset_bin);
|
|
max_length= MAX_DATETIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
|
|
}
|
|
|
|
|
|
bool Item_func_sysdate_local::get_date(TIME *res,
|
|
uint fuzzy_date __attribute__((unused)))
|
|
{
|
|
store_now_in_TIME(<ime);
|
|
*res= ltime;
|
|
return 0;
|
|
}
|
|
|
|
|
|
int Item_func_sysdate_local::save_in_field(Field *to, bool no_conversions)
|
|
{
|
|
store_now_in_TIME(<ime);
|
|
to->set_notnull();
|
|
to->store_time(<ime, MYSQL_TIMESTAMP_DATETIME);
|
|
return 0;
|
|
}
|
|
|
|
|
|
String *Item_func_sec_to_time::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
|
|
if ((null_value=args[0]->null_value) || str->alloc(19))
|
|
{
|
|
null_value= 1;
|
|
return (String*) 0;
|
|
}
|
|
|
|
sec_to_time(args[0]->val_int(), args[0]->unsigned_flag, <ime);
|
|
|
|
make_time((DATE_TIME_FORMAT *) 0, <ime, str);
|
|
return str;
|
|
}
|
|
|
|
|
|
longlong Item_func_sec_to_time::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
|
|
if ((null_value=args[0]->null_value))
|
|
return 0;
|
|
|
|
sec_to_time(args[0]->val_int(), args[0]->unsigned_flag, <ime);
|
|
|
|
return (ltime.neg ? -1 : 1) *
|
|
((ltime.hour)*10000 + ltime.minute*100 + ltime.second);
|
|
}
|
|
|
|
|
|
void Item_func_date_format::fix_length_and_dec()
|
|
{
|
|
/*
|
|
Must use this_item() in case it's a local SP variable
|
|
(for ->max_length and ->str_value)
|
|
*/
|
|
Item *arg1= args[1]->this_item();
|
|
|
|
decimals=0;
|
|
collation.set(&my_charset_bin);
|
|
if (arg1->type() == STRING_ITEM)
|
|
{ // Optimize the normal case
|
|
fixed_length=1;
|
|
|
|
/*
|
|
The result is a binary string (no reason to use collation->mbmaxlen
|
|
This is becasue make_date_time() only returns binary strings
|
|
*/
|
|
max_length= format_length(&arg1->str_value);
|
|
}
|
|
else
|
|
{
|
|
fixed_length=0;
|
|
/* The result is a binary string (no reason to use collation->mbmaxlen */
|
|
max_length=min(arg1->max_length, MAX_BLOB_WIDTH) * 10;
|
|
set_if_smaller(max_length,MAX_BLOB_WIDTH);
|
|
}
|
|
maybe_null=1; // If wrong date
|
|
}
|
|
|
|
|
|
bool Item_func_date_format::eq(const Item *item, bool binary_cmp) const
|
|
{
|
|
Item_func_date_format *item_func;
|
|
|
|
if (item->type() != FUNC_ITEM)
|
|
return 0;
|
|
if (func_name() != ((Item_func*) item)->func_name())
|
|
return 0;
|
|
if (this == item)
|
|
return 1;
|
|
item_func= (Item_func_date_format*) item;
|
|
if (!args[0]->eq(item_func->args[0], binary_cmp))
|
|
return 0;
|
|
/*
|
|
We must compare format string case sensitive.
|
|
This needed because format modifiers with different case,
|
|
for example %m and %M, have different meaning.
|
|
*/
|
|
if (!args[1]->eq(item_func->args[1], 1))
|
|
return 0;
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
uint Item_func_date_format::format_length(const String *format)
|
|
{
|
|
uint size=0;
|
|
const char *ptr=format->ptr();
|
|
const char *end=ptr+format->length();
|
|
|
|
for (; ptr != end ; ptr++)
|
|
{
|
|
if (*ptr != '%' || ptr == end-1)
|
|
size++;
|
|
else
|
|
{
|
|
switch(*++ptr) {
|
|
case 'M': /* month, textual */
|
|
case 'W': /* day (of the week), textual */
|
|
size += 64; /* large for UTF8 locale data */
|
|
break;
|
|
case 'D': /* day (of the month), numeric plus english suffix */
|
|
case 'Y': /* year, numeric, 4 digits */
|
|
case 'x': /* Year, used with 'v' */
|
|
case 'X': /* Year, used with 'v, where week starts with Monday' */
|
|
size += 4;
|
|
break;
|
|
case 'a': /* locale's abbreviated weekday name (Sun..Sat) */
|
|
case 'b': /* locale's abbreviated month name (Jan.Dec) */
|
|
size += 32; /* large for UTF8 locale data */
|
|
break;
|
|
case 'j': /* day of year (001..366) */
|
|
size += 3;
|
|
break;
|
|
case 'U': /* week (00..52) */
|
|
case 'u': /* week (00..52), where week starts with Monday */
|
|
case 'V': /* week 1..53 used with 'x' */
|
|
case 'v': /* week 1..53 used with 'x', where week starts with Monday */
|
|
case 'y': /* year, numeric, 2 digits */
|
|
case 'm': /* month, numeric */
|
|
case 'd': /* day (of the month), numeric */
|
|
case 'h': /* hour (01..12) */
|
|
case 'I': /* --||-- */
|
|
case 'i': /* minutes, numeric */
|
|
case 'l': /* hour ( 1..12) */
|
|
case 'p': /* locale's AM or PM */
|
|
case 'S': /* second (00..61) */
|
|
case 's': /* seconds, numeric */
|
|
case 'c': /* month (0..12) */
|
|
case 'e': /* day (0..31) */
|
|
size += 2;
|
|
break;
|
|
case 'k': /* hour ( 0..23) */
|
|
case 'H': /* hour (00..23; value > 23 OK, padding always 2-digit) */
|
|
size += 7; /* docs allow > 23, range depends on sizeof(unsigned int) */
|
|
break;
|
|
case 'r': /* time, 12-hour (hh:mm:ss [AP]M) */
|
|
size += 11;
|
|
break;
|
|
case 'T': /* time, 24-hour (hh:mm:ss) */
|
|
size += 8;
|
|
break;
|
|
case 'f': /* microseconds */
|
|
size += 6;
|
|
break;
|
|
case 'w': /* day (of the week), numeric */
|
|
case '%':
|
|
default:
|
|
size++;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return size;
|
|
}
|
|
|
|
|
|
String *Item_func_date_format::val_str(String *str)
|
|
{
|
|
String *format;
|
|
TIME l_time;
|
|
uint size;
|
|
DBUG_ASSERT(fixed == 1);
|
|
|
|
if (!is_time_format)
|
|
{
|
|
if (get_arg0_date(&l_time, TIME_FUZZY_DATE))
|
|
return 0;
|
|
}
|
|
else
|
|
{
|
|
String *res;
|
|
if (!(res=args[0]->val_str(str)) ||
|
|
(str_to_time_with_warn(res->ptr(), res->length(), &l_time)))
|
|
goto null_date;
|
|
|
|
l_time.year=l_time.month=l_time.day=0;
|
|
null_value=0;
|
|
}
|
|
|
|
if (!(format = args[1]->val_str(str)) || !format->length())
|
|
goto null_date;
|
|
|
|
if (fixed_length)
|
|
size=max_length;
|
|
else
|
|
size=format_length(format);
|
|
if (format == str)
|
|
str= &value; // Save result here
|
|
if (str->alloc(size))
|
|
goto null_date;
|
|
|
|
DATE_TIME_FORMAT date_time_format;
|
|
date_time_format.format.str= (char*) format->ptr();
|
|
date_time_format.format.length= format->length();
|
|
|
|
/* Create the result string */
|
|
if (!make_date_time(&date_time_format, &l_time,
|
|
is_time_format ? MYSQL_TIMESTAMP_TIME :
|
|
MYSQL_TIMESTAMP_DATE,
|
|
str))
|
|
return str;
|
|
|
|
null_date:
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_from_unixtime::fix_length_and_dec()
|
|
{
|
|
thd= current_thd;
|
|
collation.set(&my_charset_bin);
|
|
decimals= DATETIME_DEC;
|
|
max_length=MAX_DATETIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
|
|
maybe_null= 1;
|
|
thd->time_zone_used= 1;
|
|
}
|
|
|
|
|
|
String *Item_func_from_unixtime::val_str(String *str)
|
|
{
|
|
TIME time_tmp;
|
|
|
|
DBUG_ASSERT(fixed == 1);
|
|
|
|
if (get_date(&time_tmp, 0))
|
|
return 0;
|
|
|
|
if (str->alloc(20*MY_CHARSET_BIN_MB_MAXLEN))
|
|
{
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
|
|
make_datetime((DATE_TIME_FORMAT *) 0, &time_tmp, str);
|
|
return str;
|
|
}
|
|
|
|
|
|
longlong Item_func_from_unixtime::val_int()
|
|
{
|
|
TIME time_tmp;
|
|
|
|
DBUG_ASSERT(fixed == 1);
|
|
|
|
if (get_date(&time_tmp, 0))
|
|
return 0;
|
|
|
|
return (longlong) TIME_to_ulonglong_datetime(&time_tmp);
|
|
}
|
|
|
|
bool Item_func_from_unixtime::get_date(TIME *ltime,
|
|
uint fuzzy_date __attribute__((unused)))
|
|
{
|
|
ulonglong tmp= (ulonglong)(args[0]->val_int());
|
|
/*
|
|
"tmp > TIMESTAMP_MAX_VALUE" check also covers case of negative
|
|
from_unixtime() argument since tmp is unsigned.
|
|
*/
|
|
if ((null_value= (args[0]->null_value || tmp > TIMESTAMP_MAX_VALUE)))
|
|
return 1;
|
|
|
|
thd->variables.time_zone->gmt_sec_to_TIME(ltime, (my_time_t)tmp);
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_convert_tz::fix_length_and_dec()
|
|
{
|
|
collation.set(&my_charset_bin);
|
|
decimals= 0;
|
|
max_length= MAX_DATETIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
|
|
maybe_null= 1;
|
|
}
|
|
|
|
|
|
bool
|
|
Item_func_convert_tz::fix_fields(THD *thd_arg, Item **ref)
|
|
{
|
|
String str;
|
|
if (Item_date_func::fix_fields(thd_arg, ref))
|
|
return TRUE;
|
|
|
|
tz_tables= thd_arg->lex->time_zone_tables_used;
|
|
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
String *Item_func_convert_tz::val_str(String *str)
|
|
{
|
|
TIME time_tmp;
|
|
|
|
if (get_date(&time_tmp, 0))
|
|
return 0;
|
|
|
|
if (str->alloc(20*MY_CHARSET_BIN_MB_MAXLEN))
|
|
{
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
|
|
make_datetime((DATE_TIME_FORMAT *) 0, &time_tmp, str);
|
|
return str;
|
|
}
|
|
|
|
|
|
longlong Item_func_convert_tz::val_int()
|
|
{
|
|
TIME time_tmp;
|
|
|
|
if (get_date(&time_tmp, 0))
|
|
return 0;
|
|
|
|
return (longlong)TIME_to_ulonglong_datetime(&time_tmp);
|
|
}
|
|
|
|
|
|
bool Item_func_convert_tz::get_date(TIME *ltime,
|
|
uint fuzzy_date __attribute__((unused)))
|
|
{
|
|
my_time_t my_time_tmp;
|
|
String str;
|
|
|
|
if (!from_tz_cached)
|
|
{
|
|
from_tz= my_tz_find(args[1]->val_str(&str), tz_tables);
|
|
from_tz_cached= args[1]->const_item();
|
|
}
|
|
|
|
if (!to_tz_cached)
|
|
{
|
|
to_tz= my_tz_find(args[2]->val_str(&str), tz_tables);
|
|
to_tz_cached= args[2]->const_item();
|
|
}
|
|
|
|
if (from_tz==0 || to_tz==0 || get_arg0_date(ltime, TIME_NO_ZERO_DATE))
|
|
{
|
|
null_value= 1;
|
|
return 1;
|
|
}
|
|
|
|
{
|
|
my_bool not_used;
|
|
my_time_tmp= from_tz->TIME_to_gmt_sec(ltime, ¬_used);
|
|
/* my_time_tmp is guranteed to be in the allowed range */
|
|
if (my_time_tmp)
|
|
to_tz->gmt_sec_to_TIME(ltime, my_time_tmp);
|
|
}
|
|
|
|
null_value= 0;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_convert_tz::cleanup()
|
|
{
|
|
from_tz_cached= to_tz_cached= 0;
|
|
Item_date_func::cleanup();
|
|
}
|
|
|
|
|
|
void Item_date_add_interval::fix_length_and_dec()
|
|
{
|
|
enum_field_types arg0_field_type;
|
|
|
|
collation.set(&my_charset_bin);
|
|
maybe_null=1;
|
|
max_length=MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
|
|
value.alloc(max_length);
|
|
|
|
/*
|
|
The field type for the result of an Item_date function is defined as
|
|
follows:
|
|
|
|
- If first arg is a MYSQL_TYPE_DATETIME result is MYSQL_TYPE_DATETIME
|
|
- If first arg is a MYSQL_TYPE_DATE and the interval type uses hours,
|
|
minutes or seconds then type is MYSQL_TYPE_DATETIME.
|
|
- Otherwise the result is MYSQL_TYPE_STRING
|
|
(This is because you can't know if the string contains a DATE, TIME or
|
|
DATETIME argument)
|
|
*/
|
|
cached_field_type= MYSQL_TYPE_STRING;
|
|
arg0_field_type= args[0]->field_type();
|
|
if (arg0_field_type == MYSQL_TYPE_DATETIME ||
|
|
arg0_field_type == MYSQL_TYPE_TIMESTAMP)
|
|
cached_field_type= MYSQL_TYPE_DATETIME;
|
|
else if (arg0_field_type == MYSQL_TYPE_DATE)
|
|
{
|
|
if (int_type <= INTERVAL_DAY || int_type == INTERVAL_YEAR_MONTH)
|
|
cached_field_type= arg0_field_type;
|
|
else
|
|
cached_field_type= MYSQL_TYPE_DATETIME;
|
|
}
|
|
}
|
|
|
|
|
|
/* Here arg[1] is a Item_interval object */
|
|
|
|
bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
|
|
{
|
|
INTERVAL interval;
|
|
|
|
if (args[0]->get_date(ltime, TIME_NO_ZERO_DATE) ||
|
|
get_interval_value(args[1], int_type, &value, &interval))
|
|
return (null_value=1);
|
|
|
|
if (date_sub_interval)
|
|
interval.neg = !interval.neg;
|
|
if (ltime->year < YY_MAGIC_BELOW)
|
|
return (null_value=1);
|
|
|
|
return (null_value= date_add_interval(ltime, int_type, interval));
|
|
}
|
|
|
|
|
|
String *Item_date_add_interval::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
enum date_time_format_types format;
|
|
|
|
if (Item_date_add_interval::get_date(<ime, TIME_NO_ZERO_DATE))
|
|
return 0;
|
|
|
|
if (ltime.time_type == MYSQL_TIMESTAMP_DATE)
|
|
format= DATE_ONLY;
|
|
else if (ltime.second_part)
|
|
format= DATE_TIME_MICROSECOND;
|
|
else
|
|
format= DATE_TIME;
|
|
|
|
if (!make_datetime(format, <ime, str))
|
|
return str;
|
|
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
longlong Item_date_add_interval::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
longlong date;
|
|
if (Item_date_add_interval::get_date(<ime, TIME_NO_ZERO_DATE))
|
|
return (longlong) 0;
|
|
date = (ltime.year*100L + ltime.month)*100L + ltime.day;
|
|
return ltime.time_type == MYSQL_TIMESTAMP_DATE ? date :
|
|
((date*100L + ltime.hour)*100L+ ltime.minute)*100L + ltime.second;
|
|
}
|
|
|
|
|
|
|
|
bool Item_date_add_interval::eq(const Item *item, bool binary_cmp) const
|
|
{
|
|
Item_date_add_interval *other= (Item_date_add_interval*) item;
|
|
if (!Item_func::eq(item, binary_cmp))
|
|
return 0;
|
|
return ((int_type == other->int_type) &&
|
|
(date_sub_interval == other->date_sub_interval));
|
|
}
|
|
|
|
/*
|
|
'interval_names' reflects the order of the enumeration interval_type.
|
|
See item_timefunc.h
|
|
*/
|
|
|
|
static const char *interval_names[]=
|
|
{
|
|
"year", "quarter", "month", "week", "day",
|
|
"hour", "minute", "second", "microsecond",
|
|
"year_month", "day_hour", "day_minute",
|
|
"day_second", "hour_minute", "hour_second",
|
|
"minute_second", "day_microsecond",
|
|
"hour_microsecond", "minute_microsecond",
|
|
"second_microsecond"
|
|
};
|
|
|
|
void Item_date_add_interval::print(String *str)
|
|
{
|
|
str->append('(');
|
|
args[0]->print(str);
|
|
str->append(date_sub_interval?" - interval ":" + interval ");
|
|
args[1]->print(str);
|
|
str->append(' ');
|
|
str->append(interval_names[int_type]);
|
|
str->append(')');
|
|
}
|
|
|
|
void Item_extract::print(String *str)
|
|
{
|
|
str->append(STRING_WITH_LEN("extract("));
|
|
str->append(interval_names[int_type]);
|
|
str->append(STRING_WITH_LEN(" from "));
|
|
args[0]->print(str);
|
|
str->append(')');
|
|
}
|
|
|
|
void Item_extract::fix_length_and_dec()
|
|
{
|
|
value.alloc(32); // alloc buffer
|
|
|
|
maybe_null=1; // If wrong date
|
|
switch (int_type) {
|
|
case INTERVAL_YEAR: max_length=4; date_value=1; break;
|
|
case INTERVAL_YEAR_MONTH: max_length=6; date_value=1; break;
|
|
case INTERVAL_QUARTER: max_length=2; date_value=1; break;
|
|
case INTERVAL_MONTH: max_length=2; date_value=1; break;
|
|
case INTERVAL_WEEK: max_length=2; date_value=1; break;
|
|
case INTERVAL_DAY: max_length=2; date_value=1; break;
|
|
case INTERVAL_DAY_HOUR: max_length=9; date_value=0; break;
|
|
case INTERVAL_DAY_MINUTE: max_length=11; date_value=0; break;
|
|
case INTERVAL_DAY_SECOND: max_length=13; date_value=0; break;
|
|
case INTERVAL_HOUR: max_length=2; date_value=0; break;
|
|
case INTERVAL_HOUR_MINUTE: max_length=4; date_value=0; break;
|
|
case INTERVAL_HOUR_SECOND: max_length=6; date_value=0; break;
|
|
case INTERVAL_MINUTE: max_length=2; date_value=0; break;
|
|
case INTERVAL_MINUTE_SECOND: max_length=4; date_value=0; break;
|
|
case INTERVAL_SECOND: max_length=2; date_value=0; break;
|
|
case INTERVAL_MICROSECOND: max_length=2; date_value=0; break;
|
|
case INTERVAL_DAY_MICROSECOND: max_length=20; date_value=0; break;
|
|
case INTERVAL_HOUR_MICROSECOND: max_length=13; date_value=0; break;
|
|
case INTERVAL_MINUTE_MICROSECOND: max_length=11; date_value=0; break;
|
|
case INTERVAL_SECOND_MICROSECOND: max_length=9; date_value=0; break;
|
|
case INTERVAL_LAST: DBUG_ASSERT(0); break; /* purecov: deadcode */
|
|
}
|
|
}
|
|
|
|
|
|
longlong Item_extract::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
uint year;
|
|
ulong week_format;
|
|
long neg;
|
|
if (date_value)
|
|
{
|
|
if (get_arg0_date(<ime, TIME_FUZZY_DATE))
|
|
return 0;
|
|
neg=1;
|
|
}
|
|
else
|
|
{
|
|
String *res= args[0]->val_str(&value);
|
|
if (!res || str_to_time_with_warn(res->ptr(), res->length(), <ime))
|
|
{
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
neg= ltime.neg ? -1 : 1;
|
|
null_value=0;
|
|
}
|
|
switch (int_type) {
|
|
case INTERVAL_YEAR: return ltime.year;
|
|
case INTERVAL_YEAR_MONTH: return ltime.year*100L+ltime.month;
|
|
case INTERVAL_QUARTER: return (ltime.month+2)/3;
|
|
case INTERVAL_MONTH: return ltime.month;
|
|
case INTERVAL_WEEK:
|
|
{
|
|
week_format= current_thd->variables.default_week_format;
|
|
return calc_week(<ime, week_mode(week_format), &year);
|
|
}
|
|
case INTERVAL_DAY: return ltime.day;
|
|
case INTERVAL_DAY_HOUR: return (long) (ltime.day*100L+ltime.hour)*neg;
|
|
case INTERVAL_DAY_MINUTE: return (long) (ltime.day*10000L+
|
|
ltime.hour*100L+
|
|
ltime.minute)*neg;
|
|
case INTERVAL_DAY_SECOND: return ((longlong) ltime.day*1000000L+
|
|
(longlong) (ltime.hour*10000L+
|
|
ltime.minute*100+
|
|
ltime.second))*neg;
|
|
case INTERVAL_HOUR: return (long) ltime.hour*neg;
|
|
case INTERVAL_HOUR_MINUTE: return (long) (ltime.hour*100+ltime.minute)*neg;
|
|
case INTERVAL_HOUR_SECOND: return (long) (ltime.hour*10000+ltime.minute*100+
|
|
ltime.second)*neg;
|
|
case INTERVAL_MINUTE: return (long) ltime.minute*neg;
|
|
case INTERVAL_MINUTE_SECOND: return (long) (ltime.minute*100+ltime.second)*neg;
|
|
case INTERVAL_SECOND: return (long) ltime.second*neg;
|
|
case INTERVAL_MICROSECOND: return (long) ltime.second_part*neg;
|
|
case INTERVAL_DAY_MICROSECOND: return (((longlong)ltime.day*1000000L +
|
|
(longlong)ltime.hour*10000L +
|
|
ltime.minute*100 +
|
|
ltime.second)*1000000L +
|
|
ltime.second_part)*neg;
|
|
case INTERVAL_HOUR_MICROSECOND: return (((longlong)ltime.hour*10000L +
|
|
ltime.minute*100 +
|
|
ltime.second)*1000000L +
|
|
ltime.second_part)*neg;
|
|
case INTERVAL_MINUTE_MICROSECOND: return (((longlong)(ltime.minute*100+
|
|
ltime.second))*1000000L+
|
|
ltime.second_part)*neg;
|
|
case INTERVAL_SECOND_MICROSECOND: return ((longlong)ltime.second*1000000L+
|
|
ltime.second_part)*neg;
|
|
case INTERVAL_LAST: DBUG_ASSERT(0); break; /* purecov: deadcode */
|
|
}
|
|
return 0; // Impossible
|
|
}
|
|
|
|
bool Item_extract::eq(const Item *item, bool binary_cmp) const
|
|
{
|
|
if (this == item)
|
|
return 1;
|
|
if (item->type() != FUNC_ITEM ||
|
|
functype() != ((Item_func*)item)->functype())
|
|
return 0;
|
|
|
|
Item_extract* ie= (Item_extract*)item;
|
|
if (ie->int_type != int_type)
|
|
return 0;
|
|
|
|
if (!args[0]->eq(ie->args[0], binary_cmp))
|
|
return 0;
|
|
return 1;
|
|
}
|
|
|
|
|
|
bool Item_char_typecast::eq(const Item *item, bool binary_cmp) const
|
|
{
|
|
if (this == item)
|
|
return 1;
|
|
if (item->type() != FUNC_ITEM ||
|
|
functype() != ((Item_func*)item)->functype())
|
|
return 0;
|
|
|
|
Item_char_typecast *cast= (Item_char_typecast*)item;
|
|
if (cast_length != cast->cast_length ||
|
|
cast_cs != cast->cast_cs)
|
|
return 0;
|
|
|
|
if (!args[0]->eq(cast->args[0], binary_cmp))
|
|
return 0;
|
|
return 1;
|
|
}
|
|
|
|
void Item_typecast::print(String *str)
|
|
{
|
|
str->append(STRING_WITH_LEN("cast("));
|
|
args[0]->print(str);
|
|
str->append(STRING_WITH_LEN(" as "));
|
|
str->append(cast_type());
|
|
str->append(')');
|
|
}
|
|
|
|
|
|
void Item_char_typecast::print(String *str)
|
|
{
|
|
str->append(STRING_WITH_LEN("cast("));
|
|
args[0]->print(str);
|
|
str->append(STRING_WITH_LEN(" as char"));
|
|
if (cast_length >= 0)
|
|
{
|
|
str->append('(');
|
|
char buffer[20];
|
|
// my_charset_bin is good enough for numbers
|
|
String st(buffer, sizeof(buffer), &my_charset_bin);
|
|
st.set((ulonglong)cast_length, &my_charset_bin);
|
|
str->append(st);
|
|
str->append(')');
|
|
}
|
|
if (cast_cs)
|
|
{
|
|
str->append(STRING_WITH_LEN(" charset "));
|
|
str->append(cast_cs->csname);
|
|
}
|
|
str->append(')');
|
|
}
|
|
|
|
String *Item_char_typecast::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res;
|
|
uint32 length;
|
|
|
|
if (!charset_conversion)
|
|
{
|
|
if (!(res= args[0]->val_str(str)))
|
|
{
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// Convert character set if differ
|
|
uint dummy_errors;
|
|
if (!(res= args[0]->val_str(&tmp_value)) ||
|
|
str->copy(res->ptr(), res->length(), from_cs,
|
|
cast_cs, &dummy_errors))
|
|
{
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
res= str;
|
|
}
|
|
|
|
res->set_charset(cast_cs);
|
|
|
|
/*
|
|
Cut the tail if cast with length
|
|
and the result is longer than cast length, e.g.
|
|
CAST('string' AS CHAR(1))
|
|
*/
|
|
if (cast_length >= 0)
|
|
{
|
|
if (res->length() > (length= (uint32) res->charpos(cast_length)))
|
|
{ // Safe even if const arg
|
|
char char_type[40];
|
|
my_snprintf(char_type, sizeof(char_type), "%s(%lu)",
|
|
cast_cs == &my_charset_bin ? "BINARY" : "CHAR",
|
|
(ulong) length);
|
|
|
|
if (!res->alloced_length())
|
|
{ // Don't change const str
|
|
str_value= *res; // Not malloced string
|
|
res= &str_value;
|
|
}
|
|
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
ER_TRUNCATED_WRONG_VALUE,
|
|
ER(ER_TRUNCATED_WRONG_VALUE), char_type,
|
|
res->c_ptr_safe());
|
|
res->length((uint) length);
|
|
}
|
|
else if (cast_cs == &my_charset_bin && res->length() < (uint) cast_length)
|
|
{
|
|
if (res->alloced_length() < (uint) cast_length)
|
|
{
|
|
str->alloc(cast_length);
|
|
str->copy(*res);
|
|
res= str;
|
|
}
|
|
bzero((char*) res->ptr() + res->length(),
|
|
(uint) cast_length - res->length());
|
|
res->length(cast_length);
|
|
}
|
|
}
|
|
null_value= 0;
|
|
return res;
|
|
}
|
|
|
|
|
|
void Item_char_typecast::fix_length_and_dec()
|
|
{
|
|
uint32 char_length;
|
|
/*
|
|
We always force character set conversion if cast_cs
|
|
is a multi-byte character set. It garantees that the
|
|
result of CAST is a well-formed string.
|
|
For single-byte character sets we allow just to copy
|
|
from the argument. A single-byte character sets string
|
|
is always well-formed.
|
|
|
|
There is a special trick to convert form a number to ucs2.
|
|
As numbers have my_charset_bin as their character set,
|
|
it wouldn't do conversion to ucs2 without an additional action.
|
|
To force conversion, we should pretend to be non-binary.
|
|
Let's choose from_cs this way:
|
|
- If the argument in a number and cast_cs is ucs2 (i.e. mbminlen > 1),
|
|
then from_cs is set to latin1, to perform latin1 -> ucs2 conversion.
|
|
- If the argument is a number and cast_cs is ASCII-compatible
|
|
(i.e. mbminlen == 1), then from_cs is set to cast_cs,
|
|
which allows just to take over the args[0]->val_str() result
|
|
and thus avoid unnecessary character set conversion.
|
|
- If the argument is not a number, then from_cs is set to
|
|
the argument's charset.
|
|
*/
|
|
from_cs= (args[0]->result_type() == INT_RESULT ||
|
|
args[0]->result_type() == DECIMAL_RESULT ||
|
|
args[0]->result_type() == REAL_RESULT) ?
|
|
(cast_cs->mbminlen == 1 ? cast_cs : &my_charset_latin1) :
|
|
args[0]->collation.collation;
|
|
charset_conversion= (cast_cs->mbmaxlen > 1) ||
|
|
!my_charset_same(from_cs, cast_cs) &&
|
|
from_cs != &my_charset_bin &&
|
|
cast_cs != &my_charset_bin;
|
|
collation.set(cast_cs, DERIVATION_IMPLICIT);
|
|
char_length= (cast_length >= 0) ? cast_length :
|
|
args[0]->max_length/from_cs->mbmaxlen;
|
|
max_length= char_length * cast_cs->mbmaxlen;
|
|
}
|
|
|
|
|
|
String *Item_datetime_typecast::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
if (!get_arg0_date(<ime, TIME_FUZZY_DATE) &&
|
|
!make_datetime(ltime.second_part ? DATE_TIME_MICROSECOND : DATE_TIME,
|
|
<ime, str))
|
|
return str;
|
|
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
longlong Item_datetime_typecast::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
if (get_arg0_date(<ime,1))
|
|
{
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
|
|
return TIME_to_ulonglong_datetime(<ime);
|
|
}
|
|
|
|
|
|
bool Item_time_typecast::get_time(TIME *ltime)
|
|
{
|
|
bool res= get_arg0_time(ltime);
|
|
/*
|
|
For MYSQL_TIMESTAMP_TIME value we can have non-zero day part,
|
|
which we should not lose.
|
|
*/
|
|
if (ltime->time_type == MYSQL_TIMESTAMP_DATETIME)
|
|
ltime->year= ltime->month= ltime->day= 0;
|
|
ltime->time_type= MYSQL_TIMESTAMP_TIME;
|
|
return res;
|
|
}
|
|
|
|
|
|
longlong Item_time_typecast::val_int()
|
|
{
|
|
TIME ltime;
|
|
if (get_time(<ime))
|
|
{
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
return ltime.hour * 10000L + ltime.minute * 100 + ltime.second;
|
|
}
|
|
|
|
String *Item_time_typecast::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
|
|
if (!get_arg0_time(<ime) &&
|
|
!make_datetime(ltime.second_part ? TIME_MICROSECOND : TIME_ONLY,
|
|
<ime, str))
|
|
return str;
|
|
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
bool Item_date_typecast::get_date(TIME *ltime, uint fuzzy_date)
|
|
{
|
|
bool res= get_arg0_date(ltime, TIME_FUZZY_DATE);
|
|
ltime->hour= ltime->minute= ltime->second= ltime->second_part= 0;
|
|
ltime->time_type= MYSQL_TIMESTAMP_DATE;
|
|
return res;
|
|
}
|
|
|
|
|
|
String *Item_date_typecast::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
|
|
if (!get_arg0_date(<ime, TIME_FUZZY_DATE) && !str->alloc(11))
|
|
{
|
|
make_date((DATE_TIME_FORMAT *) 0, <ime, str);
|
|
return str;
|
|
}
|
|
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
longlong Item_date_typecast::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
if (args[0]->get_date(<ime, TIME_FUZZY_DATE))
|
|
return 0;
|
|
return (longlong) (ltime.year * 10000L + ltime.month * 100 + ltime.day);
|
|
}
|
|
|
|
/*
|
|
MAKEDATE(a,b) is a date function that creates a date value
|
|
from a year and day value.
|
|
*/
|
|
|
|
String *Item_func_makedate::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME l_time;
|
|
long daynr= (long) args[1]->val_int();
|
|
long yearnr= (long) args[0]->val_int();
|
|
long days;
|
|
|
|
if (args[0]->null_value || args[1]->null_value ||
|
|
yearnr < 0 || daynr <= 0)
|
|
goto err;
|
|
|
|
days= calc_daynr(yearnr,1,1) + daynr - 1;
|
|
/* Day number from year 0 to 9999-12-31 */
|
|
if (days >= 0 && days <= MAX_DAY_NUMBER)
|
|
{
|
|
null_value=0;
|
|
get_date_from_daynr(days,&l_time.year,&l_time.month,&l_time.day);
|
|
if (str->alloc(11))
|
|
goto err;
|
|
make_date((DATE_TIME_FORMAT *) 0, &l_time, str);
|
|
return str;
|
|
}
|
|
|
|
err:
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
longlong Item_func_makedate::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME l_time;
|
|
long daynr= (long) args[1]->val_int();
|
|
long yearnr= (long) args[0]->val_int();
|
|
long days;
|
|
|
|
if (args[0]->null_value || args[1]->null_value ||
|
|
yearnr < 0 || daynr <= 0)
|
|
goto err;
|
|
|
|
days= calc_daynr(yearnr,1,1) + daynr - 1;
|
|
/* Day number from year 0 to 9999-12-31 */
|
|
if (days >= 0 && days < MAX_DAY_NUMBER)
|
|
{
|
|
null_value=0;
|
|
get_date_from_daynr(days,&l_time.year,&l_time.month,&l_time.day);
|
|
return (longlong) (l_time.year * 10000L + l_time.month * 100 + l_time.day);
|
|
}
|
|
|
|
err:
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_add_time::fix_length_and_dec()
|
|
{
|
|
enum_field_types arg0_field_type;
|
|
decimals=0;
|
|
max_length=MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
|
|
maybe_null= 1;
|
|
|
|
/*
|
|
The field type for the result of an Item_func_add_time function is defined
|
|
as follows:
|
|
|
|
- If first arg is a MYSQL_TYPE_DATETIME or MYSQL_TYPE_TIMESTAMP
|
|
result is MYSQL_TYPE_DATETIME
|
|
- If first arg is a MYSQL_TYPE_TIME result is MYSQL_TYPE_TIME
|
|
- Otherwise the result is MYSQL_TYPE_STRING
|
|
*/
|
|
|
|
cached_field_type= MYSQL_TYPE_STRING;
|
|
arg0_field_type= args[0]->field_type();
|
|
if (arg0_field_type == MYSQL_TYPE_DATE ||
|
|
arg0_field_type == MYSQL_TYPE_DATETIME ||
|
|
arg0_field_type == MYSQL_TYPE_TIMESTAMP)
|
|
cached_field_type= MYSQL_TYPE_DATETIME;
|
|
else if (arg0_field_type == MYSQL_TYPE_TIME)
|
|
cached_field_type= MYSQL_TYPE_TIME;
|
|
}
|
|
|
|
/*
|
|
ADDTIME(t,a) and SUBTIME(t,a) are time functions that calculate a
|
|
time/datetime value
|
|
|
|
t: time_or_datetime_expression
|
|
a: time_expression
|
|
|
|
Result: Time value or datetime value
|
|
*/
|
|
|
|
String *Item_func_add_time::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME l_time1, l_time2, l_time3;
|
|
bool is_time= 0;
|
|
long days, microseconds;
|
|
longlong seconds;
|
|
int l_sign= sign;
|
|
|
|
null_value=0;
|
|
if (is_date) // TIMESTAMP function
|
|
{
|
|
if (get_arg0_date(&l_time1, TIME_FUZZY_DATE) ||
|
|
args[1]->get_time(&l_time2) ||
|
|
l_time1.time_type == MYSQL_TIMESTAMP_TIME ||
|
|
l_time2.time_type != MYSQL_TIMESTAMP_TIME)
|
|
goto null_date;
|
|
}
|
|
else // ADDTIME function
|
|
{
|
|
if (args[0]->get_time(&l_time1) ||
|
|
args[1]->get_time(&l_time2) ||
|
|
l_time2.time_type == MYSQL_TIMESTAMP_DATETIME)
|
|
goto null_date;
|
|
is_time= (l_time1.time_type == MYSQL_TIMESTAMP_TIME);
|
|
}
|
|
if (l_time1.neg != l_time2.neg)
|
|
l_sign= -l_sign;
|
|
|
|
bzero((char *)&l_time3, sizeof(l_time3));
|
|
|
|
l_time3.neg= calc_time_diff(&l_time1, &l_time2, -l_sign,
|
|
&seconds, µseconds);
|
|
|
|
/*
|
|
If first argument was negative and diff between arguments
|
|
is non-zero we need to swap sign to get proper result.
|
|
*/
|
|
if (l_time1.neg && (seconds || microseconds))
|
|
l_time3.neg= 1-l_time3.neg; // Swap sign of result
|
|
|
|
if (!is_time && l_time3.neg)
|
|
goto null_date;
|
|
|
|
days= (long)(seconds/86400L);
|
|
|
|
calc_time_from_sec(&l_time3, (long)(seconds%86400L), microseconds);
|
|
if (!is_time)
|
|
{
|
|
get_date_from_daynr(days,&l_time3.year,&l_time3.month,&l_time3.day);
|
|
if (l_time3.day &&
|
|
!make_datetime(l_time1.second_part || l_time2.second_part ?
|
|
DATE_TIME_MICROSECOND : DATE_TIME,
|
|
&l_time3, str))
|
|
return str;
|
|
goto null_date;
|
|
}
|
|
|
|
l_time3.hour+= days*24;
|
|
if (!make_datetime_with_warn(l_time1.second_part || l_time2.second_part ?
|
|
TIME_MICROSECOND : TIME_ONLY,
|
|
&l_time3, str))
|
|
return str;
|
|
|
|
null_date:
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_add_time::print(String *str)
|
|
{
|
|
if (is_date)
|
|
{
|
|
DBUG_ASSERT(sign > 0);
|
|
str->append(STRING_WITH_LEN("timestamp("));
|
|
}
|
|
else
|
|
{
|
|
if (sign > 0)
|
|
str->append(STRING_WITH_LEN("addtime("));
|
|
else
|
|
str->append(STRING_WITH_LEN("subtime("));
|
|
}
|
|
args[0]->print(str);
|
|
str->append(',');
|
|
args[1]->print(str);
|
|
str->append(')');
|
|
}
|
|
|
|
|
|
/*
|
|
TIMEDIFF(t,s) is a time function that calculates the
|
|
time value between a start and end time.
|
|
|
|
t and s: time_or_datetime_expression
|
|
Result: Time value
|
|
*/
|
|
|
|
String *Item_func_timediff::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
longlong seconds;
|
|
long microseconds;
|
|
int l_sign= 1;
|
|
TIME l_time1 ,l_time2, l_time3;
|
|
|
|
null_value= 0;
|
|
if (args[0]->get_time(&l_time1) ||
|
|
args[1]->get_time(&l_time2) ||
|
|
l_time1.time_type != l_time2.time_type)
|
|
goto null_date;
|
|
|
|
if (l_time1.neg != l_time2.neg)
|
|
l_sign= -l_sign;
|
|
|
|
bzero((char *)&l_time3, sizeof(l_time3));
|
|
|
|
l_time3.neg= calc_time_diff(&l_time1, &l_time2, l_sign,
|
|
&seconds, µseconds);
|
|
|
|
/*
|
|
For MYSQL_TIMESTAMP_TIME only:
|
|
If first argument was negative and diff between arguments
|
|
is non-zero we need to swap sign to get proper result.
|
|
*/
|
|
if (l_time1.neg && (seconds || microseconds))
|
|
l_time3.neg= 1-l_time3.neg; // Swap sign of result
|
|
|
|
calc_time_from_sec(&l_time3, (long) seconds, microseconds);
|
|
|
|
if (!make_datetime_with_warn(l_time1.second_part || l_time2.second_part ?
|
|
TIME_MICROSECOND : TIME_ONLY,
|
|
&l_time3, str))
|
|
return str;
|
|
|
|
null_date:
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
/*
|
|
MAKETIME(h,m,s) is a time function that calculates a time value
|
|
from the total number of hours, minutes, and seconds.
|
|
Result: Time value
|
|
*/
|
|
|
|
String *Item_func_maketime::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
bool overflow= 0;
|
|
|
|
longlong hour= args[0]->val_int();
|
|
longlong minute= args[1]->val_int();
|
|
longlong second= args[2]->val_int();
|
|
|
|
if ((null_value=(args[0]->null_value ||
|
|
args[1]->null_value ||
|
|
args[2]->null_value ||
|
|
minute < 0 || minute > 59 ||
|
|
second < 0 || second > 59 ||
|
|
str->alloc(19))))
|
|
return 0;
|
|
|
|
bzero((char *)<ime, sizeof(ltime));
|
|
ltime.neg= 0;
|
|
|
|
/* Check for integer overflows */
|
|
if (hour < 0)
|
|
{
|
|
if (args[0]->unsigned_flag)
|
|
overflow= 1;
|
|
else
|
|
ltime.neg= 1;
|
|
}
|
|
if (-hour > UINT_MAX || hour > UINT_MAX)
|
|
overflow= 1;
|
|
|
|
if (!overflow)
|
|
{
|
|
ltime.hour= (uint) ((hour < 0 ? -hour : hour));
|
|
ltime.minute= (uint) minute;
|
|
ltime.second= (uint) second;
|
|
}
|
|
else
|
|
{
|
|
ltime.hour= TIME_MAX_HOUR;
|
|
ltime.minute= TIME_MAX_MINUTE;
|
|
ltime.second= TIME_MAX_SECOND;
|
|
char buf[28];
|
|
char *ptr= longlong10_to_str(hour, buf, args[0]->unsigned_flag ? 10 : -10);
|
|
int len = (int)(ptr - buf) +
|
|
my_sprintf(ptr, (ptr, ":%02u:%02u", (uint)minute, (uint)second));
|
|
make_truncated_value_warning(current_thd, buf, len, MYSQL_TIMESTAMP_TIME,
|
|
NullS);
|
|
}
|
|
|
|
if (make_time_with_warn((DATE_TIME_FORMAT *) 0, <ime, str))
|
|
{
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
return str;
|
|
}
|
|
|
|
|
|
/*
|
|
MICROSECOND(a) is a function ( extraction) that extracts the microseconds
|
|
from a.
|
|
|
|
a: Datetime or time value
|
|
Result: int value
|
|
*/
|
|
|
|
longlong Item_func_microsecond::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
if (!get_arg0_time(<ime))
|
|
return ltime.second_part;
|
|
return 0;
|
|
}
|
|
|
|
|
|
longlong Item_func_timestamp_diff::val_int()
|
|
{
|
|
TIME ltime1, ltime2;
|
|
longlong seconds;
|
|
long microseconds;
|
|
long months= 0;
|
|
int neg= 1;
|
|
|
|
null_value= 0;
|
|
if (args[0]->get_date(<ime1, TIME_NO_ZERO_DATE) ||
|
|
args[1]->get_date(<ime2, TIME_NO_ZERO_DATE))
|
|
goto null_date;
|
|
|
|
if (calc_time_diff(<ime2,<ime1, 1,
|
|
&seconds, µseconds))
|
|
neg= -1;
|
|
|
|
if (int_type == INTERVAL_YEAR ||
|
|
int_type == INTERVAL_QUARTER ||
|
|
int_type == INTERVAL_MONTH)
|
|
{
|
|
uint year_beg, year_end, month_beg, month_end, day_beg, day_end;
|
|
uint years= 0;
|
|
uint second_beg, second_end, microsecond_beg, microsecond_end;
|
|
|
|
if (neg == -1)
|
|
{
|
|
year_beg= ltime2.year;
|
|
year_end= ltime1.year;
|
|
month_beg= ltime2.month;
|
|
month_end= ltime1.month;
|
|
day_beg= ltime2.day;
|
|
day_end= ltime1.day;
|
|
second_beg= ltime2.hour * 3600 + ltime2.minute * 60 + ltime2.second;
|
|
second_end= ltime1.hour * 3600 + ltime1.minute * 60 + ltime1.second;
|
|
microsecond_beg= ltime2.second_part;
|
|
microsecond_end= ltime1.second_part;
|
|
}
|
|
else
|
|
{
|
|
year_beg= ltime1.year;
|
|
year_end= ltime2.year;
|
|
month_beg= ltime1.month;
|
|
month_end= ltime2.month;
|
|
day_beg= ltime1.day;
|
|
day_end= ltime2.day;
|
|
second_beg= ltime1.hour * 3600 + ltime1.minute * 60 + ltime1.second;
|
|
second_end= ltime2.hour * 3600 + ltime2.minute * 60 + ltime2.second;
|
|
microsecond_beg= ltime1.second_part;
|
|
microsecond_end= ltime2.second_part;
|
|
}
|
|
|
|
/* calc years */
|
|
years= year_end - year_beg;
|
|
if (month_end < month_beg || (month_end == month_beg && day_end < day_beg))
|
|
years-= 1;
|
|
|
|
/* calc months */
|
|
months= 12*years;
|
|
if (month_end < month_beg || (month_end == month_beg && day_end < day_beg))
|
|
months+= 12 - (month_beg - month_end);
|
|
else
|
|
months+= (month_end - month_beg);
|
|
|
|
if (day_end < day_beg)
|
|
months-= 1;
|
|
else if ((day_end == day_beg) &&
|
|
((second_end < second_beg) ||
|
|
(second_end == second_beg && microsecond_end < microsecond_beg)))
|
|
months-= 1;
|
|
}
|
|
|
|
switch (int_type) {
|
|
case INTERVAL_YEAR:
|
|
return months/12*neg;
|
|
case INTERVAL_QUARTER:
|
|
return months/3*neg;
|
|
case INTERVAL_MONTH:
|
|
return months*neg;
|
|
case INTERVAL_WEEK:
|
|
return seconds/86400L/7L*neg;
|
|
case INTERVAL_DAY:
|
|
return seconds/86400L*neg;
|
|
case INTERVAL_HOUR:
|
|
return seconds/3600L*neg;
|
|
case INTERVAL_MINUTE:
|
|
return seconds/60L*neg;
|
|
case INTERVAL_SECOND:
|
|
return seconds*neg;
|
|
case INTERVAL_MICROSECOND:
|
|
/*
|
|
In MySQL difference between any two valid datetime values
|
|
in microseconds fits into longlong.
|
|
*/
|
|
return (seconds*1000000L+microseconds)*neg;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
null_date:
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_timestamp_diff::print(String *str)
|
|
{
|
|
str->append(func_name());
|
|
str->append('(');
|
|
|
|
switch (int_type) {
|
|
case INTERVAL_YEAR:
|
|
str->append(STRING_WITH_LEN("YEAR"));
|
|
break;
|
|
case INTERVAL_QUARTER:
|
|
str->append(STRING_WITH_LEN("QUARTER"));
|
|
break;
|
|
case INTERVAL_MONTH:
|
|
str->append(STRING_WITH_LEN("MONTH"));
|
|
break;
|
|
case INTERVAL_WEEK:
|
|
str->append(STRING_WITH_LEN("WEEK"));
|
|
break;
|
|
case INTERVAL_DAY:
|
|
str->append(STRING_WITH_LEN("DAY"));
|
|
break;
|
|
case INTERVAL_HOUR:
|
|
str->append(STRING_WITH_LEN("HOUR"));
|
|
break;
|
|
case INTERVAL_MINUTE:
|
|
str->append(STRING_WITH_LEN("MINUTE"));
|
|
break;
|
|
case INTERVAL_SECOND:
|
|
str->append(STRING_WITH_LEN("SECOND"));
|
|
break;
|
|
case INTERVAL_MICROSECOND:
|
|
str->append(STRING_WITH_LEN("SECOND_FRAC"));
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
for (uint i=0 ; i < 2 ; i++)
|
|
{
|
|
str->append(',');
|
|
args[i]->print(str);
|
|
}
|
|
str->append(')');
|
|
}
|
|
|
|
|
|
String *Item_func_get_format::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
const char *format_name;
|
|
KNOWN_DATE_TIME_FORMAT *format;
|
|
String *val= args[0]->val_str(str);
|
|
ulong val_len;
|
|
|
|
if ((null_value= args[0]->null_value))
|
|
return 0;
|
|
|
|
val_len= val->length();
|
|
for (format= &known_date_time_formats[0];
|
|
(format_name= format->format_name);
|
|
format++)
|
|
{
|
|
uint format_name_len;
|
|
format_name_len= strlen(format_name);
|
|
if (val_len == format_name_len &&
|
|
!my_strnncoll(&my_charset_latin1,
|
|
(const uchar *) val->ptr(), val_len,
|
|
(const uchar *) format_name, val_len))
|
|
{
|
|
const char *format_str= get_date_time_format_str(format, type);
|
|
str->set(format_str, strlen(format_str), &my_charset_bin);
|
|
return str;
|
|
}
|
|
}
|
|
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_get_format::print(String *str)
|
|
{
|
|
str->append(func_name());
|
|
str->append('(');
|
|
|
|
switch (type) {
|
|
case MYSQL_TIMESTAMP_DATE:
|
|
str->append(STRING_WITH_LEN("DATE, "));
|
|
break;
|
|
case MYSQL_TIMESTAMP_DATETIME:
|
|
str->append(STRING_WITH_LEN("DATETIME, "));
|
|
break;
|
|
case MYSQL_TIMESTAMP_TIME:
|
|
str->append(STRING_WITH_LEN("TIME, "));
|
|
break;
|
|
default:
|
|
DBUG_ASSERT(0);
|
|
}
|
|
args[0]->print(str);
|
|
str->append(')');
|
|
}
|
|
|
|
|
|
/*
|
|
Get type of datetime value (DATE/TIME/...) which will be produced
|
|
according to format string.
|
|
|
|
SYNOPSIS
|
|
get_date_time_result_type()
|
|
format - format string
|
|
length - length of format string
|
|
|
|
NOTE
|
|
We don't process day format's characters('D', 'd', 'e') because day
|
|
may be a member of all date/time types.
|
|
|
|
Format specifiers supported by this function should be in sync with
|
|
specifiers supported by extract_date_time() function.
|
|
|
|
RETURN VALUE
|
|
One of date_time_format_types values:
|
|
DATE_TIME_MICROSECOND, DATE_TIME, DATE_ONLY, TIME_MICROSECOND, TIME_ONLY
|
|
*/
|
|
|
|
static date_time_format_types
|
|
get_date_time_result_type(const char *format, uint length)
|
|
{
|
|
const char *time_part_frms= "HISThiklrs";
|
|
const char *date_part_frms= "MVUXYWabcjmvuxyw";
|
|
bool date_part_used= 0, time_part_used= 0, frac_second_used= 0;
|
|
|
|
const char *val= format;
|
|
const char *end= format + length;
|
|
|
|
for (; val != end && val != end; val++)
|
|
{
|
|
if (*val == '%' && val+1 != end)
|
|
{
|
|
val++;
|
|
if (*val == 'f')
|
|
frac_second_used= time_part_used= 1;
|
|
else if (!time_part_used && strchr(time_part_frms, *val))
|
|
time_part_used= 1;
|
|
else if (!date_part_used && strchr(date_part_frms, *val))
|
|
date_part_used= 1;
|
|
if (date_part_used && frac_second_used)
|
|
{
|
|
/*
|
|
frac_second_used implies time_part_used, and thus we already
|
|
have all types of date-time components and can end our search.
|
|
*/
|
|
return DATE_TIME_MICROSECOND;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* We don't have all three types of date-time components */
|
|
if (frac_second_used)
|
|
return TIME_MICROSECOND;
|
|
if (time_part_used)
|
|
{
|
|
if (date_part_used)
|
|
return DATE_TIME;
|
|
return TIME_ONLY;
|
|
}
|
|
return DATE_ONLY;
|
|
}
|
|
|
|
|
|
void Item_func_str_to_date::fix_length_and_dec()
|
|
{
|
|
char format_buff[64];
|
|
String format_str(format_buff, sizeof(format_buff), &my_charset_bin), *format;
|
|
maybe_null= 1;
|
|
decimals=0;
|
|
cached_field_type= MYSQL_TYPE_STRING;
|
|
max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
|
|
cached_timestamp_type= MYSQL_TIMESTAMP_NONE;
|
|
format= args[1]->val_str(&format_str);
|
|
if (!args[1]->null_value && (const_item= args[1]->const_item()))
|
|
{
|
|
cached_format_type= get_date_time_result_type(format->ptr(),
|
|
format->length());
|
|
switch (cached_format_type) {
|
|
case DATE_ONLY:
|
|
cached_timestamp_type= MYSQL_TIMESTAMP_DATE;
|
|
cached_field_type= MYSQL_TYPE_DATE;
|
|
max_length= MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
|
|
break;
|
|
case TIME_ONLY:
|
|
case TIME_MICROSECOND:
|
|
cached_timestamp_type= MYSQL_TIMESTAMP_TIME;
|
|
cached_field_type= MYSQL_TYPE_TIME;
|
|
max_length= MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
|
|
break;
|
|
default:
|
|
cached_timestamp_type= MYSQL_TIMESTAMP_DATETIME;
|
|
cached_field_type= MYSQL_TYPE_DATETIME;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
bool Item_func_str_to_date::get_date(TIME *ltime, uint fuzzy_date)
|
|
{
|
|
DATE_TIME_FORMAT date_time_format;
|
|
char val_buff[64], format_buff[64];
|
|
String val_str(val_buff, sizeof(val_buff), &my_charset_bin), *val;
|
|
String format_str(format_buff, sizeof(format_buff), &my_charset_bin), *format;
|
|
|
|
val= args[0]->val_str(&val_str);
|
|
format= args[1]->val_str(&format_str);
|
|
if (args[0]->null_value || args[1]->null_value)
|
|
goto null_date;
|
|
|
|
null_value= 0;
|
|
bzero((char*) ltime, sizeof(*ltime));
|
|
date_time_format.format.str= (char*) format->ptr();
|
|
date_time_format.format.length= format->length();
|
|
if (extract_date_time(&date_time_format, val->ptr(), val->length(),
|
|
ltime, cached_timestamp_type, 0, "datetime") ||
|
|
((fuzzy_date & TIME_NO_ZERO_DATE) &&
|
|
(ltime->year == 0 || ltime->month == 0 || ltime->day == 0)))
|
|
goto null_date;
|
|
if (cached_timestamp_type == MYSQL_TIMESTAMP_TIME && ltime->day)
|
|
{
|
|
/*
|
|
Day part for time type can be nonzero value and so
|
|
we should add hours from day part to hour part to
|
|
keep valid time value.
|
|
*/
|
|
ltime->hour+= ltime->day*24;
|
|
ltime->day= 0;
|
|
}
|
|
return 0;
|
|
|
|
null_date:
|
|
return (null_value=1);
|
|
}
|
|
|
|
|
|
String *Item_func_str_to_date::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
TIME ltime;
|
|
|
|
if (Item_func_str_to_date::get_date(<ime, TIME_FUZZY_DATE))
|
|
return 0;
|
|
|
|
if (!make_datetime((const_item ? cached_format_type :
|
|
(ltime.second_part ? DATE_TIME_MICROSECOND : DATE_TIME)),
|
|
<ime, str))
|
|
return str;
|
|
return 0;
|
|
}
|
|
|
|
|
|
bool Item_func_last_day::get_date(TIME *ltime, uint fuzzy_date)
|
|
{
|
|
if (get_arg0_date(ltime, fuzzy_date & ~TIME_FUZZY_DATE) ||
|
|
(ltime->month == 0))
|
|
{
|
|
null_value= 1;
|
|
return 1;
|
|
}
|
|
null_value= 0;
|
|
uint month_idx= ltime->month-1;
|
|
ltime->day= days_in_month[month_idx];
|
|
if ( month_idx == 1 && calc_days_in_year(ltime->year) == 366)
|
|
ltime->day= 29;
|
|
ltime->time_type= MYSQL_TIMESTAMP_DATE;
|
|
return 0;
|
|
}
|