mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 04:22:27 +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
3327 lines
85 KiB
C++
3327 lines
85 KiB
C++
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 string functions
|
|
** Warning: Some string functions doesn't always put and end-null on a String
|
|
** (This shouldn't be needed)
|
|
*/
|
|
|
|
#ifdef USE_PRAGMA_IMPLEMENTATION
|
|
#pragma implementation // gcc: Class implementation
|
|
#endif
|
|
|
|
#include "mysql_priv.h"
|
|
#include <m_ctype.h>
|
|
#ifdef HAVE_OPENSSL
|
|
#include <openssl/des.h>
|
|
#endif /* HAVE_OPENSSL */
|
|
#include "md5.h"
|
|
#include "sha1.h"
|
|
#include "my_aes.h"
|
|
C_MODE_START
|
|
#include "../mysys/my_static.h" // For soundex_map
|
|
C_MODE_END
|
|
|
|
String my_empty_string("",default_charset_info);
|
|
|
|
static void my_coll_agg_error(DTCollation &c1, DTCollation &c2,
|
|
const char *fname)
|
|
{
|
|
my_error(ER_CANT_AGGREGATE_2COLLATIONS, MYF(0),
|
|
c1.collation->name, c1.derivation_name(),
|
|
c2.collation->name, c2.derivation_name(),
|
|
fname);
|
|
}
|
|
|
|
|
|
String *Item_str_func::check_well_formed_result(String *str)
|
|
{
|
|
/* Check whether we got a well-formed string */
|
|
CHARSET_INFO *cs= str->charset();
|
|
int well_formed_error;
|
|
uint wlen= cs->cset->well_formed_len(cs,
|
|
str->ptr(), str->ptr() + str->length(),
|
|
str->length(), &well_formed_error);
|
|
if (wlen < str->length())
|
|
{
|
|
THD *thd= current_thd;
|
|
char hexbuf[7];
|
|
enum MYSQL_ERROR::enum_warning_level level;
|
|
uint diff= str->length() - wlen;
|
|
set_if_smaller(diff, 3);
|
|
octet2hex(hexbuf, str->ptr() + wlen, diff);
|
|
if (thd->variables.sql_mode &
|
|
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES))
|
|
{
|
|
level= MYSQL_ERROR::WARN_LEVEL_ERROR;
|
|
null_value= 1;
|
|
str= 0;
|
|
}
|
|
else
|
|
level= MYSQL_ERROR::WARN_LEVEL_WARN;
|
|
push_warning_printf(thd, level, ER_INVALID_CHARACTER_STRING,
|
|
ER(ER_INVALID_CHARACTER_STRING), cs->csname, hexbuf);
|
|
}
|
|
return str;
|
|
}
|
|
|
|
|
|
bool Item_str_func::fix_fields(THD *thd, Item **ref)
|
|
{
|
|
bool res= Item_func::fix_fields(thd, ref);
|
|
/*
|
|
In Item_str_func::check_well_formed_result() we may set null_value
|
|
flag on the same condition as in test() below.
|
|
*/
|
|
maybe_null= (maybe_null ||
|
|
test(thd->variables.sql_mode &
|
|
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)));
|
|
return res;
|
|
}
|
|
|
|
|
|
my_decimal *Item_str_func::val_decimal(my_decimal *decimal_value)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
char buff[64];
|
|
String *res, tmp(buff,sizeof(buff), &my_charset_bin);
|
|
res= val_str(&tmp);
|
|
if (!res)
|
|
return 0;
|
|
(void)str2my_decimal(E_DEC_FATAL_ERROR, (char*) res->ptr(),
|
|
res->length(), res->charset(), decimal_value);
|
|
return decimal_value;
|
|
}
|
|
|
|
|
|
double Item_str_func::val_real()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
int err_not_used;
|
|
char *end_not_used, buff[64];
|
|
String *res, tmp(buff,sizeof(buff), &my_charset_bin);
|
|
res= val_str(&tmp);
|
|
return res ? my_strntod(res->charset(), (char*) res->ptr(), res->length(),
|
|
&end_not_used, &err_not_used) : 0.0;
|
|
}
|
|
|
|
|
|
longlong Item_str_func::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
int err;
|
|
char buff[22];
|
|
String *res, tmp(buff,sizeof(buff), &my_charset_bin);
|
|
res= val_str(&tmp);
|
|
return (res ?
|
|
my_strntoll(res->charset(), res->ptr(), res->length(), 10, NULL,
|
|
&err) :
|
|
(longlong) 0);
|
|
}
|
|
|
|
|
|
String *Item_func_md5::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String * sptr= args[0]->val_str(str);
|
|
str->set_charset(&my_charset_bin);
|
|
if (sptr)
|
|
{
|
|
my_MD5_CTX context;
|
|
uchar digest[16];
|
|
|
|
null_value=0;
|
|
my_MD5Init (&context);
|
|
my_MD5Update (&context,(uchar *) sptr->ptr(), sptr->length());
|
|
my_MD5Final (digest, &context);
|
|
if (str->alloc(32)) // Ensure that memory is free
|
|
{
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
sprintf((char *) str->ptr(),
|
|
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
|
digest[0], digest[1], digest[2], digest[3],
|
|
digest[4], digest[5], digest[6], digest[7],
|
|
digest[8], digest[9], digest[10], digest[11],
|
|
digest[12], digest[13], digest[14], digest[15]);
|
|
str->length((uint) 32);
|
|
return str;
|
|
}
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_md5::fix_length_and_dec()
|
|
{
|
|
max_length=32;
|
|
/*
|
|
The MD5() function treats its parameter as being a case sensitive. Thus
|
|
we set binary collation on it so different instances of MD5() will be
|
|
compared properly.
|
|
*/
|
|
args[0]->collation.set(
|
|
get_charset_by_csname(args[0]->collation.collation->csname,
|
|
MY_CS_BINSORT,MYF(0)), DERIVATION_COERCIBLE);
|
|
}
|
|
|
|
|
|
String *Item_func_sha::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String * sptr= args[0]->val_str(str);
|
|
str->set_charset(&my_charset_bin);
|
|
if (sptr) /* If we got value different from NULL */
|
|
{
|
|
SHA1_CONTEXT context; /* Context used to generate SHA1 hash */
|
|
/* Temporary buffer to store 160bit digest */
|
|
uint8 digest[SHA1_HASH_SIZE];
|
|
mysql_sha1_reset(&context); /* We do not have to check for error here */
|
|
/* No need to check error as the only case would be too long message */
|
|
mysql_sha1_input(&context,
|
|
(const uchar *) sptr->ptr(), sptr->length());
|
|
/* Ensure that memory is free and we got result */
|
|
if (!( str->alloc(SHA1_HASH_SIZE*2) ||
|
|
(mysql_sha1_result(&context,digest))))
|
|
{
|
|
sprintf((char *) str->ptr(),
|
|
"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\
|
|
%02x%02x%02x%02x%02x%02x%02x%02x",
|
|
digest[0], digest[1], digest[2], digest[3],
|
|
digest[4], digest[5], digest[6], digest[7],
|
|
digest[8], digest[9], digest[10], digest[11],
|
|
digest[12], digest[13], digest[14], digest[15],
|
|
digest[16], digest[17], digest[18], digest[19]);
|
|
|
|
str->length((uint) SHA1_HASH_SIZE*2);
|
|
null_value=0;
|
|
return str;
|
|
}
|
|
}
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
void Item_func_sha::fix_length_and_dec()
|
|
{
|
|
max_length=SHA1_HASH_SIZE*2; // size of hex representation of hash
|
|
/*
|
|
The SHA() function treats its parameter as being a case sensitive. Thus
|
|
we set binary collation on it so different instances of MD5() will be
|
|
compared properly.
|
|
*/
|
|
args[0]->collation.set(
|
|
get_charset_by_csname(args[0]->collation.collation->csname,
|
|
MY_CS_BINSORT,MYF(0)), DERIVATION_COERCIBLE);
|
|
}
|
|
|
|
|
|
/* Implementation of AES encryption routines */
|
|
|
|
String *Item_func_aes_encrypt::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
char key_buff[80];
|
|
String tmp_key_value(key_buff, sizeof(key_buff), system_charset_info);
|
|
String *sptr= args[0]->val_str(str); // String to encrypt
|
|
String *key= args[1]->val_str(&tmp_key_value); // key
|
|
int aes_length;
|
|
if (sptr && key) // we need both arguments to be not NULL
|
|
{
|
|
null_value=0;
|
|
aes_length=my_aes_get_size(sptr->length()); // Calculate result length
|
|
|
|
if (!str_value.alloc(aes_length)) // Ensure that memory is free
|
|
{
|
|
// finally encrypt directly to allocated buffer.
|
|
if (my_aes_encrypt(sptr->ptr(),sptr->length(), (char*) str_value.ptr(),
|
|
key->ptr(), key->length()) == aes_length)
|
|
{
|
|
// We got the expected result length
|
|
str_value.length((uint) aes_length);
|
|
return &str_value;
|
|
}
|
|
}
|
|
}
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_aes_encrypt::fix_length_and_dec()
|
|
{
|
|
max_length=my_aes_get_size(args[0]->max_length);
|
|
}
|
|
|
|
|
|
String *Item_func_aes_decrypt::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
char key_buff[80];
|
|
String tmp_key_value(key_buff, sizeof(key_buff), system_charset_info);
|
|
String *sptr, *key;
|
|
DBUG_ENTER("Item_func_aes_decrypt::val_str");
|
|
|
|
sptr= args[0]->val_str(str); // String to decrypt
|
|
key= args[1]->val_str(&tmp_key_value); // Key
|
|
if (sptr && key) // Need to have both arguments not NULL
|
|
{
|
|
null_value=0;
|
|
if (!str_value.alloc(sptr->length())) // Ensure that memory is free
|
|
{
|
|
// finally decrypt directly to allocated buffer.
|
|
int length;
|
|
length=my_aes_decrypt(sptr->ptr(), sptr->length(),
|
|
(char*) str_value.ptr(),
|
|
key->ptr(), key->length());
|
|
if (length >= 0) // if we got correct data data
|
|
{
|
|
str_value.length((uint) length);
|
|
DBUG_RETURN(&str_value);
|
|
}
|
|
}
|
|
}
|
|
// Bad parameters. No memory or bad data will all go here
|
|
null_value=1;
|
|
DBUG_RETURN(0);
|
|
}
|
|
|
|
|
|
void Item_func_aes_decrypt::fix_length_and_dec()
|
|
{
|
|
max_length=args[0]->max_length;
|
|
maybe_null= 1;
|
|
}
|
|
|
|
|
|
/*
|
|
Concatenate args with the following premises:
|
|
If only one arg (which is ok), return value of arg
|
|
Don't reallocate val_str() if not absolute necessary.
|
|
*/
|
|
|
|
String *Item_func_concat::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res,*res2,*use_as_buff;
|
|
uint i;
|
|
bool is_const= 0;
|
|
|
|
null_value=0;
|
|
if (!(res=args[0]->val_str(str)))
|
|
goto null;
|
|
use_as_buff= &tmp_value;
|
|
/* Item_subselect in --ps-protocol mode will state it as a non-const */
|
|
is_const= args[0]->const_item() || !args[0]->used_tables();
|
|
for (i=1 ; i < arg_count ; i++)
|
|
{
|
|
if (res->length() == 0)
|
|
{
|
|
if (!(res=args[i]->val_str(str)))
|
|
goto null;
|
|
}
|
|
else
|
|
{
|
|
if (!(res2=args[i]->val_str(use_as_buff)))
|
|
goto null;
|
|
if (res2->length() == 0)
|
|
continue;
|
|
if (res->length()+res2->length() >
|
|
current_thd->variables.max_allowed_packet)
|
|
{
|
|
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
|
|
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED), func_name(),
|
|
current_thd->variables.max_allowed_packet);
|
|
goto null;
|
|
}
|
|
if (!is_const && res->alloced_length() >= res->length()+res2->length())
|
|
{ // Use old buffer
|
|
res->append(*res2);
|
|
}
|
|
else if (str->alloced_length() >= res->length()+res2->length())
|
|
{
|
|
if (str == res2)
|
|
str->replace(0,0,*res);
|
|
else
|
|
{
|
|
str->copy(*res);
|
|
str->append(*res2);
|
|
}
|
|
res= str;
|
|
use_as_buff= &tmp_value;
|
|
}
|
|
else if (res == &tmp_value)
|
|
{
|
|
if (res->append(*res2)) // Must be a blob
|
|
goto null;
|
|
}
|
|
else if (res2 == &tmp_value)
|
|
{ // This can happend only 1 time
|
|
if (tmp_value.replace(0,0,*res))
|
|
goto null;
|
|
res= &tmp_value;
|
|
use_as_buff=str; // Put next arg here
|
|
}
|
|
else if (tmp_value.is_alloced() && res2->ptr() >= tmp_value.ptr() &&
|
|
res2->ptr() <= tmp_value.ptr() + tmp_value.alloced_length())
|
|
{
|
|
/*
|
|
This happens really seldom:
|
|
In this case res2 is sub string of tmp_value. We will
|
|
now work in place in tmp_value to set it to res | res2
|
|
*/
|
|
/* Chop the last characters in tmp_value that isn't in res2 */
|
|
tmp_value.length((uint32) (res2->ptr() - tmp_value.ptr()) +
|
|
res2->length());
|
|
/* Place res2 at start of tmp_value, remove chars before res2 */
|
|
if (tmp_value.replace(0,(uint32) (res2->ptr() - tmp_value.ptr()),
|
|
*res))
|
|
goto null;
|
|
res= &tmp_value;
|
|
use_as_buff=str; // Put next arg here
|
|
}
|
|
else
|
|
{ // Two big const strings
|
|
if (tmp_value.alloc(max_length) ||
|
|
tmp_value.copy(*res) ||
|
|
tmp_value.append(*res2))
|
|
goto null;
|
|
res= &tmp_value;
|
|
use_as_buff=str;
|
|
}
|
|
is_const= 0;
|
|
}
|
|
}
|
|
res->set_charset(collation.collation);
|
|
return res;
|
|
|
|
null:
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_concat::fix_length_and_dec()
|
|
{
|
|
ulonglong max_result_length= 0;
|
|
|
|
if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV, 1))
|
|
return;
|
|
|
|
for (uint i=0 ; i < arg_count ; i++)
|
|
{
|
|
if (args[i]->collation.collation->mbmaxlen != collation.collation->mbmaxlen)
|
|
max_result_length+= (args[i]->max_length /
|
|
args[i]->collation.collation->mbmaxlen) *
|
|
collation.collation->mbmaxlen;
|
|
else
|
|
max_result_length+= args[i]->max_length;
|
|
}
|
|
|
|
if (max_result_length >= MAX_BLOB_WIDTH)
|
|
{
|
|
max_result_length= MAX_BLOB_WIDTH;
|
|
maybe_null= 1;
|
|
}
|
|
max_length= (ulong) max_result_length;
|
|
}
|
|
|
|
/*
|
|
Function des_encrypt() by tonu@spam.ee & monty
|
|
Works only if compiled with OpenSSL library support.
|
|
This returns a binary string where first character is CHAR(128 | key-number).
|
|
If one uses a string key key_number is 127.
|
|
Encryption result is longer than original by formula:
|
|
new_length= org_length + (8-(org_length % 8))+1
|
|
*/
|
|
|
|
String *Item_func_des_encrypt::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
#ifdef HAVE_OPENSSL
|
|
uint code= ER_WRONG_PARAMETERS_TO_PROCEDURE;
|
|
DES_cblock ivec;
|
|
struct st_des_keyblock keyblock;
|
|
struct st_des_keyschedule keyschedule;
|
|
const char *append_str="********";
|
|
uint key_number, res_length, tail;
|
|
String *res= args[0]->val_str(str);
|
|
|
|
if ((null_value= args[0]->null_value))
|
|
return 0; // ENCRYPT(NULL) == NULL
|
|
if ((res_length=res->length()) == 0)
|
|
return &my_empty_string;
|
|
|
|
if (arg_count == 1)
|
|
{
|
|
/* Protect against someone doing FLUSH DES_KEY_FILE */
|
|
VOID(pthread_mutex_lock(&LOCK_des_key_file));
|
|
keyschedule= des_keyschedule[key_number=des_default_key];
|
|
VOID(pthread_mutex_unlock(&LOCK_des_key_file));
|
|
}
|
|
else if (args[1]->result_type() == INT_RESULT)
|
|
{
|
|
key_number= (uint) args[1]->val_int();
|
|
if (key_number > 9)
|
|
goto error;
|
|
VOID(pthread_mutex_lock(&LOCK_des_key_file));
|
|
keyschedule= des_keyschedule[key_number];
|
|
VOID(pthread_mutex_unlock(&LOCK_des_key_file));
|
|
}
|
|
else
|
|
{
|
|
String *keystr=args[1]->val_str(&tmp_value);
|
|
if (!keystr)
|
|
goto error;
|
|
key_number=127; // User key string
|
|
|
|
/* We make good 24-byte (168 bit) key from given plaintext key with MD5 */
|
|
bzero((char*) &ivec,sizeof(ivec));
|
|
EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL,
|
|
(uchar*) keystr->ptr(), (int) keystr->length(),
|
|
1, (uchar*) &keyblock,ivec);
|
|
DES_set_key_unchecked(&keyblock.key1,&keyschedule.ks1);
|
|
DES_set_key_unchecked(&keyblock.key2,&keyschedule.ks2);
|
|
DES_set_key_unchecked(&keyblock.key3,&keyschedule.ks3);
|
|
}
|
|
|
|
/*
|
|
The problem: DES algorithm requires original data to be in 8-bytes
|
|
chunks. Missing bytes get filled with '*'s and result of encryption
|
|
can be up to 8 bytes longer than original string. When decrypted,
|
|
we do not know the size of original string :(
|
|
We add one byte with value 0x1..0x8 as the last byte of the padded
|
|
string marking change of string length.
|
|
*/
|
|
|
|
tail= (8-(res_length) % 8); // 1..8 marking extra length
|
|
res_length+=tail;
|
|
code= ER_OUT_OF_RESOURCES;
|
|
if (tail && res->append(append_str, tail) || tmp_value.alloc(res_length+1))
|
|
goto error;
|
|
(*res)[res_length-1]=tail; // save extra length
|
|
tmp_value.length(res_length+1);
|
|
tmp_value[0]=(char) (128 | key_number);
|
|
// Real encryption
|
|
bzero((char*) &ivec,sizeof(ivec));
|
|
DES_ede3_cbc_encrypt((const uchar*) (res->ptr()),
|
|
(uchar*) (tmp_value.ptr()+1),
|
|
res_length,
|
|
&keyschedule.ks1,
|
|
&keyschedule.ks2,
|
|
&keyschedule.ks3,
|
|
&ivec, TRUE);
|
|
return &tmp_value;
|
|
|
|
error:
|
|
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
|
|
code, ER(code),
|
|
"des_encrypt");
|
|
#else
|
|
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
|
|
ER_FEATURE_DISABLED, ER(ER_FEATURE_DISABLED),
|
|
"des_encrypt","--with-openssl");
|
|
#endif /* HAVE_OPENSSL */
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
String *Item_func_des_decrypt::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
#ifdef HAVE_OPENSSL
|
|
uint code= ER_WRONG_PARAMETERS_TO_PROCEDURE;
|
|
DES_cblock ivec;
|
|
struct st_des_keyblock keyblock;
|
|
struct st_des_keyschedule keyschedule;
|
|
String *res= args[0]->val_str(str);
|
|
uint length,tail;
|
|
|
|
if ((null_value= args[0]->null_value))
|
|
return 0;
|
|
length= res->length();
|
|
if (length < 9 || (length % 8) != 1 || !((*res)[0] & 128))
|
|
return res; // Skip decryption if not encrypted
|
|
|
|
if (arg_count == 1) // If automatic uncompression
|
|
{
|
|
uint key_number=(uint) (*res)[0] & 127;
|
|
// Check if automatic key and that we have privilege to uncompress using it
|
|
if (!(current_thd->security_ctx->master_access & SUPER_ACL) ||
|
|
key_number > 9)
|
|
goto error;
|
|
|
|
VOID(pthread_mutex_lock(&LOCK_des_key_file));
|
|
keyschedule= des_keyschedule[key_number];
|
|
VOID(pthread_mutex_unlock(&LOCK_des_key_file));
|
|
}
|
|
else
|
|
{
|
|
// We make good 24-byte (168 bit) key from given plaintext key with MD5
|
|
String *keystr=args[1]->val_str(&tmp_value);
|
|
if (!keystr)
|
|
goto error;
|
|
|
|
bzero((char*) &ivec,sizeof(ivec));
|
|
EVP_BytesToKey(EVP_des_ede3_cbc(),EVP_md5(),NULL,
|
|
(uchar*) keystr->ptr(),(int) keystr->length(),
|
|
1,(uchar*) &keyblock,ivec);
|
|
// Here we set all 64-bit keys (56 effective) one by one
|
|
DES_set_key_unchecked(&keyblock.key1,&keyschedule.ks1);
|
|
DES_set_key_unchecked(&keyblock.key2,&keyschedule.ks2);
|
|
DES_set_key_unchecked(&keyblock.key3,&keyschedule.ks3);
|
|
}
|
|
code= ER_OUT_OF_RESOURCES;
|
|
if (tmp_value.alloc(length-1))
|
|
goto error;
|
|
|
|
bzero((char*) &ivec,sizeof(ivec));
|
|
DES_ede3_cbc_encrypt((const uchar*) res->ptr()+1,
|
|
(uchar*) (tmp_value.ptr()),
|
|
length-1,
|
|
&keyschedule.ks1,
|
|
&keyschedule.ks2,
|
|
&keyschedule.ks3,
|
|
&ivec, FALSE);
|
|
/* Restore old length of key */
|
|
if ((tail=(uint) (uchar) tmp_value[length-2]) > 8)
|
|
goto wrong_key; // Wrong key
|
|
tmp_value.length(length-1-tail);
|
|
return &tmp_value;
|
|
|
|
error:
|
|
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
|
|
code, ER(code),
|
|
"des_decrypt");
|
|
wrong_key:
|
|
#else
|
|
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
|
|
ER_FEATURE_DISABLED, ER(ER_FEATURE_DISABLED),
|
|
"des_decrypt","--with-openssl");
|
|
#endif /* HAVE_OPENSSL */
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
/*
|
|
concat with separator. First arg is the separator
|
|
concat_ws takes at least two arguments.
|
|
*/
|
|
|
|
String *Item_func_concat_ws::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
char tmp_str_buff[10];
|
|
String tmp_sep_str(tmp_str_buff, sizeof(tmp_str_buff),default_charset_info),
|
|
*sep_str, *res, *res2,*use_as_buff;
|
|
uint i;
|
|
|
|
null_value=0;
|
|
if (!(sep_str= args[0]->val_str(&tmp_sep_str)))
|
|
goto null;
|
|
|
|
use_as_buff= &tmp_value;
|
|
str->length(0); // QQ; Should be removed
|
|
res=str;
|
|
|
|
// Skip until non-null argument is found.
|
|
// If not, return the empty string
|
|
for (i=1; i < arg_count; i++)
|
|
if ((res= args[i]->val_str(str)))
|
|
break;
|
|
if (i == arg_count)
|
|
return &my_empty_string;
|
|
|
|
for (i++; i < arg_count ; i++)
|
|
{
|
|
if (!(res2= args[i]->val_str(use_as_buff)))
|
|
continue; // Skip NULL
|
|
|
|
if (res->length() + sep_str->length() + res2->length() >
|
|
current_thd->variables.max_allowed_packet)
|
|
{
|
|
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
|
|
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED), func_name(),
|
|
current_thd->variables.max_allowed_packet);
|
|
goto null;
|
|
}
|
|
if (res->alloced_length() >=
|
|
res->length() + sep_str->length() + res2->length())
|
|
{ // Use old buffer
|
|
res->append(*sep_str); // res->length() > 0 always
|
|
res->append(*res2);
|
|
}
|
|
else if (str->alloced_length() >=
|
|
res->length() + sep_str->length() + res2->length())
|
|
{
|
|
/* We have room in str; We can't get any errors here */
|
|
if (str == res2)
|
|
{ // This is quote uncommon!
|
|
str->replace(0,0,*sep_str);
|
|
str->replace(0,0,*res);
|
|
}
|
|
else
|
|
{
|
|
str->copy(*res);
|
|
str->append(*sep_str);
|
|
str->append(*res2);
|
|
}
|
|
res=str;
|
|
use_as_buff= &tmp_value;
|
|
}
|
|
else if (res == &tmp_value)
|
|
{
|
|
if (res->append(*sep_str) || res->append(*res2))
|
|
goto null; // Must be a blob
|
|
}
|
|
else if (res2 == &tmp_value)
|
|
{ // This can happend only 1 time
|
|
if (tmp_value.replace(0,0,*sep_str) || tmp_value.replace(0,0,*res))
|
|
goto null;
|
|
res= &tmp_value;
|
|
use_as_buff=str; // Put next arg here
|
|
}
|
|
else if (tmp_value.is_alloced() && res2->ptr() >= tmp_value.ptr() &&
|
|
res2->ptr() < tmp_value.ptr() + tmp_value.alloced_length())
|
|
{
|
|
/*
|
|
This happens really seldom:
|
|
In this case res2 is sub string of tmp_value. We will
|
|
now work in place in tmp_value to set it to res | sep_str | res2
|
|
*/
|
|
/* Chop the last characters in tmp_value that isn't in res2 */
|
|
tmp_value.length((uint32) (res2->ptr() - tmp_value.ptr()) +
|
|
res2->length());
|
|
/* Place res2 at start of tmp_value, remove chars before res2 */
|
|
if (tmp_value.replace(0,(uint32) (res2->ptr() - tmp_value.ptr()),
|
|
*res) ||
|
|
tmp_value.replace(res->length(),0, *sep_str))
|
|
goto null;
|
|
res= &tmp_value;
|
|
use_as_buff=str; // Put next arg here
|
|
}
|
|
else
|
|
{ // Two big const strings
|
|
if (tmp_value.alloc(max_length) ||
|
|
tmp_value.copy(*res) ||
|
|
tmp_value.append(*sep_str) ||
|
|
tmp_value.append(*res2))
|
|
goto null;
|
|
res= &tmp_value;
|
|
use_as_buff=str;
|
|
}
|
|
}
|
|
res->set_charset(collation.collation);
|
|
return res;
|
|
|
|
null:
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_concat_ws::fix_length_and_dec()
|
|
{
|
|
ulonglong max_result_length;
|
|
|
|
if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV, 1))
|
|
return;
|
|
|
|
/*
|
|
arg_count cannot be less than 2,
|
|
it is done on parser level in sql_yacc.yy
|
|
so, (arg_count - 2) is safe here.
|
|
*/
|
|
max_result_length= (ulonglong) args[0]->max_length * (arg_count - 2);
|
|
for (uint i=1 ; i < arg_count ; i++)
|
|
max_result_length+=args[i]->max_length;
|
|
|
|
if (max_result_length >= MAX_BLOB_WIDTH)
|
|
{
|
|
max_result_length= MAX_BLOB_WIDTH;
|
|
maybe_null= 1;
|
|
}
|
|
max_length= (ulong) max_result_length;
|
|
}
|
|
|
|
|
|
String *Item_func_reverse::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res = args[0]->val_str(str);
|
|
char *ptr, *end, *tmp;
|
|
|
|
if ((null_value=args[0]->null_value))
|
|
return 0;
|
|
/* An empty string is a special case as the string pointer may be null */
|
|
if (!res->length())
|
|
return &my_empty_string;
|
|
if (tmp_value.alloced_length() < res->length() &&
|
|
tmp_value.realloc(res->length()))
|
|
{
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
tmp_value.length(res->length());
|
|
tmp_value.set_charset(res->charset());
|
|
ptr= (char *) res->ptr();
|
|
end= ptr + res->length();
|
|
tmp= (char *) tmp_value.ptr() + tmp_value.length();
|
|
#ifdef USE_MB
|
|
if (use_mb(res->charset()))
|
|
{
|
|
register uint32 l;
|
|
while (ptr < end)
|
|
{
|
|
if ((l= my_ismbchar(res->charset(),ptr,end)))
|
|
{
|
|
tmp-= l;
|
|
memcpy(tmp,ptr,l);
|
|
ptr+= l;
|
|
}
|
|
else
|
|
*--tmp= *ptr++;
|
|
}
|
|
}
|
|
else
|
|
#endif /* USE_MB */
|
|
{
|
|
while (ptr < end)
|
|
*--tmp= *ptr++;
|
|
}
|
|
return &tmp_value;
|
|
}
|
|
|
|
|
|
void Item_func_reverse::fix_length_and_dec()
|
|
{
|
|
collation.set(args[0]->collation);
|
|
max_length = args[0]->max_length;
|
|
}
|
|
|
|
/*
|
|
** Replace all occurences of string2 in string1 with string3.
|
|
** Don't reallocate val_str() if not needed
|
|
*/
|
|
|
|
/* TODO: Fix that this works with binary strings when using USE_MB */
|
|
|
|
String *Item_func_replace::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res,*res2,*res3;
|
|
int offset;
|
|
uint from_length,to_length;
|
|
bool alloced=0;
|
|
#ifdef USE_MB
|
|
const char *ptr,*end,*strend,*search,*search_end;
|
|
register uint32 l;
|
|
bool binary_cmp;
|
|
#endif
|
|
|
|
null_value=0;
|
|
res=args[0]->val_str(str);
|
|
if (args[0]->null_value)
|
|
goto null;
|
|
res2=args[1]->val_str(&tmp_value);
|
|
if (args[1]->null_value)
|
|
goto null;
|
|
|
|
res->set_charset(collation.collation);
|
|
|
|
#ifdef USE_MB
|
|
binary_cmp = ((res->charset()->state & MY_CS_BINSORT) || !use_mb(res->charset()));
|
|
#endif
|
|
|
|
if (res2->length() == 0)
|
|
return res;
|
|
#ifndef USE_MB
|
|
if ((offset=res->strstr(*res2)) < 0)
|
|
return res;
|
|
#else
|
|
offset=0;
|
|
if (binary_cmp && (offset=res->strstr(*res2)) < 0)
|
|
return res;
|
|
#endif
|
|
if (!(res3=args[2]->val_str(&tmp_value2)))
|
|
goto null;
|
|
from_length= res2->length();
|
|
to_length= res3->length();
|
|
|
|
#ifdef USE_MB
|
|
if (!binary_cmp)
|
|
{
|
|
search=res2->ptr();
|
|
search_end=search+from_length;
|
|
redo:
|
|
ptr=res->ptr()+offset;
|
|
strend=res->ptr()+res->length();
|
|
end=strend-from_length+1;
|
|
while (ptr < end)
|
|
{
|
|
if (*ptr == *search)
|
|
{
|
|
register char *i,*j;
|
|
i=(char*) ptr+1; j=(char*) search+1;
|
|
while (j != search_end)
|
|
if (*i++ != *j++) goto skip;
|
|
offset= (int) (ptr-res->ptr());
|
|
if (res->length()-from_length + to_length >
|
|
current_thd->variables.max_allowed_packet)
|
|
{
|
|
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
|
|
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
|
|
func_name(),
|
|
current_thd->variables.max_allowed_packet);
|
|
|
|
goto null;
|
|
}
|
|
if (!alloced)
|
|
{
|
|
alloced=1;
|
|
res=copy_if_not_alloced(str,res,res->length()+to_length);
|
|
}
|
|
res->replace((uint) offset,from_length,*res3);
|
|
offset+=(int) to_length;
|
|
goto redo;
|
|
}
|
|
skip:
|
|
if ((l=my_ismbchar(res->charset(), ptr,strend))) ptr+=l;
|
|
else ++ptr;
|
|
}
|
|
}
|
|
else
|
|
#endif /* USE_MB */
|
|
do
|
|
{
|
|
if (res->length()-from_length + to_length >
|
|
current_thd->variables.max_allowed_packet)
|
|
{
|
|
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
|
|
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED), func_name(),
|
|
current_thd->variables.max_allowed_packet);
|
|
goto null;
|
|
}
|
|
if (!alloced)
|
|
{
|
|
alloced=1;
|
|
res=copy_if_not_alloced(str,res,res->length()+to_length);
|
|
}
|
|
res->replace((uint) offset,from_length,*res3);
|
|
offset+=(int) to_length;
|
|
}
|
|
while ((offset=res->strstr(*res2,(uint) offset)) >= 0);
|
|
return res;
|
|
|
|
null:
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_replace::fix_length_and_dec()
|
|
{
|
|
ulonglong max_result_length= args[0]->max_length;
|
|
int diff=(int) (args[2]->max_length - args[1]->max_length);
|
|
if (diff > 0 && args[1]->max_length)
|
|
{ // Calculate of maxreplaces
|
|
ulonglong max_substrs= max_result_length/args[1]->max_length;
|
|
max_result_length+= max_substrs * (uint) diff;
|
|
}
|
|
if (max_result_length >= MAX_BLOB_WIDTH)
|
|
{
|
|
max_result_length= MAX_BLOB_WIDTH;
|
|
maybe_null= 1;
|
|
}
|
|
max_length= (ulong) max_result_length;
|
|
|
|
if (agg_arg_charsets(collation, args, 3, MY_COLL_CMP_CONV, 1))
|
|
return;
|
|
}
|
|
|
|
|
|
String *Item_func_insert::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res,*res2;
|
|
longlong start, length; /* must be longlong to avoid truncation */
|
|
|
|
null_value=0;
|
|
res=args[0]->val_str(str);
|
|
res2=args[3]->val_str(&tmp_value);
|
|
start= args[1]->val_int() - 1;
|
|
length= args[2]->val_int();
|
|
|
|
if (args[0]->null_value || args[1]->null_value || args[2]->null_value ||
|
|
args[3]->null_value)
|
|
goto null; /* purecov: inspected */
|
|
|
|
if ((start < 0) || (start > res->length() + 1))
|
|
return res; // Wrong param; skip insert
|
|
if ((length < 0) || (length > res->length() + 1))
|
|
length= res->length() + 1;
|
|
|
|
/* start and length are now sufficiently valid to pass to charpos function */
|
|
start= res->charpos((int) start);
|
|
length= res->charpos((int) length, (uint32) start);
|
|
|
|
/* Re-testing with corrected params */
|
|
if (start > res->length() + 1)
|
|
return res; // Wrong param; skip insert
|
|
if (length > res->length() - start)
|
|
length= res->length() - start;
|
|
|
|
if ((ulonglong) (res->length() - length + res2->length()) >
|
|
(ulonglong) current_thd->variables.max_allowed_packet)
|
|
{
|
|
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
|
|
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
|
|
func_name(), current_thd->variables.max_allowed_packet);
|
|
goto null;
|
|
}
|
|
res=copy_if_not_alloced(str,res,res->length());
|
|
res->replace((uint32) start,(uint32) length,*res2);
|
|
return res;
|
|
null:
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_insert::fix_length_and_dec()
|
|
{
|
|
ulonglong max_result_length;
|
|
|
|
// Handle character set for args[0] and args[3].
|
|
if (agg_arg_charsets(collation, &args[0], 2, MY_COLL_ALLOW_CONV, 3))
|
|
return;
|
|
max_result_length= ((ulonglong) args[0]->max_length+
|
|
(ulonglong) args[3]->max_length);
|
|
if (max_result_length >= MAX_BLOB_WIDTH)
|
|
{
|
|
max_result_length= MAX_BLOB_WIDTH;
|
|
maybe_null= 1;
|
|
}
|
|
max_length= (ulong) max_result_length;
|
|
}
|
|
|
|
|
|
String *Item_str_conv::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res;
|
|
if (!(res=args[0]->val_str(str)))
|
|
{
|
|
null_value=1; /* purecov: inspected */
|
|
return 0; /* purecov: inspected */
|
|
}
|
|
null_value=0;
|
|
if (multiply == 1)
|
|
{
|
|
uint len;
|
|
res= copy_if_not_alloced(str,res,res->length());
|
|
len= converter(collation.collation, (char*) res->ptr(), res->length(),
|
|
(char*) res->ptr(), res->length());
|
|
DBUG_ASSERT(len <= res->length());
|
|
res->length(len);
|
|
}
|
|
else
|
|
{
|
|
uint len= res->length() * multiply;
|
|
tmp_value.alloc(len);
|
|
tmp_value.set_charset(collation.collation);
|
|
len= converter(collation.collation, (char*) res->ptr(), res->length(),
|
|
(char*) tmp_value.ptr(), len);
|
|
tmp_value.length(len);
|
|
res= &tmp_value;
|
|
}
|
|
return res;
|
|
}
|
|
|
|
|
|
String *Item_func_left::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res= args[0]->val_str(str);
|
|
|
|
/* must be longlong to avoid truncation */
|
|
longlong length= args[1]->val_int();
|
|
uint char_pos;
|
|
|
|
if ((null_value=(args[0]->null_value || args[1]->null_value)))
|
|
return 0;
|
|
|
|
/* if "unsigned_flag" is set, we have a *huge* positive number. */
|
|
if ((length <= 0) && (!args[1]->unsigned_flag))
|
|
return &my_empty_string;
|
|
|
|
if ((res->length() <= (ulonglong) length) ||
|
|
(res->length() <= (char_pos= res->charpos((int) length))))
|
|
return res;
|
|
|
|
tmp_value.set(*res, 0, char_pos);
|
|
return &tmp_value;
|
|
}
|
|
|
|
|
|
void Item_str_func::left_right_max_length()
|
|
{
|
|
max_length=args[0]->max_length;
|
|
if (args[1]->const_item())
|
|
{
|
|
int length=(int) args[1]->val_int()*collation.collation->mbmaxlen;
|
|
if (length <= 0)
|
|
max_length=0;
|
|
else
|
|
set_if_smaller(max_length,(uint) length);
|
|
}
|
|
}
|
|
|
|
|
|
void Item_func_left::fix_length_and_dec()
|
|
{
|
|
collation.set(args[0]->collation);
|
|
left_right_max_length();
|
|
}
|
|
|
|
|
|
String *Item_func_right::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res= args[0]->val_str(str);
|
|
/* must be longlong to avoid truncation */
|
|
longlong length= args[1]->val_int();
|
|
|
|
if ((null_value=(args[0]->null_value || args[1]->null_value)))
|
|
return 0; /* purecov: inspected */
|
|
|
|
/* if "unsigned_flag" is set, we have a *huge* positive number. */
|
|
if ((length <= 0) && (!args[1]->unsigned_flag))
|
|
return &my_empty_string; /* purecov: inspected */
|
|
|
|
if (res->length() <= (ulonglong) length)
|
|
return res; /* purecov: inspected */
|
|
|
|
uint start=res->numchars();
|
|
if (start <= (uint) length)
|
|
return res;
|
|
start=res->charpos(start - (uint) length);
|
|
tmp_value.set(*res,start,res->length()-start);
|
|
return &tmp_value;
|
|
}
|
|
|
|
|
|
void Item_func_right::fix_length_and_dec()
|
|
{
|
|
collation.set(args[0]->collation);
|
|
left_right_max_length();
|
|
}
|
|
|
|
|
|
String *Item_func_substr::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res = args[0]->val_str(str);
|
|
/* must be longlong to avoid truncation */
|
|
longlong start= args[1]->val_int();
|
|
/* Assumes that the maximum length of a String is < INT_MAX32. */
|
|
/* Limit so that code sees out-of-bound value properly. */
|
|
longlong length= arg_count == 3 ? args[2]->val_int() : INT_MAX32;
|
|
longlong tmp_length;
|
|
|
|
if ((null_value=(args[0]->null_value || args[1]->null_value ||
|
|
(arg_count == 3 && args[2]->null_value))))
|
|
return 0; /* purecov: inspected */
|
|
|
|
/* Negative length, will return empty string. */
|
|
if ((arg_count == 3) && (length <= 0) && !args[2]->unsigned_flag)
|
|
return &my_empty_string;
|
|
|
|
/* Assumes that the maximum length of a String is < INT_MAX32. */
|
|
/* Set here so that rest of code sees out-of-bound value as such. */
|
|
if ((length <= 0) || (length > INT_MAX32))
|
|
length= INT_MAX32;
|
|
|
|
/* if "unsigned_flag" is set, we have a *huge* positive number. */
|
|
/* Assumes that the maximum length of a String is < INT_MAX32. */
|
|
if ((!args[1]->unsigned_flag && (start < INT_MIN32 || start > INT_MAX32)) ||
|
|
(args[1]->unsigned_flag && ((ulonglong) start > INT_MAX32)))
|
|
return &my_empty_string;
|
|
|
|
start= ((start < 0) ? res->numchars() + start : start - 1);
|
|
start= res->charpos((int) start);
|
|
if ((start < 0) || ((uint) start + 1 > res->length()))
|
|
return &my_empty_string;
|
|
|
|
length= res->charpos((int) length, (uint32) start);
|
|
tmp_length= res->length() - start;
|
|
length= min(length, tmp_length);
|
|
|
|
if (!start && (longlong) res->length() == length)
|
|
return res;
|
|
tmp_value.set(*res, (uint32) start, (uint32) length);
|
|
return &tmp_value;
|
|
}
|
|
|
|
|
|
void Item_func_substr::fix_length_and_dec()
|
|
{
|
|
max_length=args[0]->max_length;
|
|
|
|
collation.set(args[0]->collation);
|
|
if (args[1]->const_item())
|
|
{
|
|
int32 start= (int32) args[1]->val_int();
|
|
start= (int32)((start < 0) ? max_length + start : start - 1);
|
|
if (start < 0 || start >= (int32) max_length)
|
|
max_length=0; /* purecov: inspected */
|
|
else
|
|
max_length-= (uint) start;
|
|
}
|
|
if (arg_count == 3 && args[2]->const_item())
|
|
{
|
|
int32 length= (int32) args[2]->val_int();
|
|
if (length <= 0)
|
|
max_length=0; /* purecov: inspected */
|
|
else
|
|
set_if_smaller(max_length,(uint) length);
|
|
}
|
|
max_length*= collation.collation->mbmaxlen;
|
|
}
|
|
|
|
|
|
void Item_func_substr_index::fix_length_and_dec()
|
|
{
|
|
max_length= args[0]->max_length;
|
|
|
|
if (agg_arg_charsets(collation, args, 2, MY_COLL_CMP_CONV, 1))
|
|
return;
|
|
}
|
|
|
|
|
|
String *Item_func_substr_index::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res= args[0]->val_str(str);
|
|
String *delimiter= args[1]->val_str(&tmp_value);
|
|
int32 count= (int32) args[2]->val_int();
|
|
uint offset;
|
|
|
|
if (args[0]->null_value || args[1]->null_value || args[2]->null_value)
|
|
{ // string and/or delim are null
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
null_value=0;
|
|
uint delimiter_length= delimiter->length();
|
|
if (!res->length() || !delimiter_length || !count)
|
|
return &my_empty_string; // Wrong parameters
|
|
|
|
res->set_charset(collation.collation);
|
|
|
|
#ifdef USE_MB
|
|
if (use_mb(res->charset()))
|
|
{
|
|
const char *ptr= res->ptr();
|
|
const char *strend= ptr+res->length();
|
|
const char *end= strend-delimiter_length+1;
|
|
const char *search= delimiter->ptr();
|
|
const char *search_end= search+delimiter_length;
|
|
int32 n=0,c=count,pass;
|
|
register uint32 l;
|
|
for (pass=(count>0);pass<2;++pass)
|
|
{
|
|
while (ptr < end)
|
|
{
|
|
if (*ptr == *search)
|
|
{
|
|
register char *i,*j;
|
|
i=(char*) ptr+1; j=(char*) search+1;
|
|
while (j != search_end)
|
|
if (*i++ != *j++) goto skip;
|
|
if (pass==0) ++n;
|
|
else if (!--c) break;
|
|
ptr+= delimiter_length;
|
|
continue;
|
|
}
|
|
skip:
|
|
if ((l=my_ismbchar(res->charset(), ptr,strend))) ptr+=l;
|
|
else ++ptr;
|
|
} /* either not found or got total number when count<0 */
|
|
if (pass == 0) /* count<0 */
|
|
{
|
|
c+=n+1;
|
|
if (c<=0) return res; /* not found, return original string */
|
|
ptr=res->ptr();
|
|
}
|
|
else
|
|
{
|
|
if (c) return res; /* Not found, return original string */
|
|
if (count>0) /* return left part */
|
|
{
|
|
tmp_value.set(*res,0,(ulong) (ptr-res->ptr()));
|
|
}
|
|
else /* return right part */
|
|
{
|
|
ptr+= delimiter_length;
|
|
tmp_value.set(*res,(ulong) (ptr-res->ptr()), (ulong) (strend-ptr));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
#endif /* USE_MB */
|
|
{
|
|
if (count > 0)
|
|
{ // start counting from the beginning
|
|
for (offset=0; ; offset+= delimiter_length)
|
|
{
|
|
if ((int) (offset= res->strstr(*delimiter, offset)) < 0)
|
|
return res; // Didn't find, return org string
|
|
if (!--count)
|
|
{
|
|
tmp_value.set(*res,0,offset);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
/*
|
|
Negative index, start counting at the end
|
|
*/
|
|
for (offset=res->length(); offset ;)
|
|
{
|
|
/*
|
|
this call will result in finding the position pointing to one
|
|
address space less than where the found substring is located
|
|
in res
|
|
*/
|
|
if ((int) (offset= res->strrstr(*delimiter, offset)) < 0)
|
|
return res; // Didn't find, return org string
|
|
/*
|
|
At this point, we've searched for the substring
|
|
the number of times as supplied by the index value
|
|
*/
|
|
if (!++count)
|
|
{
|
|
offset+= delimiter_length;
|
|
tmp_value.set(*res,offset,res->length()- offset);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*
|
|
We always mark tmp_value as const so that if val_str() is called again
|
|
on this object, we don't disrupt the contents of tmp_value when it was
|
|
derived from another String.
|
|
*/
|
|
tmp_value.mark_as_const();
|
|
return (&tmp_value);
|
|
}
|
|
|
|
/*
|
|
** The trim functions are extension to ANSI SQL because they trim substrings
|
|
** They ltrim() and rtrim() functions are optimized for 1 byte strings
|
|
** They also return the original string if possible, else they return
|
|
** a substring that points at the original string.
|
|
*/
|
|
|
|
|
|
String *Item_func_ltrim::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
char buff[MAX_FIELD_WIDTH], *ptr, *end;
|
|
String tmp(buff,sizeof(buff),system_charset_info);
|
|
String *res, *remove_str;
|
|
uint remove_length;
|
|
LINT_INIT(remove_length);
|
|
|
|
res= args[0]->val_str(str);
|
|
if ((null_value=args[0]->null_value))
|
|
return 0;
|
|
remove_str= &remove; /* Default value. */
|
|
if (arg_count == 2)
|
|
{
|
|
remove_str= args[1]->val_str(&tmp);
|
|
if ((null_value= args[1]->null_value))
|
|
return 0;
|
|
}
|
|
|
|
if ((remove_length= remove_str->length()) == 0 ||
|
|
remove_length > res->length())
|
|
return res;
|
|
|
|
ptr= (char*) res->ptr();
|
|
end= ptr+res->length();
|
|
if (remove_length == 1)
|
|
{
|
|
char chr=(*remove_str)[0];
|
|
while (ptr != end && *ptr == chr)
|
|
ptr++;
|
|
}
|
|
else
|
|
{
|
|
const char *r_ptr=remove_str->ptr();
|
|
end-=remove_length;
|
|
while (ptr <= end && !memcmp(ptr, r_ptr, remove_length))
|
|
ptr+=remove_length;
|
|
end+=remove_length;
|
|
}
|
|
if (ptr == res->ptr())
|
|
return res;
|
|
tmp_value.set(*res,(uint) (ptr - res->ptr()),(uint) (end-ptr));
|
|
return &tmp_value;
|
|
}
|
|
|
|
|
|
String *Item_func_rtrim::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
char buff[MAX_FIELD_WIDTH], *ptr, *end;
|
|
String tmp(buff, sizeof(buff), system_charset_info);
|
|
String *res, *remove_str;
|
|
uint remove_length;
|
|
LINT_INIT(remove_length);
|
|
|
|
res= args[0]->val_str(str);
|
|
if ((null_value=args[0]->null_value))
|
|
return 0;
|
|
remove_str= &remove; /* Default value. */
|
|
if (arg_count == 2)
|
|
{
|
|
remove_str= args[1]->val_str(&tmp);
|
|
if ((null_value= args[1]->null_value))
|
|
return 0;
|
|
}
|
|
|
|
if ((remove_length= remove_str->length()) == 0 ||
|
|
remove_length > res->length())
|
|
return res;
|
|
|
|
ptr= (char*) res->ptr();
|
|
end= ptr+res->length();
|
|
#ifdef USE_MB
|
|
char *p=ptr;
|
|
register uint32 l;
|
|
#endif
|
|
if (remove_length == 1)
|
|
{
|
|
char chr=(*remove_str)[0];
|
|
#ifdef USE_MB
|
|
if (use_mb(res->charset()))
|
|
{
|
|
while (ptr < end)
|
|
{
|
|
if ((l=my_ismbchar(res->charset(), ptr,end))) ptr+=l,p=ptr;
|
|
else ++ptr;
|
|
}
|
|
ptr=p;
|
|
}
|
|
#endif
|
|
while (ptr != end && end[-1] == chr)
|
|
end--;
|
|
}
|
|
else
|
|
{
|
|
const char *r_ptr=remove_str->ptr();
|
|
#ifdef USE_MB
|
|
if (use_mb(res->charset()))
|
|
{
|
|
loop:
|
|
while (ptr + remove_length < end)
|
|
{
|
|
if ((l=my_ismbchar(res->charset(), ptr,end))) ptr+=l;
|
|
else ++ptr;
|
|
}
|
|
if (ptr + remove_length == end && !memcmp(ptr,r_ptr,remove_length))
|
|
{
|
|
end-=remove_length;
|
|
ptr=p;
|
|
goto loop;
|
|
}
|
|
}
|
|
else
|
|
#endif /* USE_MB */
|
|
{
|
|
while (ptr + remove_length <= end &&
|
|
!memcmp(end-remove_length, r_ptr, remove_length))
|
|
end-=remove_length;
|
|
}
|
|
}
|
|
if (end == res->ptr()+res->length())
|
|
return res;
|
|
tmp_value.set(*res,0,(uint) (end-res->ptr()));
|
|
return &tmp_value;
|
|
}
|
|
|
|
|
|
String *Item_func_trim::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
char buff[MAX_FIELD_WIDTH], *ptr, *end;
|
|
const char *r_ptr;
|
|
String tmp(buff, sizeof(buff), system_charset_info);
|
|
String *res, *remove_str;
|
|
uint remove_length;
|
|
LINT_INIT(remove_length);
|
|
|
|
res= args[0]->val_str(str);
|
|
if ((null_value=args[0]->null_value))
|
|
return 0;
|
|
remove_str= &remove; /* Default value. */
|
|
if (arg_count == 2)
|
|
{
|
|
remove_str= args[1]->val_str(&tmp);
|
|
if ((null_value= args[1]->null_value))
|
|
return 0;
|
|
}
|
|
|
|
if ((remove_length= remove_str->length()) == 0 ||
|
|
remove_length > res->length())
|
|
return res;
|
|
|
|
ptr= (char*) res->ptr();
|
|
end= ptr+res->length();
|
|
r_ptr= remove_str->ptr();
|
|
while (ptr+remove_length <= end && !memcmp(ptr,r_ptr,remove_length))
|
|
ptr+=remove_length;
|
|
#ifdef USE_MB
|
|
if (use_mb(res->charset()))
|
|
{
|
|
char *p=ptr;
|
|
register uint32 l;
|
|
loop:
|
|
while (ptr + remove_length < end)
|
|
{
|
|
if ((l=my_ismbchar(res->charset(), ptr,end))) ptr+=l;
|
|
else ++ptr;
|
|
}
|
|
if (ptr + remove_length == end && !memcmp(ptr,r_ptr,remove_length))
|
|
{
|
|
end-=remove_length;
|
|
ptr=p;
|
|
goto loop;
|
|
}
|
|
ptr=p;
|
|
}
|
|
else
|
|
#endif /* USE_MB */
|
|
{
|
|
while (ptr + remove_length <= end &&
|
|
!memcmp(end-remove_length,r_ptr,remove_length))
|
|
end-=remove_length;
|
|
}
|
|
if (ptr == res->ptr() && end == ptr+res->length())
|
|
return res;
|
|
tmp_value.set(*res,(uint) (ptr - res->ptr()),(uint) (end-ptr));
|
|
return &tmp_value;
|
|
}
|
|
|
|
void Item_func_trim::fix_length_and_dec()
|
|
{
|
|
max_length= args[0]->max_length;
|
|
if (arg_count == 1)
|
|
{
|
|
collation.set(args[0]->collation);
|
|
remove.set_charset(collation.collation);
|
|
remove.set_ascii(" ",1);
|
|
}
|
|
else
|
|
{
|
|
// Handle character set for args[1] and args[0].
|
|
// Note that we pass args[1] as the first item, and args[0] as the second.
|
|
if (agg_arg_charsets(collation, &args[1], 2, MY_COLL_CMP_CONV, -1))
|
|
return;
|
|
}
|
|
}
|
|
|
|
void Item_func_trim::print(String *str)
|
|
{
|
|
if (arg_count == 1)
|
|
{
|
|
Item_func::print(str);
|
|
return;
|
|
}
|
|
str->append(Item_func_trim::func_name());
|
|
str->append('(');
|
|
str->append(mode_name());
|
|
str->append(' ');
|
|
args[1]->print(str);
|
|
str->append(STRING_WITH_LEN(" from "));
|
|
args[0]->print(str);
|
|
str->append(')');
|
|
}
|
|
|
|
|
|
/* Item_func_password */
|
|
|
|
String *Item_func_password::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res= args[0]->val_str(str);
|
|
if ((null_value=args[0]->null_value))
|
|
return 0;
|
|
if (res->length() == 0)
|
|
return &my_empty_string;
|
|
make_scrambled_password(tmp_value, res->c_ptr());
|
|
str->set(tmp_value, SCRAMBLED_PASSWORD_CHAR_LENGTH, res->charset());
|
|
return str;
|
|
}
|
|
|
|
char *Item_func_password::alloc(THD *thd, const char *password)
|
|
{
|
|
char *buff= (char *) thd->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH+1);
|
|
if (buff)
|
|
make_scrambled_password(buff, password);
|
|
return buff;
|
|
}
|
|
|
|
/* Item_func_old_password */
|
|
|
|
String *Item_func_old_password::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res= args[0]->val_str(str);
|
|
if ((null_value=args[0]->null_value))
|
|
return 0;
|
|
if (res->length() == 0)
|
|
return &my_empty_string;
|
|
make_scrambled_password_323(tmp_value, res->c_ptr());
|
|
str->set(tmp_value, SCRAMBLED_PASSWORD_CHAR_LENGTH_323, res->charset());
|
|
return str;
|
|
}
|
|
|
|
char *Item_func_old_password::alloc(THD *thd, const char *password)
|
|
{
|
|
char *buff= (char *) thd->alloc(SCRAMBLED_PASSWORD_CHAR_LENGTH_323+1);
|
|
if (buff)
|
|
make_scrambled_password_323(buff, password);
|
|
return buff;
|
|
}
|
|
|
|
|
|
#define bin_to_ascii(c) ((c)>=38?((c)-38+'a'):(c)>=12?((c)-12+'A'):(c)+'.')
|
|
|
|
String *Item_func_encrypt::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res =args[0]->val_str(str);
|
|
|
|
#ifdef HAVE_CRYPT
|
|
char salt[3],*salt_ptr;
|
|
if ((null_value=args[0]->null_value))
|
|
return 0;
|
|
if (res->length() == 0)
|
|
return &my_empty_string;
|
|
|
|
if (arg_count == 1)
|
|
{ // generate random salt
|
|
time_t timestamp=current_thd->query_start();
|
|
salt[0] = bin_to_ascii( (ulong) timestamp & 0x3f);
|
|
salt[1] = bin_to_ascii(( (ulong) timestamp >> 5) & 0x3f);
|
|
salt[2] = 0;
|
|
salt_ptr=salt;
|
|
}
|
|
else
|
|
{ // obtain salt from the first two bytes
|
|
String *salt_str=args[1]->val_str(&tmp_value);
|
|
if ((null_value= (args[1]->null_value || salt_str->length() < 2)))
|
|
return 0;
|
|
salt_ptr= salt_str->c_ptr();
|
|
}
|
|
pthread_mutex_lock(&LOCK_crypt);
|
|
char *tmp= crypt(res->c_ptr(),salt_ptr);
|
|
if (!tmp)
|
|
{
|
|
pthread_mutex_unlock(&LOCK_crypt);
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
str->set(tmp, (uint) strlen(tmp), &my_charset_bin);
|
|
str->copy();
|
|
pthread_mutex_unlock(&LOCK_crypt);
|
|
return str;
|
|
#else
|
|
null_value=1;
|
|
return 0;
|
|
#endif /* HAVE_CRYPT */
|
|
}
|
|
|
|
void Item_func_encode::fix_length_and_dec()
|
|
{
|
|
max_length=args[0]->max_length;
|
|
maybe_null=args[0]->maybe_null || args[1]->maybe_null;
|
|
collation.set(&my_charset_bin);
|
|
}
|
|
|
|
String *Item_func_encode::val_str(String *str)
|
|
{
|
|
String *res;
|
|
char pw_buff[80];
|
|
String tmp_pw_value(pw_buff, sizeof(pw_buff), system_charset_info);
|
|
String *password;
|
|
DBUG_ASSERT(fixed == 1);
|
|
|
|
if (!(res=args[0]->val_str(str)))
|
|
{
|
|
null_value=1; /* purecov: inspected */
|
|
return 0; /* purecov: inspected */
|
|
}
|
|
|
|
if (!(password=args[1]->val_str(& tmp_pw_value)))
|
|
{
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
null_value=0;
|
|
res=copy_if_not_alloced(str,res,res->length());
|
|
SQL_CRYPT sql_crypt(password->ptr());
|
|
sql_crypt.init();
|
|
sql_crypt.encode((char*) res->ptr(),res->length());
|
|
res->set_charset(&my_charset_bin);
|
|
return res;
|
|
}
|
|
|
|
String *Item_func_decode::val_str(String *str)
|
|
{
|
|
String *res;
|
|
char pw_buff[80];
|
|
String tmp_pw_value(pw_buff, sizeof(pw_buff), system_charset_info);
|
|
String *password;
|
|
DBUG_ASSERT(fixed == 1);
|
|
|
|
if (!(res=args[0]->val_str(str)))
|
|
{
|
|
null_value=1; /* purecov: inspected */
|
|
return 0; /* purecov: inspected */
|
|
}
|
|
|
|
if (!(password=args[1]->val_str(& tmp_pw_value)))
|
|
{
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
null_value=0;
|
|
res=copy_if_not_alloced(str,res,res->length());
|
|
SQL_CRYPT sql_crypt(password->ptr());
|
|
sql_crypt.init();
|
|
sql_crypt.decode((char*) res->ptr(),res->length());
|
|
return res;
|
|
}
|
|
|
|
|
|
Item *Item_func_sysconst::safe_charset_converter(CHARSET_INFO *tocs)
|
|
{
|
|
Item_string *conv;
|
|
uint conv_errors;
|
|
String tmp, cstr, *ostr= val_str(&tmp);
|
|
cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &conv_errors);
|
|
if (conv_errors ||
|
|
!(conv= new Item_static_string_func(fully_qualified_func_name(),
|
|
cstr.ptr(), cstr.length(),
|
|
cstr.charset(),
|
|
collation.derivation)))
|
|
{
|
|
return NULL;
|
|
}
|
|
conv->str_value.copy();
|
|
conv->str_value.mark_as_const();
|
|
return conv;
|
|
}
|
|
|
|
|
|
String *Item_func_database::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
THD *thd= current_thd;
|
|
if (thd->db == NULL)
|
|
{
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
else
|
|
str->copy(thd->db, thd->db_length, system_charset_info);
|
|
return str;
|
|
}
|
|
|
|
|
|
/*
|
|
TODO: make USER() replicate properly (currently it is replicated to "")
|
|
*/
|
|
bool Item_func_user::init(const char *user, const char *host)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
|
|
// For system threads (e.g. replication SQL thread) user may be empty
|
|
if (user)
|
|
{
|
|
CHARSET_INFO *cs= str_value.charset();
|
|
uint res_length= (strlen(user)+strlen(host)+2) * cs->mbmaxlen;
|
|
|
|
if (str_value.alloc(res_length))
|
|
{
|
|
null_value=1;
|
|
return TRUE;
|
|
}
|
|
|
|
res_length=cs->cset->snprintf(cs, (char*)str_value.ptr(), res_length,
|
|
"%s@%s", user, host);
|
|
str_value.length(res_length);
|
|
str_value.mark_as_const();
|
|
}
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
bool Item_func_user::fix_fields(THD *thd, Item **ref)
|
|
{
|
|
return (Item_func_sysconst::fix_fields(thd, ref) ||
|
|
init(thd->main_security_ctx.user,
|
|
thd->main_security_ctx.host_or_ip));
|
|
}
|
|
|
|
|
|
bool Item_func_current_user::fix_fields(THD *thd, Item **ref)
|
|
{
|
|
if (Item_func_sysconst::fix_fields(thd, ref))
|
|
return TRUE;
|
|
|
|
Security_context *ctx= (context->security_ctx
|
|
? context->security_ctx : thd->security_ctx);
|
|
return init(ctx->priv_user, ctx->priv_host);
|
|
}
|
|
|
|
|
|
void Item_func_soundex::fix_length_and_dec()
|
|
{
|
|
collation.set(args[0]->collation);
|
|
max_length=args[0]->max_length;
|
|
set_if_bigger(max_length,4);
|
|
}
|
|
|
|
|
|
/*
|
|
If alpha, map input letter to soundex code.
|
|
If not alpha and remove_garbage is set then skip to next char
|
|
else return 0
|
|
*/
|
|
|
|
static char soundex_toupper(char ch)
|
|
{
|
|
return (ch >= 'a' && ch <= 'z') ? ch - 'a' + 'A' : ch;
|
|
}
|
|
|
|
static char get_scode(char *ptr)
|
|
{
|
|
uchar ch= soundex_toupper(*ptr);
|
|
if (ch < 'A' || ch > 'Z')
|
|
{
|
|
// Thread extended alfa (country spec)
|
|
return '0'; // as vokal
|
|
}
|
|
return(soundex_map[ch-'A']);
|
|
}
|
|
|
|
|
|
String *Item_func_soundex::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res =args[0]->val_str(str);
|
|
char last_ch,ch;
|
|
CHARSET_INFO *cs= collation.collation;
|
|
|
|
if ((null_value=args[0]->null_value))
|
|
return 0; /* purecov: inspected */
|
|
|
|
if (tmp_value.alloc(max(res->length(),4)))
|
|
return str; /* purecov: inspected */
|
|
char *to= (char *) tmp_value.ptr();
|
|
char *from= (char *) res->ptr(), *end=from+res->length();
|
|
tmp_value.set_charset(cs);
|
|
|
|
while (from != end && !my_isalpha(cs,*from)) // Skip pre-space
|
|
from++; /* purecov: inspected */
|
|
if (from == end)
|
|
return &my_empty_string; // No alpha characters.
|
|
*to++ = soundex_toupper(*from); // Copy first letter
|
|
last_ch = get_scode(from); // code of the first letter
|
|
// for the first 'double-letter check.
|
|
// Loop on input letters until
|
|
// end of input (null) or output
|
|
// letter code count = 3
|
|
for (from++ ; from < end ; from++)
|
|
{
|
|
if (!my_isalpha(cs,*from))
|
|
continue;
|
|
ch=get_scode(from);
|
|
if ((ch != '0') && (ch != last_ch)) // if not skipped or double
|
|
{
|
|
*to++ = ch; // letter, copy to output
|
|
last_ch = ch; // save code of last input letter
|
|
} // for next double-letter check
|
|
}
|
|
for (end=(char*) tmp_value.ptr()+4 ; to < end ; to++)
|
|
*to = '0';
|
|
*to=0; // end string
|
|
tmp_value.length((uint) (to-tmp_value.ptr()));
|
|
return &tmp_value;
|
|
}
|
|
|
|
|
|
/*
|
|
** Change a number to format '3,333,333,333.000'
|
|
** This should be 'internationalized' sometimes.
|
|
*/
|
|
|
|
const int FORMAT_MAX_DECIMALS= 30;
|
|
|
|
Item_func_format::Item_func_format(Item *org, Item *dec)
|
|
: Item_str_func(org, dec)
|
|
{
|
|
}
|
|
|
|
void Item_func_format::fix_length_and_dec()
|
|
{
|
|
collation.set(default_charset());
|
|
uint char_length= args[0]->max_length/args[0]->collation.collation->mbmaxlen;
|
|
max_length= ((char_length + (char_length-args[0]->decimals)/3) *
|
|
collation.collation->mbmaxlen);
|
|
}
|
|
|
|
|
|
/*
|
|
TODO: This needs to be fixed for multi-byte character set where numbers
|
|
are stored in more than one byte
|
|
*/
|
|
|
|
String *Item_func_format::val_str(String *str)
|
|
{
|
|
uint32 length;
|
|
uint32 str_length;
|
|
/* Number of decimal digits */
|
|
int dec;
|
|
/* Number of characters used to represent the decimals, including '.' */
|
|
uint32 dec_length;
|
|
int diff;
|
|
DBUG_ASSERT(fixed == 1);
|
|
|
|
dec= args[1]->val_int();
|
|
if (args[1]->null_value)
|
|
{
|
|
null_value=1;
|
|
return NULL;
|
|
}
|
|
|
|
dec= set_zone(dec, 0, FORMAT_MAX_DECIMALS);
|
|
dec_length= dec ? dec+1 : 0;
|
|
null_value=0;
|
|
|
|
if (args[0]->result_type() == DECIMAL_RESULT ||
|
|
args[0]->result_type() == INT_RESULT)
|
|
{
|
|
my_decimal dec_val, rnd_dec, *res;
|
|
res= args[0]->val_decimal(&dec_val);
|
|
if ((null_value=args[0]->null_value))
|
|
return 0; /* purecov: inspected */
|
|
my_decimal_round(E_DEC_FATAL_ERROR, res, dec, false, &rnd_dec);
|
|
my_decimal2string(E_DEC_FATAL_ERROR, &rnd_dec, 0, 0, 0, str);
|
|
str_length= str->length();
|
|
if (rnd_dec.sign())
|
|
str_length--;
|
|
}
|
|
else
|
|
{
|
|
double nr= args[0]->val_real();
|
|
if ((null_value=args[0]->null_value))
|
|
return 0; /* purecov: inspected */
|
|
nr= my_double_round(nr, dec, FALSE);
|
|
/* Here default_charset() is right as this is not an automatic conversion */
|
|
str->set_real(nr, dec, default_charset());
|
|
if (isnan(nr))
|
|
return str;
|
|
str_length=str->length();
|
|
if (nr < 0)
|
|
str_length--; // Don't count sign
|
|
}
|
|
/* We need this test to handle 'nan' values */
|
|
if (str_length >= dec_length+4)
|
|
{
|
|
char *tmp,*pos;
|
|
length= str->length()+(diff=((int)(str_length- dec_length-1))/3);
|
|
str= copy_if_not_alloced(&tmp_str,str,length);
|
|
str->length(length);
|
|
tmp= (char*) str->ptr()+length - dec_length-1;
|
|
for (pos= (char*) str->ptr()+length-1; pos != tmp; pos--)
|
|
pos[0]= pos[-diff];
|
|
while (diff)
|
|
{
|
|
*pos= *(pos - diff);
|
|
pos--;
|
|
*pos= *(pos - diff);
|
|
pos--;
|
|
*pos= *(pos - diff);
|
|
pos--;
|
|
pos[0]=',';
|
|
pos--;
|
|
diff--;
|
|
}
|
|
}
|
|
return str;
|
|
}
|
|
|
|
|
|
void Item_func_format::print(String *str)
|
|
{
|
|
str->append(STRING_WITH_LEN("format("));
|
|
args[0]->print(str);
|
|
str->append(',');
|
|
args[1]->print(str);
|
|
str->append(')');
|
|
}
|
|
|
|
void Item_func_elt::fix_length_and_dec()
|
|
{
|
|
max_length=0;
|
|
decimals=0;
|
|
|
|
if (agg_arg_charsets(collation, args+1, arg_count-1, MY_COLL_ALLOW_CONV, 1))
|
|
return;
|
|
|
|
for (uint i= 1 ; i < arg_count ; i++)
|
|
{
|
|
set_if_bigger(max_length,args[i]->max_length);
|
|
set_if_bigger(decimals,args[i]->decimals);
|
|
}
|
|
maybe_null=1; // NULL if wrong first arg
|
|
}
|
|
|
|
|
|
double Item_func_elt::val_real()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
uint tmp;
|
|
null_value=1;
|
|
if ((tmp=(uint) args[0]->val_int()) == 0 || tmp >= arg_count)
|
|
return 0.0;
|
|
double result= args[tmp]->val_real();
|
|
null_value= args[tmp]->null_value;
|
|
return result;
|
|
}
|
|
|
|
|
|
longlong Item_func_elt::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
uint tmp;
|
|
null_value=1;
|
|
if ((tmp=(uint) args[0]->val_int()) == 0 || tmp >= arg_count)
|
|
return 0;
|
|
|
|
longlong result= args[tmp]->val_int();
|
|
null_value= args[tmp]->null_value;
|
|
return result;
|
|
}
|
|
|
|
|
|
String *Item_func_elt::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
uint tmp;
|
|
null_value=1;
|
|
if ((tmp=(uint) args[0]->val_int()) == 0 || tmp >= arg_count)
|
|
return NULL;
|
|
|
|
String *result= args[tmp]->val_str(str);
|
|
if (result)
|
|
result->set_charset(collation.collation);
|
|
null_value= args[tmp]->null_value;
|
|
return result;
|
|
}
|
|
|
|
|
|
void Item_func_make_set::split_sum_func(THD *thd, Item **ref_pointer_array,
|
|
List<Item> &fields)
|
|
{
|
|
item->split_sum_func2(thd, ref_pointer_array, fields, &item, TRUE);
|
|
Item_str_func::split_sum_func(thd, ref_pointer_array, fields);
|
|
}
|
|
|
|
|
|
void Item_func_make_set::fix_length_and_dec()
|
|
{
|
|
max_length=arg_count-1;
|
|
|
|
if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV, 1))
|
|
return;
|
|
|
|
for (uint i=0 ; i < arg_count ; i++)
|
|
max_length+=args[i]->max_length;
|
|
|
|
used_tables_cache|= item->used_tables();
|
|
not_null_tables_cache&= item->not_null_tables();
|
|
const_item_cache&= item->const_item();
|
|
with_sum_func= with_sum_func || item->with_sum_func;
|
|
}
|
|
|
|
|
|
void Item_func_make_set::update_used_tables()
|
|
{
|
|
Item_func::update_used_tables();
|
|
item->update_used_tables();
|
|
used_tables_cache|=item->used_tables();
|
|
const_item_cache&=item->const_item();
|
|
}
|
|
|
|
|
|
String *Item_func_make_set::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
ulonglong bits;
|
|
bool first_found=0;
|
|
Item **ptr=args;
|
|
String *result=&my_empty_string;
|
|
|
|
bits=item->val_int();
|
|
if ((null_value=item->null_value))
|
|
return NULL;
|
|
|
|
if (arg_count < 64)
|
|
bits &= ((ulonglong) 1 << arg_count)-1;
|
|
|
|
for (; bits; bits >>= 1, ptr++)
|
|
{
|
|
if (bits & 1)
|
|
{
|
|
String *res= (*ptr)->val_str(str);
|
|
if (res) // Skip nulls
|
|
{
|
|
if (!first_found)
|
|
{ // First argument
|
|
first_found=1;
|
|
if (res != str)
|
|
result=res; // Use original string
|
|
else
|
|
{
|
|
if (tmp_str.copy(*res)) // Don't use 'str'
|
|
return &my_empty_string;
|
|
result= &tmp_str;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (result != &tmp_str)
|
|
{ // Copy data to tmp_str
|
|
if (tmp_str.alloc(result->length()+res->length()+1) ||
|
|
tmp_str.copy(*result))
|
|
return &my_empty_string;
|
|
result= &tmp_str;
|
|
}
|
|
if (tmp_str.append(STRING_WITH_LEN(","), &my_charset_bin) || tmp_str.append(*res))
|
|
return &my_empty_string;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
|
|
Item *Item_func_make_set::transform(Item_transformer transformer, byte *arg)
|
|
{
|
|
DBUG_ASSERT(!current_thd->is_stmt_prepare());
|
|
|
|
Item *new_item= item->transform(transformer, arg);
|
|
if (!new_item)
|
|
return 0;
|
|
|
|
/*
|
|
THD::change_item_tree() should be called only if the tree was
|
|
really transformed, i.e. when a new item has been created.
|
|
Otherwise we'll be allocating a lot of unnecessary memory for
|
|
change records at each execution.
|
|
*/
|
|
if (item != new_item)
|
|
current_thd->change_item_tree(&item, new_item);
|
|
return Item_str_func::transform(transformer, arg);
|
|
}
|
|
|
|
|
|
void Item_func_make_set::print(String *str)
|
|
{
|
|
str->append(STRING_WITH_LEN("make_set("));
|
|
item->print(str);
|
|
if (arg_count)
|
|
{
|
|
str->append(',');
|
|
print_args(str, 0);
|
|
}
|
|
str->append(')');
|
|
}
|
|
|
|
|
|
String *Item_func_char::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
str->length(0);
|
|
for (uint i=0 ; i < arg_count ; i++)
|
|
{
|
|
int32 num=(int32) args[i]->val_int();
|
|
if (!args[i]->null_value)
|
|
{
|
|
if (num&0xFF000000L) {
|
|
str->append((char)(num>>24));
|
|
goto b2;
|
|
} else if (num&0xFF0000L) {
|
|
b2: str->append((char)(num>>16));
|
|
goto b1;
|
|
} else if (num&0xFF00L) {
|
|
b1: str->append((char)(num>>8));
|
|
}
|
|
str->append((char) num);
|
|
}
|
|
}
|
|
str->set_charset(collation.collation);
|
|
str->realloc(str->length()); // Add end 0 (for Purify)
|
|
return check_well_formed_result(str);
|
|
}
|
|
|
|
|
|
inline String* alloc_buffer(String *res,String *str,String *tmp_value,
|
|
ulong length)
|
|
{
|
|
if (res->alloced_length() < length)
|
|
{
|
|
if (str->alloced_length() >= length)
|
|
{
|
|
(void) str->copy(*res);
|
|
str->length(length);
|
|
return str;
|
|
}
|
|
if (tmp_value->alloc(length))
|
|
return 0;
|
|
(void) tmp_value->copy(*res);
|
|
tmp_value->length(length);
|
|
return tmp_value;
|
|
}
|
|
res->length(length);
|
|
return res;
|
|
}
|
|
|
|
|
|
void Item_func_repeat::fix_length_and_dec()
|
|
{
|
|
collation.set(args[0]->collation);
|
|
if (args[1]->const_item())
|
|
{
|
|
/* must be longlong to avoid truncation */
|
|
longlong count= args[1]->val_int();
|
|
|
|
/* Assumes that the maximum length of a String is < INT_MAX32. */
|
|
/* Set here so that rest of code sees out-of-bound value as such. */
|
|
if (count > INT_MAX32)
|
|
count= INT_MAX32;
|
|
|
|
ulonglong max_result_length= (ulonglong) args[0]->max_length * count;
|
|
if (max_result_length >= MAX_BLOB_WIDTH)
|
|
{
|
|
max_result_length= MAX_BLOB_WIDTH;
|
|
maybe_null= 1;
|
|
}
|
|
max_length= (ulong) max_result_length;
|
|
}
|
|
else
|
|
{
|
|
max_length= MAX_BLOB_WIDTH;
|
|
maybe_null= 1;
|
|
}
|
|
}
|
|
|
|
/*
|
|
** Item_func_repeat::str is carefully written to avoid reallocs
|
|
** as much as possible at the cost of a local buffer
|
|
*/
|
|
|
|
String *Item_func_repeat::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
uint length,tot_length;
|
|
char *to;
|
|
/* must be longlong to avoid truncation */
|
|
longlong count= args[1]->val_int();
|
|
String *res= args[0]->val_str(str);
|
|
|
|
if (args[0]->null_value || args[1]->null_value)
|
|
goto err; // string and/or delim are null
|
|
null_value= 0;
|
|
if ((count <= 0) && !args[1]->unsigned_flag) // For nicer SQL code
|
|
return &my_empty_string;
|
|
/* Assumes that the maximum length of a String is < INT_MAX32. */
|
|
/* Bounds check on count: If this is triggered, we will error. */
|
|
if ((ulonglong) count > INT_MAX32)
|
|
count= INT_MAX32;
|
|
if (count == 1) // To avoid reallocs
|
|
return res;
|
|
length=res->length();
|
|
// Safe length check
|
|
if (length > current_thd->variables.max_allowed_packet / (uint) count)
|
|
{
|
|
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
|
|
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
|
|
func_name(), current_thd->variables.max_allowed_packet);
|
|
goto err;
|
|
}
|
|
tot_length= length*(uint) count;
|
|
if (!(res= alloc_buffer(res,str,&tmp_value,tot_length)))
|
|
goto err;
|
|
|
|
to=(char*) res->ptr()+length;
|
|
while (--count)
|
|
{
|
|
memcpy(to,res->ptr(),length);
|
|
to+=length;
|
|
}
|
|
return (res);
|
|
|
|
err:
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_rpad::fix_length_and_dec()
|
|
{
|
|
// Handle character set for args[0] and args[2].
|
|
if (agg_arg_charsets(collation, &args[0], 2, MY_COLL_ALLOW_CONV, 2))
|
|
return;
|
|
if (args[1]->const_item())
|
|
{
|
|
ulonglong length= 0;
|
|
|
|
if (collation.collation->mbmaxlen > 0)
|
|
{
|
|
ulonglong temp= (ulonglong) args[1]->val_int();
|
|
|
|
/* Assumes that the maximum length of a String is < INT_MAX32. */
|
|
/* Set here so that rest of code sees out-of-bound value as such. */
|
|
if (temp > INT_MAX32)
|
|
temp = INT_MAX32;
|
|
|
|
length= temp * collation.collation->mbmaxlen;
|
|
}
|
|
|
|
if (length >= MAX_BLOB_WIDTH)
|
|
{
|
|
length= MAX_BLOB_WIDTH;
|
|
maybe_null= 1;
|
|
}
|
|
max_length= (ulong) length;
|
|
}
|
|
else
|
|
{
|
|
max_length= MAX_BLOB_WIDTH;
|
|
maybe_null= 1;
|
|
}
|
|
}
|
|
|
|
|
|
String *Item_func_rpad::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
uint32 res_byte_length,res_char_length,pad_char_length,pad_byte_length;
|
|
char *to;
|
|
const char *ptr_pad;
|
|
/* must be longlong to avoid truncation */
|
|
longlong count= args[1]->val_int();
|
|
longlong byte_count;
|
|
String *res= args[0]->val_str(str);
|
|
String *rpad= args[2]->val_str(&rpad_str);
|
|
|
|
if (!res || args[1]->null_value || !rpad ||
|
|
((count < 0) && !args[1]->unsigned_flag))
|
|
goto err;
|
|
null_value=0;
|
|
/* Assumes that the maximum length of a String is < INT_MAX32. */
|
|
/* Set here so that rest of code sees out-of-bound value as such. */
|
|
if ((ulonglong) count > INT_MAX32)
|
|
count= INT_MAX32;
|
|
if (count <= (res_char_length= res->numchars()))
|
|
{ // String to pad is big enough
|
|
res->length(res->charpos((int) count)); // Shorten result if longer
|
|
return (res);
|
|
}
|
|
pad_char_length= rpad->numchars();
|
|
|
|
byte_count= count * collation.collation->mbmaxlen;
|
|
if ((ulonglong) byte_count > current_thd->variables.max_allowed_packet)
|
|
{
|
|
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
|
|
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
|
|
func_name(), current_thd->variables.max_allowed_packet);
|
|
goto err;
|
|
}
|
|
if (args[2]->null_value || !pad_char_length)
|
|
goto err;
|
|
res_byte_length= res->length(); /* Must be done before alloc_buffer */
|
|
if (!(res= alloc_buffer(res,str,&tmp_value, (ulong) byte_count)))
|
|
goto err;
|
|
|
|
to= (char*) res->ptr()+res_byte_length;
|
|
ptr_pad=rpad->ptr();
|
|
pad_byte_length= rpad->length();
|
|
count-= res_char_length;
|
|
for ( ; (uint32) count > pad_char_length; count-= pad_char_length)
|
|
{
|
|
memcpy(to,ptr_pad,pad_byte_length);
|
|
to+= pad_byte_length;
|
|
}
|
|
if (count)
|
|
{
|
|
pad_byte_length= rpad->charpos((int) count);
|
|
memcpy(to,ptr_pad,(size_t) pad_byte_length);
|
|
to+= pad_byte_length;
|
|
}
|
|
res->length(to- (char*) res->ptr());
|
|
return (res);
|
|
|
|
err:
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
void Item_func_lpad::fix_length_and_dec()
|
|
{
|
|
// Handle character set for args[0] and args[2].
|
|
if (agg_arg_charsets(collation, &args[0], 2, MY_COLL_ALLOW_CONV, 2))
|
|
return;
|
|
|
|
if (args[1]->const_item())
|
|
{
|
|
ulonglong length= 0;
|
|
|
|
if (collation.collation->mbmaxlen > 0)
|
|
{
|
|
ulonglong temp= (ulonglong) args[1]->val_int();
|
|
|
|
/* Assumes that the maximum length of a String is < INT_MAX32. */
|
|
/* Set here so that rest of code sees out-of-bound value as such. */
|
|
if (temp > INT_MAX32)
|
|
temp= INT_MAX32;
|
|
|
|
length= temp * collation.collation->mbmaxlen;
|
|
}
|
|
|
|
if (length >= MAX_BLOB_WIDTH)
|
|
{
|
|
length= MAX_BLOB_WIDTH;
|
|
maybe_null= 1;
|
|
}
|
|
max_length= (ulong) length;
|
|
}
|
|
else
|
|
{
|
|
max_length= MAX_BLOB_WIDTH;
|
|
maybe_null= 1;
|
|
}
|
|
}
|
|
|
|
|
|
String *Item_func_lpad::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
uint32 res_char_length,pad_char_length;
|
|
/* must be longlong to avoid truncation */
|
|
longlong count= args[1]->val_int();
|
|
longlong byte_count;
|
|
String *res= args[0]->val_str(&tmp_value);
|
|
String *pad= args[2]->val_str(&lpad_str);
|
|
|
|
if (!res || args[1]->null_value || !pad ||
|
|
((count < 0) && !args[1]->unsigned_flag))
|
|
goto err;
|
|
null_value=0;
|
|
/* Assumes that the maximum length of a String is < INT_MAX32. */
|
|
/* Set here so that rest of code sees out-of-bound value as such. */
|
|
if ((ulonglong) count > INT_MAX32)
|
|
count= INT_MAX32;
|
|
|
|
res_char_length= res->numchars();
|
|
|
|
if (count <= res_char_length)
|
|
{
|
|
res->length(res->charpos((int) count));
|
|
return res;
|
|
}
|
|
|
|
pad_char_length= pad->numchars();
|
|
byte_count= count * collation.collation->mbmaxlen;
|
|
|
|
if ((ulonglong) byte_count > current_thd->variables.max_allowed_packet)
|
|
{
|
|
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
|
|
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
|
|
func_name(), current_thd->variables.max_allowed_packet);
|
|
goto err;
|
|
}
|
|
|
|
if (args[2]->null_value || !pad_char_length ||
|
|
str->alloc((uint32) byte_count))
|
|
goto err;
|
|
|
|
str->length(0);
|
|
str->set_charset(collation.collation);
|
|
count-= res_char_length;
|
|
while (count >= pad_char_length)
|
|
{
|
|
str->append(*pad);
|
|
count-= pad_char_length;
|
|
}
|
|
if (count > 0)
|
|
str->append(pad->ptr(), pad->charpos((int) count), collation.collation);
|
|
|
|
str->append(*res);
|
|
null_value= 0;
|
|
return str;
|
|
|
|
err:
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
|
|
|
|
String *Item_func_conv::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res= args[0]->val_str(str);
|
|
char *endptr,ans[65],*ptr;
|
|
longlong dec;
|
|
int from_base= (int) args[1]->val_int();
|
|
int to_base= (int) args[2]->val_int();
|
|
int err;
|
|
|
|
if (args[0]->null_value || args[1]->null_value || args[2]->null_value ||
|
|
abs(to_base) > 36 || abs(to_base) < 2 ||
|
|
abs(from_base) > 36 || abs(from_base) < 2 || !(res->length()))
|
|
{
|
|
null_value= 1;
|
|
return NULL;
|
|
}
|
|
null_value= 0;
|
|
unsigned_flag= !(from_base < 0);
|
|
|
|
if (args[0]->field_type() == MYSQL_TYPE_BIT)
|
|
{
|
|
/*
|
|
Special case: The string representation of BIT doesn't resemble the
|
|
decimal representation, so we shouldn't change it to string and then to
|
|
decimal.
|
|
*/
|
|
dec= args[0]->val_int();
|
|
}
|
|
else
|
|
{
|
|
if (from_base < 0)
|
|
dec= my_strntoll(res->charset(), res->ptr(), res->length(),
|
|
-from_base, &endptr, &err);
|
|
else
|
|
dec= (longlong) my_strntoull(res->charset(), res->ptr(), res->length(),
|
|
from_base, &endptr, &err);
|
|
}
|
|
|
|
ptr= longlong2str(dec, ans, to_base);
|
|
if (str->copy(ans, (uint32) (ptr-ans), default_charset()))
|
|
return &my_empty_string;
|
|
return str;
|
|
}
|
|
|
|
|
|
String *Item_func_conv_charset::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
if (use_cached_value)
|
|
return null_value ? 0 : &str_value;
|
|
String *arg= args[0]->val_str(str);
|
|
uint dummy_errors;
|
|
if (!arg)
|
|
{
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
null_value= str_value.copy(arg->ptr(),arg->length(),arg->charset(),
|
|
conv_charset, &dummy_errors);
|
|
return null_value ? 0 : check_well_formed_result(&str_value);
|
|
}
|
|
|
|
void Item_func_conv_charset::fix_length_and_dec()
|
|
{
|
|
collation.set(conv_charset, DERIVATION_IMPLICIT);
|
|
max_length = args[0]->max_length*conv_charset->mbmaxlen;
|
|
}
|
|
|
|
void Item_func_conv_charset::print(String *str)
|
|
{
|
|
str->append(STRING_WITH_LEN("convert("));
|
|
args[0]->print(str);
|
|
str->append(STRING_WITH_LEN(" using "));
|
|
str->append(conv_charset->csname);
|
|
str->append(')');
|
|
}
|
|
|
|
String *Item_func_set_collation::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
str=args[0]->val_str(str);
|
|
if ((null_value=args[0]->null_value))
|
|
return 0;
|
|
str->set_charset(collation.collation);
|
|
return str;
|
|
}
|
|
|
|
void Item_func_set_collation::fix_length_and_dec()
|
|
{
|
|
CHARSET_INFO *set_collation;
|
|
const char *colname;
|
|
String tmp, *str= args[1]->val_str(&tmp);
|
|
colname= str->c_ptr();
|
|
if (colname == binary_keyword)
|
|
set_collation= get_charset_by_csname(args[0]->collation.collation->csname,
|
|
MY_CS_BINSORT,MYF(0));
|
|
else
|
|
{
|
|
if (!(set_collation= get_charset_by_name(colname,MYF(0))))
|
|
{
|
|
my_error(ER_UNKNOWN_COLLATION, MYF(0), colname);
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (!set_collation ||
|
|
!my_charset_same(args[0]->collation.collation,set_collation))
|
|
{
|
|
my_error(ER_COLLATION_CHARSET_MISMATCH, MYF(0),
|
|
colname, args[0]->collation.collation->csname);
|
|
return;
|
|
}
|
|
collation.set(set_collation, DERIVATION_EXPLICIT);
|
|
max_length= args[0]->max_length;
|
|
}
|
|
|
|
|
|
bool Item_func_set_collation::eq(const Item *item, bool binary_cmp) const
|
|
{
|
|
/* Assume we don't have rtti */
|
|
if (this == item)
|
|
return 1;
|
|
if (item->type() != FUNC_ITEM)
|
|
return 0;
|
|
Item_func *item_func=(Item_func*) item;
|
|
if (arg_count != item_func->arg_count ||
|
|
functype() != item_func->functype())
|
|
return 0;
|
|
Item_func_set_collation *item_func_sc=(Item_func_set_collation*) item;
|
|
if (collation.collation != item_func_sc->collation.collation)
|
|
return 0;
|
|
for (uint i=0; i < arg_count ; i++)
|
|
if (!args[i]->eq(item_func_sc->args[i], binary_cmp))
|
|
return 0;
|
|
return 1;
|
|
}
|
|
|
|
|
|
void Item_func_set_collation::print(String *str)
|
|
{
|
|
str->append('(');
|
|
args[0]->print(str);
|
|
str->append(STRING_WITH_LEN(" collate "));
|
|
DBUG_ASSERT(args[1]->basic_const_item() &&
|
|
args[1]->type() == Item::STRING_ITEM);
|
|
args[1]->str_value.print(str);
|
|
str->append(')');
|
|
}
|
|
|
|
String *Item_func_charset::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
uint dummy_errors;
|
|
|
|
CHARSET_INFO *cs= args[0]->collation.collation;
|
|
null_value= 0;
|
|
str->copy(cs->csname, strlen(cs->csname),
|
|
&my_charset_latin1, collation.collation, &dummy_errors);
|
|
return str;
|
|
}
|
|
|
|
String *Item_func_collation::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
uint dummy_errors;
|
|
CHARSET_INFO *cs= args[0]->collation.collation;
|
|
|
|
null_value= 0;
|
|
str->copy(cs->name, strlen(cs->name),
|
|
&my_charset_latin1, collation.collation, &dummy_errors);
|
|
return str;
|
|
}
|
|
|
|
|
|
String *Item_func_hex::val_str(String *str)
|
|
{
|
|
String *res;
|
|
DBUG_ASSERT(fixed == 1);
|
|
if (args[0]->result_type() != STRING_RESULT)
|
|
{
|
|
ulonglong dec;
|
|
char ans[65],*ptr;
|
|
/* Return hex of unsigned longlong value */
|
|
if (args[0]->result_type() == REAL_RESULT ||
|
|
args[0]->result_type() == DECIMAL_RESULT)
|
|
{
|
|
double val= args[0]->val_real();
|
|
if ((val <= (double) LONGLONG_MIN) ||
|
|
(val >= (double) (ulonglong) ULONGLONG_MAX))
|
|
dec= ~(longlong) 0;
|
|
else
|
|
dec= (ulonglong) (val + (val > 0 ? 0.5 : -0.5));
|
|
}
|
|
else
|
|
dec= (ulonglong) args[0]->val_int();
|
|
|
|
if ((null_value= args[0]->null_value))
|
|
return 0;
|
|
ptr= longlong2str(dec,ans,16);
|
|
if (str->copy(ans,(uint32) (ptr-ans),default_charset()))
|
|
return &my_empty_string; // End of memory
|
|
return str;
|
|
}
|
|
|
|
/* Convert given string to a hex string, character by character */
|
|
res= args[0]->val_str(str);
|
|
if (!res || tmp_value.alloc(res->length()*2+1))
|
|
{
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
null_value=0;
|
|
tmp_value.length(res->length()*2);
|
|
|
|
octet2hex((char*) tmp_value.ptr(), res->ptr(), res->length());
|
|
return &tmp_value;
|
|
}
|
|
|
|
/* Convert given hex string to a binary string */
|
|
|
|
String *Item_func_unhex::val_str(String *str)
|
|
{
|
|
const char *from, *end;
|
|
char *to;
|
|
String *res;
|
|
uint length;
|
|
DBUG_ASSERT(fixed == 1);
|
|
|
|
res= args[0]->val_str(str);
|
|
if (!res || tmp_value.alloc(length= (1+res->length())/2))
|
|
{
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
|
|
from= res->ptr();
|
|
null_value= 0;
|
|
tmp_value.length(length);
|
|
to= (char*) tmp_value.ptr();
|
|
if (res->length() % 2)
|
|
{
|
|
int hex_char;
|
|
*to++= hex_char= hexchar_to_int(*from++);
|
|
if ((null_value= (hex_char == -1)))
|
|
return 0;
|
|
}
|
|
for (end=res->ptr()+res->length(); from < end ; from+=2, to++)
|
|
{
|
|
int hex_char;
|
|
*to= (hex_char= hexchar_to_int(from[0])) << 4;
|
|
if ((null_value= (hex_char == -1)))
|
|
return 0;
|
|
*to|= hex_char= hexchar_to_int(from[1]);
|
|
if ((null_value= (hex_char == -1)))
|
|
return 0;
|
|
}
|
|
return &tmp_value;
|
|
}
|
|
|
|
|
|
void Item_func_binary::print(String *str)
|
|
{
|
|
str->append(STRING_WITH_LEN("cast("));
|
|
args[0]->print(str);
|
|
str->append(STRING_WITH_LEN(" as binary)"));
|
|
}
|
|
|
|
|
|
#include <my_dir.h> // For my_stat
|
|
|
|
String *Item_load_file::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *file_name;
|
|
File file;
|
|
MY_STAT stat_info;
|
|
char path[FN_REFLEN];
|
|
DBUG_ENTER("load_file");
|
|
|
|
if (!(file_name= args[0]->val_str(str))
|
|
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
|
|| !(current_thd->security_ctx->master_access & FILE_ACL)
|
|
#endif
|
|
)
|
|
goto err;
|
|
|
|
(void) fn_format(path, file_name->c_ptr(), mysql_real_data_home, "",
|
|
MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
|
|
|
|
if (!my_stat(path, &stat_info, MYF(0)))
|
|
goto err;
|
|
|
|
if (!(stat_info.st_mode & S_IROTH))
|
|
{
|
|
/* my_error(ER_TEXTFILE_NOT_READABLE, MYF(0), file_name->c_ptr()); */
|
|
goto err;
|
|
}
|
|
if (stat_info.st_size > (long) current_thd->variables.max_allowed_packet)
|
|
{
|
|
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
|
|
ER_WARN_ALLOWED_PACKET_OVERFLOWED,
|
|
ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
|
|
func_name(), current_thd->variables.max_allowed_packet);
|
|
goto err;
|
|
}
|
|
if (tmp_value.alloc(stat_info.st_size))
|
|
goto err;
|
|
if ((file = my_open(file_name->c_ptr(), O_RDONLY, MYF(0))) < 0)
|
|
goto err;
|
|
if (my_read(file, (byte*) tmp_value.ptr(), stat_info.st_size, MYF(MY_NABP)))
|
|
{
|
|
my_close(file, MYF(0));
|
|
goto err;
|
|
}
|
|
tmp_value.length(stat_info.st_size);
|
|
my_close(file, MYF(0));
|
|
null_value = 0;
|
|
DBUG_RETURN(&tmp_value);
|
|
|
|
err:
|
|
null_value = 1;
|
|
DBUG_RETURN(0);
|
|
}
|
|
|
|
|
|
String* Item_func_export_set::val_str(String* str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
ulonglong the_set = (ulonglong) args[0]->val_int();
|
|
String yes_buf, *yes;
|
|
yes = args[1]->val_str(&yes_buf);
|
|
String no_buf, *no;
|
|
no = args[2]->val_str(&no_buf);
|
|
String *sep = NULL, sep_buf ;
|
|
|
|
uint num_set_values = 64;
|
|
ulonglong mask = 0x1;
|
|
str->length(0);
|
|
str->set_charset(collation.collation);
|
|
|
|
/* Check if some argument is a NULL value */
|
|
if (args[0]->null_value || args[1]->null_value || args[2]->null_value)
|
|
{
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
/*
|
|
Arg count can only be 3, 4 or 5 here. This is guaranteed from the
|
|
grammar for EXPORT_SET()
|
|
*/
|
|
switch(arg_count) {
|
|
case 5:
|
|
num_set_values = (uint) args[4]->val_int();
|
|
if (num_set_values > 64)
|
|
num_set_values=64;
|
|
if (args[4]->null_value)
|
|
{
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
/* Fall through */
|
|
case 4:
|
|
if (!(sep = args[3]->val_str(&sep_buf))) // Only true if NULL
|
|
{
|
|
null_value=1;
|
|
return 0;
|
|
}
|
|
break;
|
|
case 3:
|
|
{
|
|
/* errors is not checked - assume "," can always be converted */
|
|
uint errors;
|
|
sep_buf.copy(STRING_WITH_LEN(","), &my_charset_bin, collation.collation, &errors);
|
|
sep = &sep_buf;
|
|
}
|
|
break;
|
|
default:
|
|
DBUG_ASSERT(0); // cannot happen
|
|
}
|
|
null_value=0;
|
|
|
|
for (uint i = 0; i < num_set_values; i++, mask = (mask << 1))
|
|
{
|
|
if (the_set & mask)
|
|
str->append(*yes);
|
|
else
|
|
str->append(*no);
|
|
if (i != num_set_values - 1)
|
|
str->append(*sep);
|
|
}
|
|
return str;
|
|
}
|
|
|
|
void Item_func_export_set::fix_length_and_dec()
|
|
{
|
|
uint length=max(args[1]->max_length,args[2]->max_length);
|
|
uint sep_length=(arg_count > 3 ? args[3]->max_length : 1);
|
|
max_length=length*64+sep_length*63;
|
|
|
|
if (agg_arg_charsets(collation, args+1, min(4,arg_count)-1,
|
|
MY_COLL_ALLOW_CONV, 1))
|
|
return;
|
|
}
|
|
|
|
String* Item_func_inet_ntoa::val_str(String* str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
uchar buf[8], *p;
|
|
ulonglong n = (ulonglong) args[0]->val_int();
|
|
char num[4];
|
|
|
|
/*
|
|
We do not know if args[0] is NULL until we have called
|
|
some val function on it if args[0] is not a constant!
|
|
|
|
Also return null if n > 255.255.255.255
|
|
*/
|
|
if ((null_value= (args[0]->null_value || n > (ulonglong) LL(4294967295))))
|
|
return 0; // Null value
|
|
|
|
str->length(0);
|
|
int4store(buf,n);
|
|
|
|
/* Now we can assume little endian. */
|
|
|
|
num[3]='.';
|
|
for (p=buf+4 ; p-- > buf ; )
|
|
{
|
|
uint c = *p;
|
|
uint n1,n2; // Try to avoid divisions
|
|
n1= c / 100; // 100 digits
|
|
c-= n1*100;
|
|
n2= c / 10; // 10 digits
|
|
c-=n2*10; // last digit
|
|
num[0]=(char) n1+'0';
|
|
num[1]=(char) n2+'0';
|
|
num[2]=(char) c+'0';
|
|
uint length=(n1 ? 4 : n2 ? 3 : 2); // Remove pre-zero
|
|
|
|
(void) str->append(num+4-length,length);
|
|
}
|
|
str->length(str->length()-1); // Remove last '.';
|
|
return str;
|
|
}
|
|
|
|
|
|
/*
|
|
QUOTE() function returns argument string in single quotes suitable for
|
|
using in a SQL statement.
|
|
|
|
DESCRIPTION
|
|
Adds a \ before all characters that needs to be escaped in a SQL string.
|
|
We also escape '^Z' (END-OF-FILE in windows) to avoid probelms when
|
|
running commands from a file in windows.
|
|
|
|
This function is very useful when you want to generate SQL statements
|
|
|
|
NOTE
|
|
QUOTE(NULL) returns the string 'NULL' (4 letters, without quotes).
|
|
|
|
RETURN VALUES
|
|
str Quoted string
|
|
NULL Out of memory.
|
|
*/
|
|
|
|
#define get_esc_bit(mask, num) (1 & (*((mask) + ((num) >> 3))) >> ((num) & 7))
|
|
|
|
String *Item_func_quote::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
/*
|
|
Bit mask that has 1 for set for the position of the following characters:
|
|
0, \, ' and ^Z
|
|
*/
|
|
|
|
static uchar escmask[32]=
|
|
{
|
|
0x01, 0x00, 0x00, 0x04, 0x80, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
|
};
|
|
|
|
char *from, *to, *end, *start;
|
|
String *arg= args[0]->val_str(str);
|
|
uint arg_length, new_length;
|
|
if (!arg) // Null argument
|
|
{
|
|
/* Return the string 'NULL' */
|
|
str->copy(STRING_WITH_LEN("NULL"), collation.collation);
|
|
null_value= 0;
|
|
return str;
|
|
}
|
|
|
|
arg_length= arg->length();
|
|
new_length= arg_length+2; /* for beginning and ending ' signs */
|
|
|
|
for (from= (char*) arg->ptr(), end= from + arg_length; from < end; from++)
|
|
new_length+= get_esc_bit(escmask, (uchar) *from);
|
|
|
|
if (tmp_value.alloc(new_length))
|
|
goto null;
|
|
|
|
/*
|
|
We replace characters from the end to the beginning
|
|
*/
|
|
to= (char*) tmp_value.ptr() + new_length - 1;
|
|
*to--= '\'';
|
|
for (start= (char*) arg->ptr(),end= start + arg_length; end-- != start; to--)
|
|
{
|
|
/*
|
|
We can't use the bitmask here as we want to replace \O and ^Z with 0
|
|
and Z
|
|
*/
|
|
switch (*end) {
|
|
case 0:
|
|
*to--= '0';
|
|
*to= '\\';
|
|
break;
|
|
case '\032':
|
|
*to--= 'Z';
|
|
*to= '\\';
|
|
break;
|
|
case '\'':
|
|
case '\\':
|
|
*to--= *end;
|
|
*to= '\\';
|
|
break;
|
|
default:
|
|
*to= *end;
|
|
break;
|
|
}
|
|
}
|
|
*to= '\'';
|
|
tmp_value.length(new_length);
|
|
tmp_value.set_charset(collation.collation);
|
|
null_value= 0;
|
|
return &tmp_value;
|
|
|
|
null:
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
|
|
longlong Item_func_uncompressed_length::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res= args[0]->val_str(&value);
|
|
if (!res)
|
|
{
|
|
null_value=1;
|
|
return 0; /* purecov: inspected */
|
|
}
|
|
null_value=0;
|
|
if (res->is_empty()) return 0;
|
|
|
|
/*
|
|
res->ptr() using is safe because we have tested that string is not empty,
|
|
res->c_ptr() is not used because:
|
|
- we do not need \0 terminated string to get first 4 bytes
|
|
- c_ptr() tests simbol after string end (uninitialiozed memory) which
|
|
confuse valgrind
|
|
*/
|
|
return uint4korr(res->ptr()) & 0x3FFFFFFF;
|
|
}
|
|
|
|
longlong Item_func_crc32::val_int()
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res=args[0]->val_str(&value);
|
|
if (!res)
|
|
{
|
|
null_value=1;
|
|
return 0; /* purecov: inspected */
|
|
}
|
|
null_value=0;
|
|
return (longlong) crc32(0L, (uchar*)res->ptr(), res->length());
|
|
}
|
|
|
|
#ifdef HAVE_COMPRESS
|
|
#include "zlib.h"
|
|
|
|
String *Item_func_compress::val_str(String *str)
|
|
{
|
|
int err= Z_OK, code;
|
|
ulong new_size;
|
|
String *res;
|
|
Byte *body;
|
|
char *tmp, *last_char;
|
|
DBUG_ASSERT(fixed == 1);
|
|
|
|
if (!(res= args[0]->val_str(str)))
|
|
{
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
null_value= 0;
|
|
if (res->is_empty()) return res;
|
|
|
|
/*
|
|
Citation from zlib.h (comment for compress function):
|
|
|
|
Compresses the source buffer into the destination buffer. sourceLen is
|
|
the byte length of the source buffer. Upon entry, destLen is the total
|
|
size of the destination buffer, which must be at least 0.1% larger than
|
|
sourceLen plus 12 bytes.
|
|
We assume here that the buffer can't grow more than .25 %.
|
|
*/
|
|
new_size= res->length() + res->length() / 5 + 12;
|
|
|
|
// Check new_size overflow: new_size <= res->length()
|
|
if (((uint32) (new_size+5) <= res->length()) ||
|
|
buffer.realloc((uint32) new_size + 4 + 1))
|
|
{
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
|
|
body= ((Byte*)buffer.ptr()) + 4;
|
|
|
|
// As far as we have checked res->is_empty() we can use ptr()
|
|
if ((err= compress(body, &new_size,
|
|
(const Bytef*)res->ptr(), res->length())) != Z_OK)
|
|
{
|
|
code= err==Z_MEM_ERROR ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_BUF_ERROR;
|
|
push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,code,ER(code));
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
|
|
tmp= (char*)buffer.ptr(); // int4store is a macro; avoid side effects
|
|
int4store(tmp, res->length() & 0x3FFFFFFF);
|
|
|
|
/* This is to ensure that things works for CHAR fields, which trim ' ': */
|
|
last_char= ((char*)body)+new_size-1;
|
|
if (*last_char == ' ')
|
|
{
|
|
*++last_char= '.';
|
|
new_size++;
|
|
}
|
|
|
|
buffer.length((uint32)new_size + 4);
|
|
return &buffer;
|
|
}
|
|
|
|
|
|
String *Item_func_uncompress::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
String *res= args[0]->val_str(str);
|
|
ulong new_size;
|
|
int err;
|
|
uint code;
|
|
|
|
if (!res)
|
|
goto err;
|
|
null_value= 0;
|
|
if (res->is_empty())
|
|
return res;
|
|
|
|
/* If length is less than 4 bytes, data is corrupt */
|
|
if (res->length() <= 4)
|
|
{
|
|
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
|
|
ER_ZLIB_Z_DATA_ERROR,
|
|
ER(ER_ZLIB_Z_DATA_ERROR));
|
|
goto err;
|
|
}
|
|
|
|
/* Size of uncompressed data is stored as first 4 bytes of field */
|
|
new_size= uint4korr(res->ptr()) & 0x3FFFFFFF;
|
|
if (new_size > current_thd->variables.max_allowed_packet)
|
|
{
|
|
push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,
|
|
ER_TOO_BIG_FOR_UNCOMPRESS,
|
|
ER(ER_TOO_BIG_FOR_UNCOMPRESS),
|
|
current_thd->variables.max_allowed_packet);
|
|
goto err;
|
|
}
|
|
if (buffer.realloc((uint32)new_size))
|
|
goto err;
|
|
|
|
if ((err= uncompress((Byte*)buffer.ptr(), &new_size,
|
|
((const Bytef*)res->ptr())+4,res->length())) == Z_OK)
|
|
{
|
|
buffer.length((uint32) new_size);
|
|
return &buffer;
|
|
}
|
|
|
|
code= ((err == Z_BUF_ERROR) ? ER_ZLIB_Z_BUF_ERROR :
|
|
((err == Z_MEM_ERROR) ? ER_ZLIB_Z_MEM_ERROR : ER_ZLIB_Z_DATA_ERROR));
|
|
push_warning(current_thd,MYSQL_ERROR::WARN_LEVEL_ERROR,code,ER(code));
|
|
|
|
err:
|
|
null_value= 1;
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
|
/*
|
|
UUID, as in
|
|
DCE 1.1: Remote Procedure Call,
|
|
Open Group Technical Standard Document Number C706, October 1997,
|
|
(supersedes C309 DCE: Remote Procedure Call 8/1994,
|
|
which was basis for ISO/IEC 11578:1996 specification)
|
|
*/
|
|
|
|
static struct rand_struct uuid_rand;
|
|
static uint nanoseq;
|
|
static ulonglong uuid_time=0;
|
|
static char clock_seq_and_node_str[]="-0000-000000000000";
|
|
|
|
/* number of 100-nanosecond intervals between
|
|
1582-10-15 00:00:00.00 and 1970-01-01 00:00:00.00 */
|
|
#define UUID_TIME_OFFSET ((ulonglong) 141427 * 24 * 60 * 60 * 1000 * 10 )
|
|
|
|
#define UUID_VERSION 0x1000
|
|
#define UUID_VARIANT 0x8000
|
|
|
|
static void tohex(char *to, uint from, uint len)
|
|
{
|
|
to+= len;
|
|
while (len--)
|
|
{
|
|
*--to= _dig_vec_lower[from & 15];
|
|
from >>= 4;
|
|
}
|
|
}
|
|
|
|
static void set_clock_seq_str()
|
|
{
|
|
uint16 clock_seq= ((uint)(my_rnd(&uuid_rand)*16383)) | UUID_VARIANT;
|
|
tohex(clock_seq_and_node_str+1, clock_seq, 4);
|
|
nanoseq= 0;
|
|
}
|
|
|
|
String *Item_func_uuid::val_str(String *str)
|
|
{
|
|
DBUG_ASSERT(fixed == 1);
|
|
char *s;
|
|
THD *thd= current_thd;
|
|
|
|
pthread_mutex_lock(&LOCK_uuid_generator);
|
|
if (! uuid_time) /* first UUID() call. initializing data */
|
|
{
|
|
ulong tmp=sql_rnd_with_mutex();
|
|
uchar mac[6];
|
|
int i;
|
|
if (my_gethwaddr(mac))
|
|
{
|
|
/*
|
|
generating random "hardware addr"
|
|
and because specs explicitly specify that it should NOT correlate
|
|
with a clock_seq value (initialized random below), we use a separate
|
|
randominit() here
|
|
*/
|
|
randominit(&uuid_rand, tmp + (ulong) thd, tmp + (ulong)query_id);
|
|
for (i=0; i < (int)sizeof(mac); i++)
|
|
mac[i]=(uchar)(my_rnd(&uuid_rand)*255);
|
|
}
|
|
s=clock_seq_and_node_str+sizeof(clock_seq_and_node_str)-1;
|
|
for (i=sizeof(mac)-1 ; i>=0 ; i--)
|
|
{
|
|
*--s=_dig_vec_lower[mac[i] & 15];
|
|
*--s=_dig_vec_lower[mac[i] >> 4];
|
|
}
|
|
randominit(&uuid_rand, tmp + (ulong)start_time,
|
|
tmp + thd->status_var.bytes_sent);
|
|
set_clock_seq_str();
|
|
}
|
|
|
|
ulonglong tv=my_getsystime() + UUID_TIME_OFFSET + nanoseq;
|
|
if (unlikely(tv < uuid_time))
|
|
set_clock_seq_str();
|
|
else if (unlikely(tv == uuid_time))
|
|
{
|
|
/* special protection from low-res system clocks */
|
|
nanoseq++;
|
|
tv++;
|
|
}
|
|
else
|
|
{
|
|
if (nanoseq)
|
|
{
|
|
tv-=nanoseq;
|
|
nanoseq=0;
|
|
}
|
|
DBUG_ASSERT(tv > uuid_time);
|
|
}
|
|
uuid_time=tv;
|
|
pthread_mutex_unlock(&LOCK_uuid_generator);
|
|
|
|
uint32 time_low= (uint32) (tv & 0xFFFFFFFF);
|
|
uint16 time_mid= (uint16) ((tv >> 32) & 0xFFFF);
|
|
uint16 time_hi_and_version= (uint16) ((tv >> 48) | UUID_VERSION);
|
|
|
|
str->realloc(UUID_LENGTH+1);
|
|
str->length(UUID_LENGTH);
|
|
str->set_charset(system_charset_info);
|
|
s=(char *) str->ptr();
|
|
s[8]=s[13]='-';
|
|
tohex(s, time_low, 8);
|
|
tohex(s+9, time_mid, 4);
|
|
tohex(s+14, time_hi_and_version, 4);
|
|
strmov(s+18, clock_seq_and_node_str);
|
|
return str;
|
|
}
|