From 2f07bb2593ba447c46d215ea0a6bb0209bfe21ee Mon Sep 17 00:00:00 2001 From: xiaoguang ye Date: Fri, 5 Aug 2022 09:26:22 +0000 Subject: [PATCH] # This is a combination of 8 commits. # This is the 1st commit message: rich doc to fix env dependence "not found" (#316) # This is the commit message #2: fix(mtr): make the mtr passed (#315) (#317) [summary] How to run: ./mysql-test-run.pl --suite=stonedb --nowarnings --force --nocheck-testcases 1. test cases below are failed, we ignored them first: issue410 issue415 issue433 issue446 issue515 load.test 2. Sys variables next are not set correctly, they should be added to `/mysql-test/include/default_mysqld.cnf`. stonedb_insert_delayed = 0 stonedb_ini_allowmysqlquerypath=1 3.check-testcases: A new MTR option to enforce strict cleanup: https://dev.mysql.com/blog-archive/fail-check-testcases-a-new-mtr-option-to-enforce-strict-cleanup In `mtr` comment: ``` Some options that control enabling a feature for normal test runs, can be turned off by prepending 'no' to the option, e.g. --notimer. This applies to reorder, timer, check-testcases and warnings. ``` Currently we turn off it first to make mtr run success. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> # This is the commit message #3: feat(stonedb): update the copyright date time (#321) (#324) # This is the commit message #4: fix(core): fix crash when executing sql. (#327) (#328) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> # This is the commit message #5: feat(index): Unified class member variable name with google style (#311) (#312) [summary] Class member name will be like: class TableInfo { ... private: std::string table_name_; // OK - underscore at end. static Pool* pool_; // OK. }; Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> # This is the commit message #6: fix(mtr):move character_set to test.character_set, fix main mtr_test and innodb mtr_test(#277) (#335) * fix(mtr):fix innodb mtr and mv some test to test/innodb * fix(mtr):move character_set to test/main/ fix(mtr):mv main mtr character_set test to test/main/cahracter_set fix(mtr):mv myisam error mtr-test to test/main/myisam fix(mtr):add optimizer_switch to include/default_mysqld.cnf * fix(mtr):fix main mtr optimizer_switch amd mv some test to test/main Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> # This is the commit message #7: feat(tianmu): stonedb namespace to tianmu (#337) [summary] 1. Change all engine stonedb to tianmu 2. Change SDB to tianmu 3. Also include mysql-test 4. Change file magic number to TianmuTB # This is the commit message #8: fix bugs of #309 and #310 (#313) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .github/workflows/integration-compile-mtr.yml | 2 +- .mergify.yml | 2 +- CMakeLists.txt | 2 +- client/mysql.cc | 4 +- client/mysqladmin.cc | 4 +- client/mysqlbinlog.cc | 2 +- client/mysqldump.c | 4 +- client/mysqlimport.c | 4 +- client/mysqlshow.c | 4 +- client/mysqltest.cc | 2 +- include/my_global.h | 2 +- install_scripts/my.cnf | 2 +- libmysqld/lib_sql.cc | 2 +- libmysqld/libmysqld.c | 2 +- mysql-test/include/default_mysqld.cnf | 4 +- .../std_data/{stonedb => tianmu}/bigdata4load | 0 .../{stonedb => tianmu}/column_type_test.frm | Bin .../column_type_test.tm}/TA00000.ctb | Bin .../column_type_test.tm}/TA00000000000000.ctb | Bin .../column_type_test.tm}/TA00000000000001.ctb | Bin .../column_type_test.tm}/TA00000DPN.ctb | Bin .../column_type_test.tm}/TA00001.ctb | Bin .../column_type_test.tm}/TA00001000000000.ctb | Bin .../column_type_test.tm}/TA00001000000001.ctb | Bin .../column_type_test.tm}/TA00001DPN.ctb | Bin .../column_type_test.tm}/TA00002.ctb | Bin .../column_type_test.tm}/TA00002000000000.ctb | Bin .../column_type_test.tm}/TA00002000000001.ctb | Bin .../column_type_test.tm}/TA00002DPN.ctb | Bin .../column_type_test.tm}/TA00003.ctb | Bin .../column_type_test.tm}/TA00003000000000.ctb | Bin .../column_type_test.tm}/TA00003000000001.ctb | Bin .../column_type_test.tm}/TA00003DPN.ctb | Bin .../column_type_test.tm}/TA00004.ctb | Bin .../column_type_test.tm}/TA00004000000000.ctb | Bin .../column_type_test.tm}/TA00004000000001.ctb | Bin .../column_type_test.tm}/TA00004DPN.ctb | Bin .../column_type_test.tm}/TA00005.ctb | Bin .../column_type_test.tm}/TA00005DPN.ctb | Bin .../column_type_test.tm}/TA00006.ctb | Bin .../column_type_test.tm}/TA00006DPN.ctb | Bin .../column_type_test.tm}/TA00007.ctb | Bin .../column_type_test.tm}/TA00007000000000.ctb | Bin .../column_type_test.tm}/TA00007000000001.ctb | Bin .../column_type_test.tm}/TA00007DPN.ctb | Bin .../column_type_test.tm}/TA00008.ctb | Bin .../column_type_test.tm}/TA00008DPN.ctb | Bin .../column_type_test.tm}/TA00009.ctb | Bin .../column_type_test.tm}/TA00009DPN.ctb | Bin .../column_type_test.tm}/TA00010.ctb | Bin .../column_type_test.tm}/TA00010000000000.ctb | Bin .../column_type_test.tm}/TA00010000000001.ctb | Bin .../column_type_test.tm}/TA00010DPN.ctb | Bin .../column_type_test.tm}/TA00011.ctb | Bin .../column_type_test.tm}/TA00011DPN.ctb | Bin .../column_type_test.tm}/TA00012.ctb | Bin .../column_type_test.tm}/TA00012000000000.ctb | Bin .../column_type_test.tm}/TA00012000000001.ctb | Bin .../column_type_test.tm}/TA00012DPN.ctb | Bin .../column_type_test.tm}/TA00013.ctb | Bin .../column_type_test.tm}/TA00013000000000.ctb | Bin .../column_type_test.tm}/TA00013000000001.ctb | Bin .../column_type_test.tm}/TA00013DPN.ctb | Bin .../column_type_test.tm}/TA00014.ctb | Bin .../column_type_test.tm}/TA00014DPN.ctb | Bin .../column_type_test.tm}/TA00015.ctb | Bin .../column_type_test.tm}/TA00015000000000.ctb | Bin .../column_type_test.tm}/TA00015000000001.ctb | Bin .../column_type_test.tm}/TA00015DPN.ctb | Bin .../column_type_test.tm}/TA00016.ctb | Bin .../column_type_test.tm}/TA00016DPN.ctb | Bin .../column_type_test.tm}/TB00000.ctb | Bin .../column_type_test.tm}/TB00001.ctb | Bin .../column_type_test.tm}/TB00002.ctb | Bin .../column_type_test.tm}/TB00003.ctb | Bin .../column_type_test.tm}/TB00004.ctb | Bin .../column_type_test.tm}/TB00005.ctb | Bin .../column_type_test.tm}/TB00006.ctb | Bin .../column_type_test.tm}/TB00007.ctb | Bin .../column_type_test.tm}/TB00008.ctb | Bin .../column_type_test.tm}/TB00009.ctb | Bin .../column_type_test.tm}/TB00010.ctb | Bin .../column_type_test.tm}/TB00011.ctb | Bin .../column_type_test.tm}/TB00012.ctb | Bin .../column_type_test.tm}/TB00013.ctb | Bin .../column_type_test.tm}/TB00014.ctb | Bin .../column_type_test.tm}/TB00015.ctb | Bin .../column_type_test.tm}/TB00016.ctb | Bin .../column_type_test.tm}/Table.ctb | Bin .../std_data/{stonedb => tianmu}/loadfile | 0 mysql-test/suite/stonedb/r/issue410.result | 8 - .../suite/stonedb_upgrade/t/upgrade.test | 290 +++++------ .../t/upgrade_add_coloumn.test | 290 +++++------ .../t/upgrade_drop_coloumn.test | 290 +++++------ .../stonedb_upgrade/t/upgrade_insert.test | 290 +++++------ .../suite/stonedb_upgrade/t/upgrade_load.test | 290 +++++------ .../{stonedb => tianmu}/r/add_column.result | 6 +- .../{stonedb => tianmu}/r/casewhen.result | 2 +- .../suite/{stonedb => tianmu}/r/concat.result | 2 +- .../{stonedb => tianmu}/r/drop_column.result | 4 +- .../{stonedb => tianmu}/r/group_concat.result | 2 +- .../r/group_concat2.result | 2 +- .../suite/{stonedb => tianmu}/r/insert.result | 2 +- .../{stonedb => tianmu}/r/issue405.result | 2 +- mysql-test/suite/tianmu/r/issue410.result | 8 + .../{stonedb => tianmu}/r/issue415.result | 2 +- .../{stonedb => tianmu}/r/issue417.result | 2 +- .../{stonedb => tianmu}/r/issue429.result | 2 +- .../{stonedb => tianmu}/r/issue430.result | 2 +- .../{stonedb => tianmu}/r/issue431.result | 2 +- .../{stonedb => tianmu}/r/issue433.result | 2 +- .../{stonedb => tianmu}/r/issue446.result | 4 +- .../{stonedb => tianmu}/r/issue464.result | 2 +- .../{stonedb => tianmu}/r/issue467.result | 2 +- .../{stonedb => tianmu}/r/issue468.result | 2 +- .../{stonedb => tianmu}/r/issue469.result | 2 +- .../{stonedb => tianmu}/r/issue475.result | 2 +- .../{stonedb => tianmu}/r/issue496.result | 2 +- .../{stonedb => tianmu}/r/issue502.result | 2 +- .../{stonedb => tianmu}/r/issue515.result | 2 +- .../suite/{stonedb => tianmu}/r/load.result | 8 +- .../suite/{stonedb => tianmu}/r/lz4.result | 2 +- .../{stonedb => tianmu}/r/orquery.result | 2 +- .../{stonedb => tianmu}/r/orquery1.result | 2 +- .../{stonedb => tianmu}/r/truncate.result | 6 +- .../{stonedb => tianmu}/t/add_column.test | 4 +- .../suite/{stonedb => tianmu}/t/casewhen.test | 2 +- .../suite/{stonedb => tianmu}/t/concat.test | 2 +- .../suite/{stonedb => tianmu}/t/disabled.def | 0 .../{stonedb => tianmu}/t/drop_column.test | 2 +- .../{stonedb => tianmu}/t/group_concat.test | 2 +- .../{stonedb => tianmu}/t/group_concat2.test | 2 +- .../suite/{stonedb => tianmu}/t/insert.test | 2 +- .../suite/{stonedb => tianmu}/t/issue405.test | 2 +- .../{stonedb => tianmu}/t/issue410.testbak | 2 +- .../{stonedb => tianmu}/t/issue415.testbak | 2 +- .../suite/{stonedb => tianmu}/t/issue417.test | 2 +- .../suite/{stonedb => tianmu}/t/issue429.test | 2 +- .../suite/{stonedb => tianmu}/t/issue430.test | 2 +- .../suite/{stonedb => tianmu}/t/issue431.test | 2 +- .../{stonedb => tianmu}/t/issue433.testbak | 2 +- .../{stonedb => tianmu}/t/issue446.testbak | 2 +- .../suite/{stonedb => tianmu}/t/issue464.test | 2 +- .../suite/{stonedb => tianmu}/t/issue467.test | 2 +- .../suite/{stonedb => tianmu}/t/issue468.test | 2 +- .../suite/{stonedb => tianmu}/t/issue469.test | 2 +- .../suite/{stonedb => tianmu}/t/issue475.test | 2 +- .../suite/{stonedb => tianmu}/t/issue496.test | 2 +- .../suite/{stonedb => tianmu}/t/issue502.test | 2 +- .../{stonedb => tianmu}/t/issue515.testbak | 2 +- .../suite/{stonedb => tianmu}/t/load.testbak | 6 +- .../suite/{stonedb => tianmu}/t/lz4.test | 2 +- .../suite/{stonedb => tianmu}/t/orquery.test | 2 +- .../suite/{stonedb => tianmu}/t/orquery1.test | 2 +- .../suite/{stonedb => tianmu}/t/truncate.test | 4 +- scripts/mysql_system_tables.sql | 20 +- scripts/mysql_system_tables_data.sql | 78 +-- sql-common/client.c | 4 +- sql/binlog.cc | 2 +- sql/handler.cc | 4 +- sql/handler.h | 8 +- sql/item_cmpfunc.cc | 2 +- sql/item_create.cc | 6 +- sql/item_func.cc | 2 +- sql/item_func.h | 4 +- sql/item_sum.cc | 2 +- sql/item_sum.h | 4 +- sql/log.cc | 4 +- sql/mysqld.cc | 42 +- sql/mysqld.h | 8 +- sql/opt_explain.cc | 4 +- sql/plistsort.c | 4 +- sql/records.cc | 6 +- sql/sql_cache.cc | 2 +- sql/sql_class.cc | 2 +- sql/sql_class.h | 12 +- sql/sql_const.h | 2 +- sql/sql_error.cc | 2 +- sql/sql_insert.cc | 8 +- sql/sql_lex.cc | 4 +- sql/sql_lex.h | 12 +- sql/sql_load.cc | 8 +- sql/sql_optimizer.cc | 26 +- sql/sql_optimizer.h | 8 +- sql/sql_parse.cc | 12 +- sql/sql_select.cc | 2 +- sql/sql_show.cc | 6 +- sql/sql_table.cc | 6 +- sql/sql_tmp_table.cc | 2 +- sql/sql_union.cc | 2 +- sql/sql_yacc.yy | 4 +- sql/stonedb.h | 8 - sql/sys_vars.cc | 12 +- sql/sys_vars.h | 2 +- sql/table.cc | 8 +- sql/tianmu.h | 8 + sql/tztime.cc | 4 +- storage/heap/ha_heap.h | 2 +- storage/myisam/myisamchk.c | 10 +- storage/myisam/myisampack.c | 10 +- storage/perfschema/pfs_defaults.cc | 24 +- storage/stonedb/system/configuration.cpp | 83 ---- storage/stonedb/system/configuration.h | 102 ---- storage/{stonedb => tianmu}/.clang-format | 0 storage/{stonedb => tianmu}/CMakeLists.txt | 36 +- .../async_tests/CMakeLists.txt | 14 +- .../{stonedb => tianmu}/async_tests/main.cc | 94 ++-- .../async_tests/task_executor.cpp | 8 +- .../async_tests}/task_executor.h | 12 +- storage/{stonedb => tianmu}/base/core/align.h | 10 +- .../base/core/aligned_buffer.h | 10 +- .../base/core/app_template.cpp | 4 +- .../base/core/app_template.h | 10 +- storage/{stonedb => tianmu}/base/core/apply.h | 10 +- .../{stonedb => tianmu}/base/core/array_map.h | 10 +- .../{stonedb => tianmu}/base/core/bitops.h | 10 +- .../base/core/bitset_iter.h | 10 +- .../{stonedb => tianmu}/base/core/byteorder.h | 10 +- .../{stonedb => tianmu}/base/core/cacheline.h | 10 +- .../base/core/checked_ptr.h | 12 +- .../base/core/chunked_fifo.h | 10 +- .../base/core/circular_buffer.h | 10 +- .../core/circular_buffer_fixed_capacity.h | 10 +- .../base/core/condition_variable.h | 10 +- .../{stonedb => tianmu}/base/core/deleter.h | 10 +- .../base/core/distributed.h | 10 +- .../{stonedb => tianmu}/base/core/do_with.h | 10 +- storage/{stonedb => tianmu}/base/core/enum.h | 10 +- .../base/core/exception_hacks.cpp | 10 +- .../base/core/exception_hacks.h | 10 +- .../base/core/execution_stage.h | 10 +- .../base/core/expiring_fifo.h | 10 +- .../base/core/fair_queue.h | 10 +- storage/{stonedb => tianmu}/base/core/file.h | 10 +- .../{stonedb => tianmu}/base/core/file_impl.h | 10 +- .../{stonedb => tianmu}/base/core/fsqual.cpp | 4 +- .../{stonedb => tianmu}/base/core/fsqual.h | 10 +- .../{stonedb => tianmu}/base/core/fstream.cpp | 4 +- .../{stonedb => tianmu}/base/core/fstream.h | 14 +- .../base/core/function_traits.h | 10 +- .../{stonedb => tianmu}/base/core/future.h | 42 +- .../base/core/future_util.h | 10 +- storage/{stonedb => tianmu}/base/core/gate.h | 10 +- .../{stonedb => tianmu}/base/core/iostream.h | 10 +- .../base/core/iostream_impl.h | 10 +- .../base/core/lowres_clock.h | 10 +- .../base/core/manual_clock.h | 10 +- .../{stonedb => tianmu}/base/core/metrics.cpp | 4 +- .../{stonedb => tianmu}/base/core/metrics.h | 12 +- .../base/core/metrics_api.h | 32 +- .../base/core/metrics_registration.h | 10 +- .../base/core/metrics_types.h | 10 +- storage/{stonedb => tianmu}/base/core/pipe.h | 10 +- .../{stonedb => tianmu}/base/core/posix.cpp | 4 +- storage/{stonedb => tianmu}/base/core/posix.h | 10 +- .../{stonedb => tianmu}/base/core/preempt.h | 10 +- .../{stonedb => tianmu}/base/core/prefetch.h | 10 +- storage/{stonedb => tianmu}/base/core/print.h | 18 +- storage/{stonedb => tianmu}/base/core/queue.h | 10 +- .../{stonedb => tianmu}/base/core/reactor.cpp | 12 +- .../{stonedb => tianmu}/base/core/reactor.h | 14 +- .../base/core/report_exception.h | 10 +- .../base/core/resource.cpp | 12 +- .../{stonedb => tianmu}/base/core/resource.h | 10 +- .../{stonedb => tianmu}/base/core/rwlock.h | 10 +- .../base/core/scattered_message.h | 10 +- .../base/core/scheduling.h | 10 +- .../base/core/scollectd.cpp | 4 +- .../{stonedb => tianmu}/base/core/scollectd.h | 10 +- .../base/core/scollectd_api.h | 10 +- .../base/core/scollectd_impl.h | 10 +- .../{stonedb => tianmu}/base/core/seastar.h | 10 +- .../{stonedb => tianmu}/base/core/semaphore.h | 10 +- .../{stonedb => tianmu}/base/core/sharded.h | 10 +- .../base/core/shared_future.h | 10 +- .../base/core/shared_mutex.h | 10 +- .../base/core/shared_ptr.h | 22 +- .../base/core/shared_ptr_debug_helper.h | 10 +- .../base/core/shared_ptr_incomplete.h | 10 +- .../base/core/simple_stream.h | 10 +- storage/{stonedb => tianmu}/base/core/sleep.h | 10 +- .../{stonedb => tianmu}/base/core/sstring.h | 18 +- .../{stonedb => tianmu}/base/core/stream.h | 10 +- .../base/core/systemwide_memory_barrier.cpp | 4 +- .../base/core/systemwide_memory_barrier.h | 10 +- storage/{stonedb => tianmu}/base/core/task.h | 10 +- .../base/core/temporary_buffer.h | 10 +- .../{stonedb => tianmu}/base/core/thread.cpp | 4 +- .../{stonedb => tianmu}/base/core/thread.h | 10 +- .../base/core/thread_impl.h | 10 +- storage/{stonedb => tianmu}/base/core/timer.h | 10 +- .../{stonedb => tianmu}/base/core/timer_set.h | 10 +- .../{stonedb => tianmu}/base/core/transfer.h | 10 +- .../{stonedb => tianmu}/base/core/unaligned.h | 10 +- .../base/core/vector_data_sink.h | 10 +- storage/{stonedb => tianmu}/base/core/vla.h | 10 +- .../{stonedb => tianmu}/base/core/weak_ptr.h | 10 +- .../{stonedb => tianmu}/base/fmt/container.h | 10 +- .../{stonedb => tianmu}/base/fmt/format.cpp | 10 +- storage/{stonedb => tianmu}/base/fmt/format.h | 36 +- .../{stonedb => tianmu}/base/fmt/ostream.cpp | 4 +- .../{stonedb => tianmu}/base/fmt/ostream.h | 10 +- .../{stonedb => tianmu}/base/fmt/posix.cpp | 4 +- storage/{stonedb => tianmu}/base/fmt/posix.h | 10 +- .../{stonedb => tianmu}/base/fmt/printf.cpp | 4 +- storage/{stonedb => tianmu}/base/fmt/printf.h | 10 +- storage/{stonedb => tianmu}/base/fmt/string.h | 10 +- storage/{stonedb => tianmu}/base/fmt/time.h | 10 +- storage/{stonedb => tianmu}/base/net/api.h | 10 +- .../{stonedb => tianmu}/base/net/byteorder.h | 10 +- storage/{stonedb => tianmu}/base/net/const.h | 10 +- .../base/net/native_stack_impl.h | 12 +- .../{stonedb => tianmu}/base/net/packet.cpp | 4 +- storage/{stonedb => tianmu}/base/net/packet.h | 10 +- .../base/net/packet_data_source.h | 10 +- .../base/net/packet_util.h | 10 +- .../base/net/posix_stack.cpp | 8 +- .../base/net/posix_stack.h | 14 +- .../base/net/socket_defs.h | 10 +- .../{stonedb => tianmu}/base/net/stack.cpp | 4 +- storage/{stonedb => tianmu}/base/net/stack.h | 10 +- .../base/util/bool_class.h | 10 +- .../base/util/conversions.cpp | 4 +- .../base/util/conversions.h | 10 +- storage/{stonedb => tianmu}/base/util/defer.h | 10 +- .../base/util/function_input_iterator.h | 10 +- .../base/util/gcc6-concepts.h | 6 +- .../{stonedb => tianmu}/base/util/indirect.h | 10 +- .../base/util/is_smart_ptr.h | 10 +- storage/{stonedb => tianmu}/base/util/lazy.h | 10 +- storage/{stonedb => tianmu}/base/util/log.cpp | 14 +- storage/{stonedb => tianmu}/base/util/log.h | 16 +- .../{stonedb => tianmu}/base/util/log_cli.h | 10 +- .../base/util/noncopyable_function.h | 10 +- .../base/util/print_safe.h | 10 +- .../base/util/program_options.cpp | 4 +- .../base/util/program_options.h | 10 +- .../base/util/reference_wrapper.h | 10 +- .../{stonedb => tianmu}/base/util/spinlock.h | 10 +- .../base/util/transform_iterator.h | 10 +- .../base/util/tuple_utils.h | 10 +- storage/{stonedb => tianmu}/common/assert.h | 12 +- .../common/common_definitions.cpp | 4 +- .../common/common_definitions.h | 28 +- .../{stonedb => tianmu}/common/compile_opts.h | 14 +- .../common/data_format.cpp | 4 +- .../{stonedb => tianmu}/common/data_format.h | 10 +- storage/{stonedb => tianmu}/common/defs.h | 14 +- .../{stonedb => tianmu}/common/exception.cpp | 6 +- .../{stonedb => tianmu}/common/exception.h | 38 +- .../{stonedb => tianmu}/common/mysql_gate.cpp | 4 +- .../{stonedb => tianmu}/common/mysql_gate.h | 12 +- .../common/sequence_generator.h | 10 +- .../common/txt_data_format.cpp | 4 +- .../common/txt_data_format.h | 10 +- .../compress/arith_coder.cpp | 4 +- .../compress/arith_coder.h | 10 +- .../compress/basic_data_filt.cpp | 4 +- .../compress/basic_data_filt.h | 10 +- .../compress/bit_stream_compressor.cpp | 4 +- .../compress/bit_stream_compressor.h | 10 +- .../compress/code_stream.h | 10 +- .../{stonedb => tianmu}/compress/data_filt.h | 10 +- .../compress/data_stream.cpp | 4 +- .../compress/data_stream.h | 10 +- storage/{stonedb => tianmu}/compress/defs.h | 10 +- .../compress/dictionary.cpp | 6 +- .../{stonedb => tianmu}/compress/dictionary.h | 10 +- .../compress/inc_alloc.cpp | 4 +- .../{stonedb => tianmu}/compress/inc_alloc.h | 10 +- .../compress/inc_wgraph.cpp | 4 +- .../{stonedb => tianmu}/compress/inc_wgraph.h | 10 +- storage/{stonedb => tianmu}/compress/lz4.cpp | 4 +- storage/{stonedb => tianmu}/compress/lz4.h | 10 +- .../compress/num_compressor.h | 26 +- .../compress/part_dict.cpp | 6 +- .../{stonedb => tianmu}/compress/part_dict.h | 10 +- storage/{stonedb => tianmu}/compress/ppm.cpp | 6 +- storage/{stonedb => tianmu}/compress/ppm.h | 10 +- .../{stonedb => tianmu}/compress/ppm_defs.h | 10 +- .../{stonedb => tianmu}/compress/range_code.h | 10 +- .../compress/suffix_tree.cpp | 4 +- .../compress/suffix_tree.h | 10 +- .../compress/text_compressor.cpp | 14 +- .../compress/text_compressor.h | 10 +- .../compress/top_bit_dict.cpp | 4 +- .../compress/top_bit_dict.h | 10 +- .../compress/word_graph.cpp | 8 +- .../{stonedb => tianmu}/compress/word_graph.h | 10 +- .../core/aggregation_algorithm.cpp | 12 +- .../core/aggregation_algorithm.h | 12 +- storage/{stonedb => tianmu}/core/aggregator.h | 34 +- .../core/aggregator_advanced.cpp | 10 +- .../core/aggregator_advanced.h | 76 +-- .../core/aggregator_basic.cpp | 4 +- .../core/aggregator_basic.h | 136 +++--- .../{stonedb => tianmu}/core/bin_tools.cpp | 4 +- storage/{stonedb => tianmu}/core/bin_tools.h | 10 +- .../core/blocked_mem_table.cpp | 4 +- .../core/blocked_mem_table.h | 10 +- .../{stonedb => tianmu}/core/bloom_block.cpp | 6 +- .../{stonedb => tianmu}/core/bloom_block.h | 10 +- .../{stonedb => tianmu}/core/bloom_coding.cpp | 4 +- .../{stonedb => tianmu}/core/bloom_coding.h | 10 +- .../core/cached_buffer.cpp | 4 +- .../{stonedb => tianmu}/core/cached_buffer.h | 10 +- storage/{stonedb => tianmu}/core/column.h | 10 +- .../core/column_bin_encoder.cpp | 4 +- .../core/column_bin_encoder.h | 10 +- .../{stonedb => tianmu}/core/column_share.cpp | 20 +- .../{stonedb => tianmu}/core/column_share.h | 10 +- .../{stonedb => tianmu}/core/column_type.cpp | 6 +- .../{stonedb => tianmu}/core/column_type.h | 10 +- .../core/compilation_tools.cpp | 10 +- .../core/compilation_tools.h | 10 +- .../core/compiled_query.cpp | 6 +- .../{stonedb => tianmu}/core/compiled_query.h | 10 +- .../{stonedb => tianmu}/core/condition.cpp | 4 +- storage/{stonedb => tianmu}/core/condition.h | 10 +- .../core/condition_encoder.cpp | 16 +- .../core/condition_encoder.h | 10 +- storage/{stonedb => tianmu}/core/cq_term.cpp | 4 +- storage/{stonedb => tianmu}/core/cq_term.h | 10 +- storage/{stonedb => tianmu}/core/ctask.h | 10 +- .../{stonedb => tianmu}/core/data_cache.cpp | 4 +- storage/{stonedb => tianmu}/core/data_cache.h | 14 +- .../{stonedb => tianmu}/core/data_type.cpp | 14 +- storage/{stonedb => tianmu}/core/data_type.h | 12 +- .../{stonedb => tianmu}/core/descriptor.cpp | 22 +- storage/{stonedb => tianmu}/core/descriptor.h | 18 +- .../core/dimension_group.cpp | 4 +- .../core/dimension_group.h | 10 +- .../core/dimension_group_multiple.cpp | 4 +- .../core/dimension_group_multiple.h | 10 +- .../core/dimension_group_virtual.cpp | 4 +- .../core/dimension_group_virtual.h | 10 +- .../core/dimension_vector.h | 10 +- storage/{stonedb => tianmu}/core/dpn.h | 10 +- storage/{stonedb => tianmu}/core/engine.cpp | 454 +++++++++--------- storage/{stonedb => tianmu}/core/engine.h | 78 +-- .../core/engine_convert.cpp | 48 +- .../core/engine_execute.cpp | 120 ++--- .../core/engine_results.cpp | 12 +- storage/{stonedb => tianmu}/core/filter.cpp | 6 +- storage/{stonedb => tianmu}/core/filter.h | 12 +- .../{stonedb => tianmu}/core/filter_block.cpp | 4 +- .../core/filter_iterators.cpp | 4 +- storage/{stonedb => tianmu}/core/ftree.cpp | 24 +- storage/{stonedb => tianmu}/core/ftree.h | 10 +- .../core/group_distinct_cache.cpp | 6 +- .../core/group_distinct_cache.h | 10 +- .../core/group_distinct_table.cpp | 4 +- .../core/group_distinct_table.h | 10 +- .../{stonedb => tianmu}/core/group_table.cpp | 8 +- .../{stonedb => tianmu}/core/group_table.h | 14 +- .../core/groupby_wrapper.cpp | 6 +- .../core/groupby_wrapper.h | 10 +- .../{stonedb => tianmu}/core/hash_table.cpp | 4 +- storage/{stonedb => tianmu}/core/hash_table.h | 10 +- .../{stonedb => tianmu}/core/index_table.cpp | 10 +- .../{stonedb => tianmu}/core/index_table.h | 10 +- .../core/item_tianmu_field.cpp} | 120 ++--- .../core/item_tianmu_field.h} | 66 +-- .../core/join_thread_table.cpp | 4 +- .../core/join_thread_table.h | 10 +- storage/{stonedb => tianmu}/core/joiner.cpp | 10 +- storage/{stonedb => tianmu}/core/joiner.h | 10 +- .../core/joiner_general.cpp | 4 +- .../{stonedb => tianmu}/core/joiner_hash.cpp | 20 +- .../{stonedb => tianmu}/core/joiner_hash.h | 12 +- .../core/joiner_hash_table.cpp | 4 +- .../core/joiner_hash_table.h | 10 +- .../core/joiner_mapped.cpp | 4 +- .../{stonedb => tianmu}/core/joiner_mapped.h | 10 +- .../{stonedb => tianmu}/core/joiner_sort.cpp | 4 +- .../{stonedb => tianmu}/core/joiner_sort.h | 10 +- storage/{stonedb => tianmu}/core/joner_hash.h | 12 +- .../{stonedb => tianmu}/core/just_a_table.cpp | 4 +- .../{stonedb => tianmu}/core/just_a_table.h | 10 +- .../{stonedb => tianmu}/core/mi_iterator.cpp | 4 +- .../{stonedb => tianmu}/core/mi_iterator.h | 10 +- .../core/mi_new_contents.cpp | 4 +- .../core/mi_new_contents.h | 10 +- .../core/mi_rough_sorter.cpp | 4 +- .../core/mi_rough_sorter.h | 10 +- .../core/mi_step_iterator.cpp | 4 +- .../core/mi_step_iterator.h | 10 +- .../core/mi_updating_iterator.cpp | 4 +- .../core/mi_updating_iterator.h | 10 +- .../{stonedb => tianmu}/core/multi_index.cpp | 4 +- .../{stonedb => tianmu}/core/multi_index.h | 10 +- .../core/multi_index_builder.cpp | 4 +- .../core/multi_index_builder.h | 10 +- .../core/mysql_expression.cpp | 158 +++--- .../core/mysql_expression.h | 26 +- .../{stonedb => tianmu}/core/object_cache.h | 10 +- storage/{stonedb => tianmu}/core/pack.cpp | 10 +- storage/{stonedb => tianmu}/core/pack.h | 10 +- .../core/pack_guardian.cpp | 4 +- .../{stonedb => tianmu}/core/pack_guardian.h | 10 +- storage/{stonedb => tianmu}/core/pack_int.cpp | 14 +- storage/{stonedb => tianmu}/core/pack_int.h | 14 +- .../{stonedb => tianmu}/core/pack_orderer.cpp | 4 +- .../{stonedb => tianmu}/core/pack_orderer.h | 10 +- storage/{stonedb => tianmu}/core/pack_str.cpp | 14 +- storage/{stonedb => tianmu}/core/pack_str.h | 10 +- .../core/parallel_hash_join.cpp | 32 +- .../core/parallel_hash_join.h | 10 +- .../core/parameterized_filter.cpp | 10 +- .../core/parameterized_filter.h | 10 +- .../core/physical_column.h | 10 +- .../core/proxy_hash_joiner.cpp | 40 +- .../core/proxy_hash_joiner.h | 10 +- storage/{stonedb => tianmu}/core/query.cpp | 30 +- storage/{stonedb => tianmu}/core/query.h | 22 +- .../core/query_compile.cpp | 66 +-- .../{stonedb => tianmu}/core/query_operator.h | 10 +- .../{stonedb => tianmu}/core/quick_math.cpp | 4 +- storage/{stonedb => tianmu}/core/quick_math.h | 10 +- storage/{stonedb => tianmu}/core/rc_attr.cpp | 52 +- storage/{stonedb => tianmu}/core/rc_attr.h | 16 +- .../core/rc_attr_typeinfo.cpp | 4 +- .../core/rc_attr_typeinfo.h | 10 +- .../{stonedb => tianmu}/core/rc_mem_table.cpp | 8 +- .../{stonedb => tianmu}/core/rc_mem_table.h | 10 +- storage/{stonedb => tianmu}/core/rc_table.cpp | 74 +-- storage/{stonedb => tianmu}/core/rc_table.h | 10 +- .../core/rcattr_exeq_rs.cpp | 6 +- .../{stonedb => tianmu}/core/rcattr_exqp.cpp | 14 +- .../core/rough_multi_index.cpp | 4 +- .../core/rough_multi_index.h | 10 +- .../{stonedb => tianmu}/core/rough_value.cpp | 4 +- .../{stonedb => tianmu}/core/rough_value.h | 10 +- .../{stonedb => tianmu}/core/rsi_bloom.cpp | 14 +- storage/{stonedb => tianmu}/core/rsi_bloom.h | 10 +- storage/{stonedb => tianmu}/core/rsi_cmap.cpp | 12 +- storage/{stonedb => tianmu}/core/rsi_cmap.h | 10 +- .../core/rsi_histogram.cpp | 12 +- .../{stonedb => tianmu}/core/rsi_histogram.h | 10 +- storage/{stonedb => tianmu}/core/rsi_index.h | 10 +- storage/{stonedb => tianmu}/core/sorter3.cpp | 16 +- storage/{stonedb => tianmu}/core/sorter3.h | 10 +- .../core/sorter_wrapper.cpp | 8 +- .../{stonedb => tianmu}/core/sorter_wrapper.h | 10 +- .../{stonedb => tianmu}/core/table_share.cpp | 14 +- .../{stonedb => tianmu}/core/table_share.h | 12 +- .../core/task_executor.cpp | 8 +- .../core}/task_executor.h | 12 +- .../{stonedb => tianmu}/core/temp_table.cpp | 26 +- storage/{stonedb => tianmu}/core/temp_table.h | 12 +- .../core/temp_table_com.cpp | 4 +- .../core/temp_table_low.cpp | 30 +- .../core/temp_table_roughquery.cpp | 4 +- storage/{stonedb => tianmu}/core/tools.h | 10 +- .../{stonedb => tianmu}/core/transaction.cpp | 10 +- .../{stonedb => tianmu}/core/transaction.h | 10 +- storage/{stonedb => tianmu}/core/value.h | 10 +- .../core/value_matching_hashtable.cpp | 4 +- .../core/value_matching_hashtable.h | 10 +- .../core/value_matching_table.cpp | 4 +- .../core/value_matching_table.h | 10 +- .../core/value_or_null.cpp | 4 +- .../{stonedb => tianmu}/core/value_or_null.h | 12 +- .../{stonedb => tianmu}/core/value_set.cpp | 4 +- storage/{stonedb => tianmu}/core/value_set.h | 10 +- storage/{stonedb => tianmu}/core/var_id.h | 10 +- .../exporter/data_exporter.cpp | 4 +- .../exporter/data_exporter.h | 10 +- .../exporter/data_exporter_txt.cpp | 4 +- .../exporter/data_exporter_txt.h | 10 +- .../exporter/export2file.cpp | 16 +- .../exporter/export2file.h | 18 +- .../handler/ha_rcengine.cpp | 84 ++-- .../{stonedb => tianmu}/handler/ha_rcengine.h | 22 +- .../handler/tianmu_handler.cpp} | 282 +++++------ .../handler/tianmu_handler.h} | 22 +- .../handler/tianmu_handler_com.cpp} | 196 ++++---- .../{stonedb => tianmu}/index/kv_store.cpp | 28 +- storage/{stonedb => tianmu}/index/kv_store.h | 10 +- .../index/kv_transaction.cpp | 4 +- .../index/kv_transaction.h | 10 +- .../index/rc_table_index.cpp | 24 +- .../index/rc_table_index.h | 10 +- .../index/rdb_meta_manager.cpp | 38 +- .../index/rdb_meta_manager.h | 10 +- storage/{stonedb => tianmu}/index/rdb_utils.h | 18 +- .../loader/load_parser.cpp | 6 +- .../{stonedb => tianmu}/loader/load_parser.h | 10 +- .../loader/parsing_strategy.cpp | 6 +- .../loader/parsing_strategy.h | 10 +- .../loader/read_buffer.cpp | 38 +- .../{stonedb => tianmu}/loader/read_buffer.h | 12 +- .../{stonedb => tianmu}/loader/rejecter.cpp | 14 +- storage/{stonedb => tianmu}/loader/rejecter.h | 14 +- .../loader/value_cache.cpp | 4 +- .../{stonedb => tianmu}/loader/value_cache.h | 10 +- storage/{stonedb => tianmu}/mm/heap_policy.h | 10 +- .../mm/huge_heap_policy.cpp | 6 +- .../{stonedb => tianmu}/mm/huge_heap_policy.h | 10 +- .../{stonedb => tianmu}/mm/initializer.cpp | 4 +- storage/{stonedb => tianmu}/mm/initializer.h | 10 +- storage/{stonedb => tianmu}/mm/memory_block.h | 10 +- .../mm/memory_handling_policy.cpp | 32 +- .../mm/memory_handling_policy.h | 10 +- storage/{stonedb => tianmu}/mm/mm_guard.h | 10 +- .../mm/mysql_heap_policy.cpp | 4 +- .../mm/mysql_heap_policy.h | 10 +- .../mm/numa_heap_policy.cpp | 4 +- .../{stonedb => tianmu}/mm/numa_heap_policy.h | 10 +- .../{stonedb => tianmu}/mm/reference_object.h | 10 +- storage/{stonedb => tianmu}/mm/release2q.cpp | 6 +- storage/{stonedb => tianmu}/mm/release2q.h | 10 +- .../{stonedb => tianmu}/mm/release_all.cpp | 4 +- storage/{stonedb => tianmu}/mm/release_all.h | 10 +- .../{stonedb => tianmu}/mm/release_fifo.cpp | 4 +- storage/{stonedb => tianmu}/mm/release_fifo.h | 10 +- .../{stonedb => tianmu}/mm/release_lru.cpp | 4 +- storage/{stonedb => tianmu}/mm/release_lru.h | 10 +- storage/{stonedb => tianmu}/mm/release_null.h | 10 +- .../{stonedb => tianmu}/mm/release_strategy.h | 10 +- .../mm/release_tracker.cpp | 4 +- .../{stonedb => tianmu}/mm/release_tracker.h | 10 +- .../mm/sys_heap_policy.cpp | 4 +- .../{stonedb => tianmu}/mm/sys_heap_policy.h | 10 +- .../{stonedb => tianmu}/mm/tcm/linked_list.h | 10 +- .../{stonedb => tianmu}/mm/tcm/page_heap.cpp | 4 +- .../{stonedb => tianmu}/mm/tcm/page_heap.h | 10 +- .../mm/tcm/page_heap_allocator.h | 10 +- storage/{stonedb => tianmu}/mm/tcm/pagemap.h | 10 +- storage/{stonedb => tianmu}/mm/tcm/span.cpp | 4 +- storage/{stonedb => tianmu}/mm/tcm/span.h | 10 +- .../{stonedb => tianmu}/mm/tcm/tccommon.cpp | 4 +- storage/{stonedb => tianmu}/mm/tcm/tccommon.h | 10 +- .../mm/tcm_heap_policy.cpp | 4 +- .../{stonedb => tianmu}/mm/tcm_heap_policy.h | 10 +- .../mm/traceable_object.cpp | 12 +- .../{stonedb => tianmu}/mm/traceable_object.h | 14 +- .../system/cacheable_item.cpp | 12 +- .../system/cacheable_item.h | 16 +- .../{stonedb => tianmu}/system/channel.cpp | 4 +- storage/{stonedb => tianmu}/system/channel.h | 10 +- .../{stonedb => tianmu}/system/channel_out.h | 10 +- storage/tianmu/system/configuration.cpp | 83 ++++ storage/tianmu/system/configuration.h | 102 ++++ storage/{stonedb => tianmu}/system/fet.cpp | 4 +- storage/{stonedb => tianmu}/system/fet.h | 24 +- storage/{stonedb => tianmu}/system/file.cpp | 50 +- storage/{stonedb => tianmu}/system/file_out.h | 10 +- .../system/file_system.cpp | 18 +- .../{stonedb => tianmu}/system/file_system.h | 10 +- .../system/io_parameters.h | 10 +- .../system/large_buffer.cpp | 26 +- .../{stonedb => tianmu}/system/large_buffer.h | 12 +- .../system/mag_memory_policy.h | 10 +- .../{stonedb => tianmu}/system/net_stream.cpp | 6 +- .../{stonedb => tianmu}/system/net_stream.h | 10 +- .../{stonedb => tianmu}/system/rc_system.cpp | 4 +- .../{stonedb => tianmu}/system/rc_system.h | 10 +- .../system/res_manager.cpp | 6 +- .../{stonedb => tianmu}/system/res_manager.h | 10 +- .../system/res_manager_base.cpp | 4 +- .../system/res_manager_base.h | 10 +- .../system/res_manager_policy.h | 10 +- storage/{stonedb => tianmu}/system/stdout.h | 10 +- storage/{stonedb => tianmu}/system/stream.cpp | 4 +- storage/{stonedb => tianmu}/system/stream.h | 10 +- .../system/tianmu_file.h} | 18 +- .../{stonedb => tianmu}/system/txt_utils.cpp | 4 +- .../{stonedb => tianmu}/system/txt_utils.h | 10 +- storage/{stonedb => tianmu}/types/bstring.cpp | 10 +- .../types/rc_data_types.cpp | 4 +- .../{stonedb => tianmu}/types/rc_data_types.h | 20 +- .../{stonedb => tianmu}/types/rc_datetime.cpp | 48 +- .../types/rc_item_types.cpp | 10 +- .../{stonedb => tianmu}/types/rc_item_types.h | 10 +- storage/{stonedb => tianmu}/types/rc_num.cpp | 18 +- storage/{stonedb => tianmu}/types/rc_num.h | 10 +- .../types/rc_value_object.cpp | 8 +- .../{stonedb => tianmu}/types/text_stat.cpp | 4 +- storage/{stonedb => tianmu}/types/text_stat.h | 10 +- .../types/value_parser4txt.cpp | 164 +++---- .../types/value_parser4txt.h | 12 +- storage/{stonedb => tianmu}/util/bitset.h | 10 +- storage/{stonedb => tianmu}/util/circ_buf.h | 10 +- storage/{stonedb => tianmu}/util/fs.h | 10 +- storage/{stonedb => tianmu}/util/hash64.h | 10 +- storage/{stonedb => tianmu}/util/log_ctl.cpp | 34 +- storage/{stonedb => tianmu}/util/log_ctl.h | 18 +- .../util/mapped_circular_buffer.h | 20 +- storage/{stonedb => tianmu}/util/qsort.h | 26 +- .../{stonedb => tianmu}/util/stack_trace.cpp | 4 +- .../{stonedb => tianmu}/util/stack_trace.h | 10 +- .../{stonedb => tianmu}/util/thread_pool.cpp | 4 +- .../{stonedb => tianmu}/util/thread_pool.h | 14 +- storage/{stonedb => tianmu}/util/timer.cpp | 6 +- storage/{stonedb => tianmu}/util/timer.h | 12 +- .../{stonedb => tianmu}/vc/const_column.cpp | 4 +- storage/{stonedb => tianmu}/vc/const_column.h | 14 +- .../vc/const_expr_column.cpp | 8 +- .../vc/const_expr_column.h | 10 +- .../{stonedb => tianmu}/vc/expr_column.cpp | 4 +- storage/{stonedb => tianmu}/vc/expr_column.h | 16 +- .../{stonedb => tianmu}/vc/in_set_column.cpp | 10 +- .../{stonedb => tianmu}/vc/in_set_column.h | 14 +- .../vc/multi_value_column.h | 14 +- .../{stonedb => tianmu}/vc/single_column.cpp | 4 +- .../{stonedb => tianmu}/vc/single_column.h | 14 +- .../vc/subselect_column.cpp | 30 +- .../{stonedb => tianmu}/vc/subselect_column.h | 16 +- .../vc/type_cast_column.cpp | 6 +- .../{stonedb => tianmu}/vc/type_cast_column.h | 12 +- .../{stonedb => tianmu}/vc/virtual_column.h | 10 +- .../vc/virtual_column_base.cpp | 4 +- .../vc/virtual_column_base.h | 14 +- support-files/mysql-log-rotate.sh | 2 +- testclients/mysql_client_fw.c | 8 +- testclients/mysql_client_test.c | 4 +- website/docusaurus.config.js | 2 +- website/src/theme/MDXComponents/Image.tsx | 28 +- 719 files changed, 4981 insertions(+), 4967 deletions(-) rename mysql-test/std_data/{stonedb => tianmu}/bigdata4load (100%) rename mysql-test/std_data/{stonedb => tianmu}/column_type_test.frm (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00000.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00000000000000.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00000000000001.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00000DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00001.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00001000000000.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00001000000001.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00001DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00002.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00002000000000.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00002000000001.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00002DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00003.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00003000000000.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00003000000001.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00003DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00004.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00004000000000.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00004000000001.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00004DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00005.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00005DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00006.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00006DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00007.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00007000000000.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00007000000001.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00007DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00008.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00008DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00009.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00009DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00010.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00010000000000.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00010000000001.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00010DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00011.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00011DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00012.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00012000000000.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00012000000001.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00012DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00013.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00013000000000.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00013000000001.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00013DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00014.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00014DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00015.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00015000000000.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00015000000001.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00015DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00016.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TA00016DPN.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00000.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00001.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00002.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00003.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00004.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00005.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00006.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00007.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00008.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00009.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00010.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00011.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00012.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00013.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00014.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00015.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/TB00016.ctb (100%) rename mysql-test/std_data/{stonedb/column_type_test.bht => tianmu/column_type_test.tm}/Table.ctb (100%) rename mysql-test/std_data/{stonedb => tianmu}/loadfile (100%) delete mode 100644 mysql-test/suite/stonedb/r/issue410.result rename mysql-test/suite/{stonedb => tianmu}/r/add_column.result (93%) rename mysql-test/suite/{stonedb => tianmu}/r/casewhen.result (92%) rename mysql-test/suite/{stonedb => tianmu}/r/concat.result (94%) rename mysql-test/suite/{stonedb => tianmu}/r/drop_column.result (97%) rename mysql-test/suite/{stonedb => tianmu}/r/group_concat.result (98%) rename mysql-test/suite/{stonedb => tianmu}/r/group_concat2.result (96%) rename mysql-test/suite/{stonedb => tianmu}/r/insert.result (99%) rename mysql-test/suite/{stonedb => tianmu}/r/issue405.result (79%) create mode 100644 mysql-test/suite/tianmu/r/issue410.result rename mysql-test/suite/{stonedb => tianmu}/r/issue415.result (97%) rename mysql-test/suite/{stonedb => tianmu}/r/issue417.result (77%) rename mysql-test/suite/{stonedb => tianmu}/r/issue429.result (84%) rename mysql-test/suite/{stonedb => tianmu}/r/issue430.result (93%) rename mysql-test/suite/{stonedb => tianmu}/r/issue431.result (72%) rename mysql-test/suite/{stonedb => tianmu}/r/issue433.result (95%) rename mysql-test/suite/{stonedb => tianmu}/r/issue446.result (54%) rename mysql-test/suite/{stonedb => tianmu}/r/issue464.result (98%) rename mysql-test/suite/{stonedb => tianmu}/r/issue467.result (79%) rename mysql-test/suite/{stonedb => tianmu}/r/issue468.result (89%) rename mysql-test/suite/{stonedb => tianmu}/r/issue469.result (74%) rename mysql-test/suite/{stonedb => tianmu}/r/issue475.result (78%) rename mysql-test/suite/{stonedb => tianmu}/r/issue496.result (96%) rename mysql-test/suite/{stonedb => tianmu}/r/issue502.result (90%) rename mysql-test/suite/{stonedb => tianmu}/r/issue515.result (87%) rename mysql-test/suite/{stonedb => tianmu}/r/load.result (93%) rename mysql-test/suite/{stonedb => tianmu}/r/lz4.result (99%) rename mysql-test/suite/{stonedb => tianmu}/r/orquery.result (92%) rename mysql-test/suite/{stonedb => tianmu}/r/orquery1.result (93%) rename mysql-test/suite/{stonedb => tianmu}/r/truncate.result (93%) rename mysql-test/suite/{stonedb => tianmu}/t/add_column.test (91%) rename mysql-test/suite/{stonedb => tianmu}/t/casewhen.test (91%) rename mysql-test/suite/{stonedb => tianmu}/t/concat.test (93%) rename mysql-test/suite/{stonedb => tianmu}/t/disabled.def (100%) rename mysql-test/suite/{stonedb => tianmu}/t/drop_column.test (98%) rename mysql-test/suite/{stonedb => tianmu}/t/group_concat.test (98%) rename mysql-test/suite/{stonedb => tianmu}/t/group_concat2.test (95%) rename mysql-test/suite/{stonedb => tianmu}/t/insert.test (99%) rename mysql-test/suite/{stonedb => tianmu}/t/issue405.test (76%) rename mysql-test/suite/{stonedb => tianmu}/t/issue410.testbak (66%) rename mysql-test/suite/{stonedb => tianmu}/t/issue415.testbak (97%) rename mysql-test/suite/{stonedb => tianmu}/t/issue417.test (76%) rename mysql-test/suite/{stonedb => tianmu}/t/issue429.test (81%) rename mysql-test/suite/{stonedb => tianmu}/t/issue430.test (93%) rename mysql-test/suite/{stonedb => tianmu}/t/issue431.test (71%) rename mysql-test/suite/{stonedb => tianmu}/t/issue433.testbak (94%) rename mysql-test/suite/{stonedb => tianmu}/t/issue446.testbak (75%) rename mysql-test/suite/{stonedb => tianmu}/t/issue464.test (97%) rename mysql-test/suite/{stonedb => tianmu}/t/issue467.test (77%) rename mysql-test/suite/{stonedb => tianmu}/t/issue468.test (88%) rename mysql-test/suite/{stonedb => tianmu}/t/issue469.test (72%) rename mysql-test/suite/{stonedb => tianmu}/t/issue475.test (70%) rename mysql-test/suite/{stonedb => tianmu}/t/issue496.test (95%) rename mysql-test/suite/{stonedb => tianmu}/t/issue502.test (90%) rename mysql-test/suite/{stonedb => tianmu}/t/issue515.testbak (83%) rename mysql-test/suite/{stonedb => tianmu}/t/load.testbak (90%) rename mysql-test/suite/{stonedb => tianmu}/t/lz4.test (99%) rename mysql-test/suite/{stonedb => tianmu}/t/orquery.test (92%) rename mysql-test/suite/{stonedb => tianmu}/t/orquery1.test (93%) rename mysql-test/suite/{stonedb => tianmu}/t/truncate.test (91%) delete mode 100755 sql/stonedb.h create mode 100755 sql/tianmu.h delete mode 100644 storage/stonedb/system/configuration.cpp delete mode 100644 storage/stonedb/system/configuration.h rename storage/{stonedb => tianmu}/.clang-format (100%) rename storage/{stonedb => tianmu}/CMakeLists.txt (69%) rename storage/{stonedb => tianmu}/async_tests/CMakeLists.txt (59%) rename storage/{stonedb => tianmu}/async_tests/main.cc (70%) rename storage/{stonedb => tianmu}/async_tests/task_executor.cpp (96%) rename storage/{stonedb/core => tianmu/async_tests}/task_executor.h (91%) rename storage/{stonedb => tianmu}/base/core/align.h (92%) rename storage/{stonedb => tianmu}/base/core/aligned_buffer.h (90%) rename storage/{stonedb => tianmu}/base/core/app_template.cpp (98%) rename storage/{stonedb => tianmu}/base/core/app_template.h (91%) rename storage/{stonedb => tianmu}/base/core/apply.h (93%) rename storage/{stonedb => tianmu}/base/core/array_map.h (90%) rename storage/{stonedb => tianmu}/base/core/bitops.h (92%) rename storage/{stonedb => tianmu}/base/core/bitset_iter.h (96%) rename storage/{stonedb => tianmu}/base/core/byteorder.h (95%) rename storage/{stonedb => tianmu}/base/core/cacheline.h (89%) rename storage/{stonedb => tianmu}/base/core/checked_ptr.h (97%) rename storage/{stonedb => tianmu}/base/core/chunked_fifo.h (99%) rename storage/{stonedb => tianmu}/base/core/circular_buffer.h (98%) rename storage/{stonedb => tianmu}/base/core/circular_buffer_fixed_capacity.h (98%) rename storage/{stonedb => tianmu}/base/core/condition_variable.h (97%) rename storage/{stonedb => tianmu}/base/core/deleter.h (98%) rename storage/{stonedb => tianmu}/base/core/distributed.h (86%) rename storage/{stonedb => tianmu}/base/core/do_with.h (96%) rename storage/{stonedb => tianmu}/base/core/enum.h (91%) rename storage/{stonedb => tianmu}/base/core/exception_hacks.cpp (95%) rename storage/{stonedb => tianmu}/base/core/exception_hacks.h (84%) rename storage/{stonedb => tianmu}/base/core/execution_stage.h (99%) rename storage/{stonedb => tianmu}/base/core/expiring_fifo.h (96%) rename storage/{stonedb => tianmu}/base/core/fair_queue.h (98%) rename storage/{stonedb => tianmu}/base/core/file.h (99%) rename storage/{stonedb => tianmu}/base/core/file_impl.h (97%) rename storage/{stonedb => tianmu}/base/core/fsqual.cpp (98%) rename storage/{stonedb => tianmu}/base/core/fsqual.h (87%) rename storage/{stonedb => tianmu}/base/core/fstream.cpp (99%) rename storage/{stonedb => tianmu}/base/core/fstream.h (92%) rename storage/{stonedb => tianmu}/base/core/function_traits.h (92%) rename storage/{stonedb => tianmu}/base/core/future.h (97%) rename storage/{stonedb => tianmu}/base/core/future_util.h (99%) rename storage/{stonedb => tianmu}/base/core/gate.h (96%) rename storage/{stonedb => tianmu}/base/core/iostream.h (98%) rename storage/{stonedb => tianmu}/base/core/iostream_impl.h (98%) rename storage/{stonedb => tianmu}/base/core/lowres_clock.h (96%) rename storage/{stonedb => tianmu}/base/core/manual_clock.h (89%) rename storage/{stonedb => tianmu}/base/core/metrics.cpp (99%) rename storage/{stonedb => tianmu}/base/core/metrics.h (99%) rename storage/{stonedb => tianmu}/base/core/metrics_api.h (92%) rename storage/{stonedb => tianmu}/base/core/metrics_registration.h (96%) rename storage/{stonedb => tianmu}/base/core/metrics_types.h (93%) rename storage/{stonedb => tianmu}/base/core/pipe.h (98%) rename storage/{stonedb => tianmu}/base/core/posix.cpp (98%) rename storage/{stonedb => tianmu}/base/core/posix.h (98%) rename storage/{stonedb => tianmu}/base/core/preempt.h (88%) rename storage/{stonedb => tianmu}/base/core/prefetch.h (96%) rename storage/{stonedb => tianmu}/base/core/print.h (89%) rename storage/{stonedb => tianmu}/base/core/queue.h (97%) rename storage/{stonedb => tianmu}/base/core/reactor.cpp (99%) rename storage/{stonedb => tianmu}/base/core/reactor.h (99%) rename storage/{stonedb => tianmu}/base/core/report_exception.h (85%) rename storage/{stonedb => tianmu}/base/core/resource.cpp (98%) rename storage/{stonedb => tianmu}/base/core/resource.h (93%) rename storage/{stonedb => tianmu}/base/core/rwlock.h (96%) rename storage/{stonedb => tianmu}/base/core/scattered_message.h (94%) rename storage/{stonedb => tianmu}/base/core/scheduling.h (95%) rename storage/{stonedb => tianmu}/base/core/scollectd.cpp (99%) rename storage/{stonedb => tianmu}/base/core/scollectd.h (99%) rename storage/{stonedb => tianmu}/base/core/scollectd_api.h (84%) rename storage/{stonedb => tianmu}/base/core/scollectd_impl.h (94%) rename storage/{stonedb => tianmu}/base/core/seastar.h (98%) rename storage/{stonedb => tianmu}/base/core/semaphore.h (99%) rename storage/{stonedb => tianmu}/base/core/sharded.h (99%) rename storage/{stonedb => tianmu}/base/core/shared_future.h (98%) rename storage/{stonedb => tianmu}/base/core/shared_mutex.h (97%) rename storage/{stonedb => tianmu}/base/core/shared_ptr.h (97%) rename storage/{stonedb => tianmu}/base/core/shared_ptr_debug_helper.h (90%) rename storage/{stonedb => tianmu}/base/core/shared_ptr_incomplete.h (88%) rename storage/{stonedb => tianmu}/base/core/simple_stream.h (99%) rename storage/{stonedb => tianmu}/base/core/sleep.h (95%) rename storage/{stonedb => tianmu}/base/core/sstring.h (98%) rename storage/{stonedb => tianmu}/base/core/stream.h (97%) rename storage/{stonedb => tianmu}/base/core/systemwide_memory_barrier.cpp (97%) rename storage/{stonedb => tianmu}/base/core/systemwide_memory_barrier.h (83%) rename storage/{stonedb => tianmu}/base/core/task.h (93%) rename storage/{stonedb => tianmu}/base/core/temporary_buffer.h (98%) rename storage/{stonedb => tianmu}/base/core/thread.cpp (99%) rename storage/{stonedb => tianmu}/base/core/thread.h (98%) rename storage/{stonedb => tianmu}/base/core/thread_impl.h (93%) rename storage/{stonedb => tianmu}/base/core/timer.h (94%) rename storage/{stonedb => tianmu}/base/core/timer_set.h (97%) rename storage/{stonedb => tianmu}/base/core/transfer.h (94%) rename storage/{stonedb => tianmu}/base/core/unaligned.h (95%) rename storage/{stonedb => tianmu}/base/core/vector_data_sink.h (88%) rename storage/{stonedb => tianmu}/base/core/vla.h (93%) rename storage/{stonedb => tianmu}/base/core/weak_ptr.h (95%) rename storage/{stonedb => tianmu}/base/fmt/container.h (92%) rename storage/{stonedb => tianmu}/base/fmt/format.cpp (98%) rename storage/{stonedb => tianmu}/base/fmt/format.h (99%) rename storage/{stonedb => tianmu}/base/fmt/ostream.cpp (95%) rename storage/{stonedb => tianmu}/base/fmt/ostream.h (95%) rename storage/{stonedb => tianmu}/base/fmt/posix.cpp (99%) rename storage/{stonedb => tianmu}/base/fmt/posix.h (98%) rename storage/{stonedb => tianmu}/base/fmt/printf.cpp (94%) rename storage/{stonedb => tianmu}/base/fmt/printf.h (99%) rename storage/{stonedb => tianmu}/base/fmt/string.h (95%) rename storage/{stonedb => tianmu}/base/fmt/time.h (96%) rename storage/{stonedb => tianmu}/base/net/api.h (98%) rename storage/{stonedb => tianmu}/base/net/byteorder.h (95%) rename storage/{stonedb => tianmu}/base/net/const.h (90%) rename storage/{stonedb => tianmu}/base/net/native_stack_impl.h (97%) rename storage/{stonedb => tianmu}/base/net/packet.cpp (98%) rename storage/{stonedb => tianmu}/base/net/packet.h (99%) rename storage/{stonedb => tianmu}/base/net/packet_data_source.h (90%) rename storage/{stonedb => tianmu}/base/net/packet_util.h (96%) rename storage/{stonedb => tianmu}/base/net/posix_stack.cpp (99%) rename storage/{stonedb => tianmu}/base/net/posix_stack.h (96%) rename storage/{stonedb => tianmu}/base/net/socket_defs.h (94%) rename storage/{stonedb => tianmu}/base/net/stack.cpp (99%) rename storage/{stonedb => tianmu}/base/net/stack.h (94%) rename storage/{stonedb => tianmu}/base/util/bool_class.h (95%) rename storage/{stonedb => tianmu}/base/util/conversions.cpp (97%) rename storage/{stonedb => tianmu}/base/util/conversions.h (90%) rename storage/{stonedb => tianmu}/base/util/defer.h (92%) rename storage/{stonedb => tianmu}/base/util/function_input_iterator.h (92%) rename storage/{stonedb => tianmu}/base/util/gcc6-concepts.h (89%) rename storage/{stonedb => tianmu}/base/util/indirect.h (94%) rename storage/{stonedb => tianmu}/base/util/is_smart_ptr.h (86%) rename storage/{stonedb => tianmu}/base/util/lazy.h (96%) rename storage/{stonedb => tianmu}/base/util/log.cpp (96%) rename storage/{stonedb => tianmu}/base/util/log.h (97%) rename storage/{stonedb => tianmu}/base/util/log_cli.h (93%) rename storage/{stonedb => tianmu}/base/util/noncopyable_function.h (97%) rename storage/{stonedb => tianmu}/base/util/print_safe.h (95%) rename storage/{stonedb => tianmu}/base/util/program_options.cpp (98%) rename storage/{stonedb => tianmu}/base/util/program_options.h (94%) rename storage/{stonedb => tianmu}/base/util/reference_wrapper.h (93%) rename storage/{stonedb => tianmu}/base/util/spinlock.h (91%) rename storage/{stonedb => tianmu}/base/util/transform_iterator.h (90%) rename storage/{stonedb => tianmu}/base/util/tuple_utils.h (97%) rename storage/{stonedb => tianmu}/common/assert.h (90%) rename storage/{stonedb => tianmu}/common/common_definitions.cpp (96%) rename storage/{stonedb => tianmu}/common/common_definitions.h (92%) rename storage/{stonedb => tianmu}/common/compile_opts.h (84%) rename storage/{stonedb => tianmu}/common/data_format.cpp (97%) rename storage/{stonedb => tianmu}/common/data_format.h (92%) rename storage/{stonedb => tianmu}/common/defs.h (89%) rename storage/{stonedb => tianmu}/common/exception.cpp (92%) rename storage/{stonedb => tianmu}/common/exception.h (80%) rename storage/{stonedb => tianmu}/common/mysql_gate.cpp (97%) rename storage/{stonedb => tianmu}/common/mysql_gate.h (90%) rename storage/{stonedb => tianmu}/common/sequence_generator.h (88%) rename storage/{stonedb => tianmu}/common/txt_data_format.cpp (98%) rename storage/{stonedb => tianmu}/common/txt_data_format.h (87%) rename storage/{stonedb => tianmu}/compress/arith_coder.cpp (99%) rename storage/{stonedb => tianmu}/compress/arith_coder.h (95%) rename storage/{stonedb => tianmu}/compress/basic_data_filt.cpp (99%) rename storage/{stonedb => tianmu}/compress/basic_data_filt.h (95%) rename storage/{stonedb => tianmu}/compress/bit_stream_compressor.cpp (99%) rename storage/{stonedb => tianmu}/compress/bit_stream_compressor.h (95%) rename storage/{stonedb => tianmu}/compress/code_stream.h (94%) rename storage/{stonedb => tianmu}/compress/data_filt.h (94%) rename storage/{stonedb => tianmu}/compress/data_stream.cpp (97%) rename storage/{stonedb => tianmu}/compress/data_stream.h (97%) rename storage/{stonedb => tianmu}/compress/defs.h (94%) rename storage/{stonedb => tianmu}/compress/dictionary.cpp (97%) rename storage/{stonedb => tianmu}/compress/dictionary.h (96%) rename storage/{stonedb => tianmu}/compress/inc_alloc.cpp (98%) rename storage/{stonedb => tianmu}/compress/inc_alloc.h (95%) rename storage/{stonedb => tianmu}/compress/inc_wgraph.cpp (99%) rename storage/{stonedb => tianmu}/compress/inc_wgraph.h (97%) rename storage/{stonedb => tianmu}/compress/lz4.cpp (99%) rename storage/{stonedb => tianmu}/compress/lz4.h (99%) rename storage/{stonedb => tianmu}/compress/num_compressor.h (95%) rename storage/{stonedb => tianmu}/compress/part_dict.cpp (98%) rename storage/{stonedb => tianmu}/compress/part_dict.h (97%) rename storage/{stonedb => tianmu}/compress/ppm.cpp (99%) rename storage/{stonedb => tianmu}/compress/ppm.h (94%) rename storage/{stonedb => tianmu}/compress/ppm_defs.h (94%) rename storage/{stonedb => tianmu}/compress/range_code.h (97%) rename storage/{stonedb => tianmu}/compress/suffix_tree.cpp (99%) rename storage/{stonedb => tianmu}/compress/suffix_tree.h (98%) rename storage/{stonedb => tianmu}/compress/text_compressor.cpp (97%) rename storage/{stonedb => tianmu}/compress/text_compressor.h (97%) rename storage/{stonedb => tianmu}/compress/top_bit_dict.cpp (99%) rename storage/{stonedb => tianmu}/compress/top_bit_dict.h (93%) rename storage/{stonedb => tianmu}/compress/word_graph.cpp (99%) rename storage/{stonedb => tianmu}/compress/word_graph.h (98%) rename storage/{stonedb => tianmu}/core/aggregation_algorithm.cpp (99%) rename storage/{stonedb => tianmu}/core/aggregation_algorithm.h (93%) rename storage/{stonedb => tianmu}/core/aggregator.h (94%) rename storage/{stonedb => tianmu}/core/aggregator_advanced.cpp (97%) rename storage/{stonedb => tianmu}/core/aggregator_advanced.h (77%) rename storage/{stonedb => tianmu}/core/aggregator_basic.cpp (99%) rename storage/{stonedb => tianmu}/core/aggregator_basic.h (88%) rename storage/{stonedb => tianmu}/core/bin_tools.cpp (99%) rename storage/{stonedb => tianmu}/core/bin_tools.h (95%) rename storage/{stonedb => tianmu}/core/blocked_mem_table.cpp (99%) rename storage/{stonedb => tianmu}/core/blocked_mem_table.h (97%) rename storage/{stonedb => tianmu}/core/bloom_block.cpp (98%) rename storage/{stonedb => tianmu}/core/bloom_block.h (97%) rename storage/{stonedb => tianmu}/core/bloom_coding.cpp (99%) rename storage/{stonedb => tianmu}/core/bloom_coding.h (96%) rename storage/{stonedb => tianmu}/core/cached_buffer.cpp (99%) rename storage/{stonedb => tianmu}/core/cached_buffer.h (95%) rename storage/{stonedb => tianmu}/core/column.h (92%) rename storage/{stonedb => tianmu}/core/column_bin_encoder.cpp (99%) rename storage/{stonedb => tianmu}/core/column_bin_encoder.h (99%) rename storage/{stonedb => tianmu}/core/column_share.cpp (92%) rename storage/{stonedb => tianmu}/core/column_share.h (95%) rename storage/{stonedb => tianmu}/core/column_type.cpp (95%) rename storage/{stonedb => tianmu}/core/column_type.h (97%) rename storage/{stonedb => tianmu}/core/compilation_tools.cpp (97%) rename storage/{stonedb => tianmu}/core/compilation_tools.h (89%) rename storage/{stonedb => tianmu}/core/compiled_query.cpp (99%) rename storage/{stonedb => tianmu}/core/compiled_query.h (98%) rename storage/{stonedb => tianmu}/core/condition.cpp (98%) rename storage/{stonedb => tianmu}/core/condition.h (94%) rename storage/{stonedb => tianmu}/core/condition_encoder.cpp (98%) rename storage/{stonedb => tianmu}/core/condition_encoder.h (92%) rename storage/{stonedb => tianmu}/core/cq_term.cpp (98%) rename storage/{stonedb => tianmu}/core/cq_term.h (96%) rename storage/{stonedb => tianmu}/core/ctask.h (89%) rename storage/{stonedb => tianmu}/core/data_cache.cpp (98%) rename storage/{stonedb => tianmu}/core/data_cache.h (96%) rename storage/{stonedb => tianmu}/core/data_type.cpp (88%) rename storage/{stonedb => tianmu}/core/data_type.h (92%) rename storage/{stonedb => tianmu}/core/descriptor.cpp (99%) rename storage/{stonedb => tianmu}/core/descriptor.h (97%) rename storage/{stonedb => tianmu}/core/dimension_group.cpp (99%) rename storage/{stonedb => tianmu}/core/dimension_group.h (99%) rename storage/{stonedb => tianmu}/core/dimension_group_multiple.cpp (99%) rename storage/{stonedb => tianmu}/core/dimension_group_multiple.h (97%) rename storage/{stonedb => tianmu}/core/dimension_group_virtual.cpp (99%) rename storage/{stonedb => tianmu}/core/dimension_group_virtual.h (97%) rename storage/{stonedb => tianmu}/core/dimension_vector.h (95%) rename storage/{stonedb => tianmu}/core/dpn.h (96%) rename storage/{stonedb => tianmu}/core/engine.cpp (79%) rename storage/{stonedb => tianmu}/core/engine.h (84%) rename storage/{stonedb => tianmu}/core/engine_convert.cpp (93%) rename storage/{stonedb => tianmu}/core/engine_execute.cpp (85%) rename storage/{stonedb => tianmu}/core/engine_results.cpp (98%) rename storage/{stonedb => tianmu}/core/filter.cpp (99%) rename storage/{stonedb => tianmu}/core/filter.h (99%) rename storage/{stonedb => tianmu}/core/filter_block.cpp (99%) rename storage/{stonedb => tianmu}/core/filter_iterators.cpp (99%) rename storage/{stonedb => tianmu}/core/ftree.cpp (94%) rename storage/{stonedb => tianmu}/core/ftree.h (95%) rename storage/{stonedb => tianmu}/core/group_distinct_cache.cpp (97%) rename storage/{stonedb => tianmu}/core/group_distinct_cache.h (95%) rename storage/{stonedb => tianmu}/core/group_distinct_table.cpp (99%) rename storage/{stonedb => tianmu}/core/group_distinct_table.h (96%) rename storage/{stonedb => tianmu}/core/group_table.cpp (99%) rename storage/{stonedb => tianmu}/core/group_table.h (96%) rename storage/{stonedb => tianmu}/core/groupby_wrapper.cpp (99%) rename storage/{stonedb => tianmu}/core/groupby_wrapper.h (98%) rename storage/{stonedb => tianmu}/core/hash_table.cpp (99%) rename storage/{stonedb => tianmu}/core/hash_table.h (95%) rename storage/{stonedb => tianmu}/core/index_table.cpp (94%) rename storage/{stonedb => tianmu}/core/index_table.h (96%) rename storage/{stonedb/core/item_sdbfield.cpp => tianmu/core/item_tianmu_field.cpp} (63%) rename storage/{stonedb/core/item_sdbfield.h => tianmu/core/item_tianmu_field.h} (75%) rename storage/{stonedb => tianmu}/core/join_thread_table.cpp (99%) rename storage/{stonedb => tianmu}/core/join_thread_table.h (97%) rename storage/{stonedb => tianmu}/core/joiner.cpp (94%) rename storage/{stonedb => tianmu}/core/joiner.h (96%) rename storage/{stonedb => tianmu}/core/joiner_general.cpp (99%) rename storage/{stonedb => tianmu}/core/joiner_hash.cpp (98%) rename storage/{stonedb => tianmu}/core/joiner_hash.h (96%) rename storage/{stonedb => tianmu}/core/joiner_hash_table.cpp (99%) rename storage/{stonedb => tianmu}/core/joiner_hash_table.h (97%) rename storage/{stonedb => tianmu}/core/joiner_mapped.cpp (99%) rename storage/{stonedb => tianmu}/core/joiner_mapped.h (97%) rename storage/{stonedb => tianmu}/core/joiner_sort.cpp (99%) rename storage/{stonedb => tianmu}/core/joiner_sort.h (97%) rename storage/{stonedb => tianmu}/core/joner_hash.h (96%) rename storage/{stonedb => tianmu}/core/just_a_table.cpp (97%) rename storage/{stonedb => tianmu}/core/just_a_table.h (93%) rename storage/{stonedb => tianmu}/core/mi_iterator.cpp (99%) rename storage/{stonedb => tianmu}/core/mi_iterator.h (98%) rename storage/{stonedb => tianmu}/core/mi_new_contents.cpp (99%) rename storage/{stonedb => tianmu}/core/mi_new_contents.h (96%) rename storage/{stonedb => tianmu}/core/mi_rough_sorter.cpp (99%) rename storage/{stonedb => tianmu}/core/mi_rough_sorter.h (97%) rename storage/{stonedb => tianmu}/core/mi_step_iterator.cpp (97%) rename storage/{stonedb => tianmu}/core/mi_step_iterator.h (89%) rename storage/{stonedb => tianmu}/core/mi_updating_iterator.cpp (99%) rename storage/{stonedb => tianmu}/core/mi_updating_iterator.h (96%) rename storage/{stonedb => tianmu}/core/multi_index.cpp (99%) rename storage/{stonedb => tianmu}/core/multi_index.h (98%) rename storage/{stonedb => tianmu}/core/multi_index_builder.cpp (99%) rename storage/{stonedb => tianmu}/core/multi_index_builder.h (93%) rename storage/{stonedb => tianmu}/core/mysql_expression.cpp (80%) rename storage/{stonedb => tianmu}/core/mysql_expression.h (88%) rename storage/{stonedb => tianmu}/core/object_cache.h (92%) rename storage/{stonedb => tianmu}/core/pack.cpp (93%) rename storage/{stonedb => tianmu}/core/pack.h (96%) rename storage/{stonedb => tianmu}/core/pack_guardian.cpp (98%) rename storage/{stonedb => tianmu}/core/pack_guardian.h (91%) rename storage/{stonedb => tianmu}/core/pack_int.cpp (98%) rename storage/{stonedb => tianmu}/core/pack_int.h (94%) rename storage/{stonedb => tianmu}/core/pack_orderer.cpp (99%) rename storage/{stonedb => tianmu}/core/pack_orderer.h (96%) rename storage/{stonedb => tianmu}/core/pack_str.cpp (99%) rename storage/{stonedb => tianmu}/core/pack_str.h (96%) rename storage/{stonedb => tianmu}/core/parallel_hash_join.cpp (97%) rename storage/{stonedb => tianmu}/core/parallel_hash_join.h (98%) rename storage/{stonedb => tianmu}/core/parameterized_filter.cpp (99%) rename storage/{stonedb => tianmu}/core/parameterized_filter.h (95%) rename storage/{stonedb => tianmu}/core/physical_column.h (98%) rename storage/{stonedb => tianmu}/core/proxy_hash_joiner.cpp (95%) rename storage/{stonedb => tianmu}/core/proxy_hash_joiner.h (88%) rename storage/{stonedb => tianmu}/core/query.cpp (98%) rename storage/{stonedb => tianmu}/core/query.h (96%) rename storage/{stonedb => tianmu}/core/query_compile.cpp (95%) rename storage/{stonedb => tianmu}/core/query_operator.h (93%) rename storage/{stonedb => tianmu}/core/quick_math.cpp (97%) rename storage/{stonedb => tianmu}/core/quick_math.h (94%) rename storage/{stonedb => tianmu}/core/rc_attr.cpp (96%) rename storage/{stonedb => tianmu}/core/rc_attr.h (98%) rename storage/{stonedb => tianmu}/core/rc_attr_typeinfo.cpp (97%) rename storage/{stonedb => tianmu}/core/rc_attr_typeinfo.h (96%) rename storage/{stonedb => tianmu}/core/rc_mem_table.cpp (95%) rename storage/{stonedb => tianmu}/core/rc_mem_table.h (93%) rename storage/{stonedb => tianmu}/core/rc_table.cpp (95%) rename storage/{stonedb => tianmu}/core/rc_table.h (97%) rename storage/{stonedb => tianmu}/core/rcattr_exeq_rs.cpp (99%) rename storage/{stonedb => tianmu}/core/rcattr_exqp.cpp (98%) rename storage/{stonedb => tianmu}/core/rough_multi_index.cpp (99%) rename storage/{stonedb => tianmu}/core/rough_multi_index.h (96%) rename storage/{stonedb => tianmu}/core/rough_value.cpp (95%) rename storage/{stonedb => tianmu}/core/rough_value.h (87%) rename storage/{stonedb => tianmu}/core/rsi_bloom.cpp (93%) rename storage/{stonedb => tianmu}/core/rsi_bloom.h (91%) rename storage/{stonedb => tianmu}/core/rsi_cmap.cpp (96%) rename storage/{stonedb => tianmu}/core/rsi_cmap.h (95%) rename storage/{stonedb => tianmu}/core/rsi_histogram.cpp (98%) rename storage/{stonedb => tianmu}/core/rsi_histogram.h (95%) rename storage/{stonedb => tianmu}/core/rsi_index.h (89%) rename storage/{stonedb => tianmu}/core/sorter3.cpp (96%) rename storage/{stonedb => tianmu}/core/sorter3.h (98%) rename storage/{stonedb => tianmu}/core/sorter_wrapper.cpp (98%) rename storage/{stonedb => tianmu}/core/sorter_wrapper.h (95%) rename storage/{stonedb => tianmu}/core/table_share.cpp (89%) rename storage/{stonedb => tianmu}/core/table_share.h (92%) rename storage/{stonedb => tianmu}/core/task_executor.cpp (96%) rename storage/{stonedb/async_tests => tianmu/core}/task_executor.h (91%) rename storage/{stonedb => tianmu}/core/temp_table.cpp (99%) rename storage/{stonedb => tianmu}/core/temp_table.h (99%) rename storage/{stonedb => tianmu}/core/temp_table_com.cpp (98%) rename storage/{stonedb => tianmu}/core/temp_table_low.cpp (94%) rename storage/{stonedb => tianmu}/core/temp_table_roughquery.cpp (99%) rename storage/{stonedb => tianmu}/core/tools.h (98%) rename storage/{stonedb => tianmu}/core/transaction.cpp (93%) rename storage/{stonedb => tianmu}/core/transaction.h (95%) rename storage/{stonedb => tianmu}/core/value.h (94%) rename storage/{stonedb => tianmu}/core/value_matching_hashtable.cpp (99%) rename storage/{stonedb => tianmu}/core/value_matching_hashtable.h (94%) rename storage/{stonedb => tianmu}/core/value_matching_table.cpp (99%) rename storage/{stonedb => tianmu}/core/value_matching_table.h (97%) rename storage/{stonedb => tianmu}/core/value_or_null.cpp (98%) rename storage/{stonedb => tianmu}/core/value_or_null.h (94%) rename storage/{stonedb => tianmu}/core/value_set.cpp (99%) rename storage/{stonedb => tianmu}/core/value_set.h (96%) rename storage/{stonedb => tianmu}/core/var_id.h (89%) rename storage/{stonedb => tianmu}/exporter/data_exporter.cpp (97%) rename storage/{stonedb => tianmu}/exporter/data_exporter.h (92%) rename storage/{stonedb => tianmu}/exporter/data_exporter_txt.cpp (99%) rename storage/{stonedb => tianmu}/exporter/data_exporter_txt.h (91%) rename storage/{stonedb => tianmu}/exporter/export2file.cpp (81%) rename storage/{stonedb => tianmu}/exporter/export2file.h (77%) rename storage/{stonedb => tianmu}/handler/ha_rcengine.cpp (55%) rename storage/{stonedb => tianmu}/handler/ha_rcengine.h (57%) rename storage/{stonedb/handler/stonedb_handler.cpp => tianmu/handler/tianmu_handler.cpp} (83%) rename storage/{stonedb/handler/stonedb_handler.h => tianmu/handler/tianmu_handler.h} (92%) rename storage/{stonedb/handler/stonedb_handler_com.cpp => tianmu/handler/tianmu_handler_com.cpp} (75%) rename storage/{stonedb => tianmu}/index/kv_store.cpp (90%) rename storage/{stonedb => tianmu}/index/kv_store.h (97%) rename storage/{stonedb => tianmu}/index/kv_transaction.cpp (98%) rename storage/{stonedb => tianmu}/index/kv_transaction.h (94%) rename storage/{stonedb => tianmu}/index/rc_table_index.cpp (93%) rename storage/{stonedb => tianmu}/index/rc_table_index.h (95%) rename storage/{stonedb => tianmu}/index/rdb_meta_manager.cpp (96%) rename storage/{stonedb => tianmu}/index/rdb_meta_manager.h (98%) rename storage/{stonedb => tianmu}/index/rdb_utils.h (95%) rename storage/{stonedb => tianmu}/loader/load_parser.cpp (98%) rename storage/{stonedb => tianmu}/loader/load_parser.h (93%) rename storage/{stonedb => tianmu}/loader/parsing_strategy.cpp (98%) rename storage/{stonedb => tianmu}/loader/parsing_strategy.h (93%) rename storage/{stonedb => tianmu}/loader/read_buffer.cpp (85%) rename storage/{stonedb => tianmu}/loader/read_buffer.h (90%) rename storage/{stonedb => tianmu}/loader/rejecter.cpp (82%) rename storage/{stonedb => tianmu}/loader/rejecter.h (85%) rename storage/{stonedb => tianmu}/loader/value_cache.cpp (98%) rename storage/{stonedb => tianmu}/loader/value_cache.h (95%) rename storage/{stonedb => tianmu}/mm/heap_policy.h (90%) rename storage/{stonedb => tianmu}/mm/huge_heap_policy.cpp (96%) rename storage/{stonedb => tianmu}/mm/huge_heap_policy.h (86%) rename storage/{stonedb => tianmu}/mm/initializer.cpp (95%) rename storage/{stonedb => tianmu}/mm/initializer.h (93%) rename storage/{stonedb => tianmu}/mm/memory_block.h (86%) rename storage/{stonedb => tianmu}/mm/memory_handling_policy.cpp (94%) rename storage/{stonedb => tianmu}/mm/memory_handling_policy.h (95%) rename storage/{stonedb => tianmu}/mm/mm_guard.h (95%) rename storage/{stonedb => tianmu}/mm/mysql_heap_policy.cpp (97%) rename storage/{stonedb => tianmu}/mm/mysql_heap_policy.h (88%) rename storage/{stonedb => tianmu}/mm/numa_heap_policy.cpp (98%) rename storage/{stonedb => tianmu}/mm/numa_heap_policy.h (89%) rename storage/{stonedb => tianmu}/mm/reference_object.h (89%) rename storage/{stonedb => tianmu}/mm/release2q.cpp (96%) rename storage/{stonedb => tianmu}/mm/release2q.h (95%) rename storage/{stonedb => tianmu}/mm/release_all.cpp (96%) rename storage/{stonedb => tianmu}/mm/release_all.h (90%) rename storage/{stonedb => tianmu}/mm/release_fifo.cpp (97%) rename storage/{stonedb => tianmu}/mm/release_fifo.h (90%) rename storage/{stonedb => tianmu}/mm/release_lru.cpp (97%) rename storage/{stonedb => tianmu}/mm/release_lru.h (90%) rename storage/{stonedb => tianmu}/mm/release_null.h (90%) rename storage/{stonedb => tianmu}/mm/release_strategy.h (90%) rename storage/{stonedb => tianmu}/mm/release_tracker.cpp (98%) rename storage/{stonedb => tianmu}/mm/release_tracker.h (93%) rename storage/{stonedb => tianmu}/mm/sys_heap_policy.cpp (97%) rename storage/{stonedb => tianmu}/mm/sys_heap_policy.h (89%) rename storage/{stonedb => tianmu}/mm/tcm/linked_list.h (93%) rename storage/{stonedb => tianmu}/mm/tcm/page_heap.cpp (99%) rename storage/{stonedb => tianmu}/mm/tcm/page_heap.h (98%) rename storage/{stonedb => tianmu}/mm/tcm/page_heap_allocator.h (95%) rename storage/{stonedb => tianmu}/mm/tcm/pagemap.h (98%) rename storage/{stonedb => tianmu}/mm/tcm/span.cpp (98%) rename storage/{stonedb => tianmu}/mm/tcm/span.h (96%) rename storage/{stonedb => tianmu}/mm/tcm/tccommon.cpp (99%) rename storage/{stonedb => tianmu}/mm/tcm/tccommon.h (97%) rename storage/{stonedb => tianmu}/mm/tcm_heap_policy.cpp (98%) rename storage/{stonedb => tianmu}/mm/tcm_heap_policy.h (94%) rename storage/{stonedb => tianmu}/mm/traceable_object.cpp (96%) rename storage/{stonedb => tianmu}/mm/traceable_object.h (94%) rename storage/{stonedb => tianmu}/system/cacheable_item.cpp (96%) rename storage/{stonedb => tianmu}/system/cacheable_item.h (91%) rename storage/{stonedb => tianmu}/system/channel.cpp (99%) rename storage/{stonedb => tianmu}/system/channel.h (94%) rename storage/{stonedb => tianmu}/system/channel_out.h (93%) create mode 100644 storage/tianmu/system/configuration.cpp create mode 100644 storage/tianmu/system/configuration.h rename storage/{stonedb => tianmu}/system/fet.cpp (96%) rename storage/{stonedb => tianmu}/system/fet.h (87%) rename storage/{stonedb => tianmu}/system/file.cpp (67%) rename storage/{stonedb => tianmu}/system/file_out.h (95%) rename storage/{stonedb => tianmu}/system/file_system.cpp (85%) rename storage/{stonedb => tianmu}/system/file_system.h (94%) rename storage/{stonedb => tianmu}/system/io_parameters.h (97%) rename storage/{stonedb => tianmu}/system/large_buffer.cpp (84%) rename storage/{stonedb => tianmu}/system/large_buffer.h (92%) rename storage/{stonedb => tianmu}/system/mag_memory_policy.h (89%) rename storage/{stonedb => tianmu}/system/net_stream.cpp (94%) rename storage/{stonedb => tianmu}/system/net_stream.h (91%) rename storage/{stonedb => tianmu}/system/rc_system.cpp (96%) rename storage/{stonedb => tianmu}/system/rc_system.h (90%) rename storage/{stonedb => tianmu}/system/res_manager.cpp (89%) rename storage/{stonedb => tianmu}/system/res_manager.h (87%) rename storage/{stonedb => tianmu}/system/res_manager_base.cpp (95%) rename storage/{stonedb => tianmu}/system/res_manager_base.h (84%) rename storage/{stonedb => tianmu}/system/res_manager_policy.h (83%) rename storage/{stonedb => tianmu}/system/stdout.h (95%) rename storage/{stonedb => tianmu}/system/stream.cpp (96%) rename storage/{stonedb => tianmu}/system/stream.h (91%) rename storage/{stonedb/system/stonedb_file.h => tianmu/system/tianmu_file.h} (85%) rename storage/{stonedb => tianmu}/system/txt_utils.cpp (98%) rename storage/{stonedb => tianmu}/system/txt_utils.h (90%) rename storage/{stonedb => tianmu}/types/bstring.cpp (98%) rename storage/{stonedb => tianmu}/types/rc_data_types.cpp (99%) rename storage/{stonedb => tianmu}/types/rc_data_types.h (97%) rename storage/{stonedb => tianmu}/types/rc_datetime.cpp (92%) rename storage/{stonedb => tianmu}/types/rc_item_types.cpp (97%) rename storage/{stonedb => tianmu}/types/rc_item_types.h (95%) rename storage/{stonedb => tianmu}/types/rc_num.cpp (97%) rename storage/{stonedb => tianmu}/types/rc_num.h (96%) rename storage/{stonedb => tianmu}/types/rc_value_object.cpp (96%) rename storage/{stonedb => tianmu}/types/text_stat.cpp (99%) rename storage/{stonedb => tianmu}/types/text_stat.h (95%) rename storage/{stonedb => tianmu}/types/value_parser4txt.cpp (86%) rename storage/{stonedb => tianmu}/types/value_parser4txt.h (92%) rename storage/{stonedb => tianmu}/util/bitset.h (92%) rename storage/{stonedb => tianmu}/util/circ_buf.h (91%) rename storage/{stonedb => tianmu}/util/fs.h (87%) rename storage/{stonedb => tianmu}/util/hash64.h (95%) rename storage/{stonedb => tianmu}/util/log_ctl.cpp (70%) rename storage/{stonedb => tianmu}/util/log_ctl.h (78%) rename storage/{stonedb => tianmu}/util/mapped_circular_buffer.h (92%) rename storage/{stonedb => tianmu}/util/qsort.h (74%) rename storage/{stonedb => tianmu}/util/stack_trace.cpp (97%) rename storage/{stonedb => tianmu}/util/stack_trace.h (85%) rename storage/{stonedb => tianmu}/util/thread_pool.cpp (95%) rename storage/{stonedb => tianmu}/util/thread_pool.h (92%) rename storage/{stonedb => tianmu}/util/timer.cpp (88%) rename storage/{stonedb => tianmu}/util/timer.h (85%) rename storage/{stonedb => tianmu}/vc/const_column.cpp (99%) rename storage/{stonedb => tianmu}/vc/const_column.h (94%) rename storage/{stonedb => tianmu}/vc/const_expr_column.cpp (96%) rename storage/{stonedb => tianmu}/vc/const_expr_column.h (97%) rename storage/{stonedb => tianmu}/vc/expr_column.cpp (99%) rename storage/{stonedb => tianmu}/vc/expr_column.h (93%) rename storage/{stonedb => tianmu}/vc/in_set_column.cpp (97%) rename storage/{stonedb => tianmu}/vc/in_set_column.h (96%) rename storage/{stonedb => tianmu}/vc/multi_value_column.h (96%) rename storage/{stonedb => tianmu}/vc/single_column.cpp (99%) rename storage/{stonedb => tianmu}/vc/single_column.h (95%) rename storage/{stonedb => tianmu}/vc/subselect_column.cpp (96%) rename storage/{stonedb => tianmu}/vc/subselect_column.h (96%) rename storage/{stonedb => tianmu}/vc/type_cast_column.cpp (99%) rename storage/{stonedb => tianmu}/vc/type_cast_column.h (97%) rename storage/{stonedb => tianmu}/vc/virtual_column.h (92%) rename storage/{stonedb => tianmu}/vc/virtual_column_base.cpp (99%) rename storage/{stonedb => tianmu}/vc/virtual_column_base.h (98%) diff --git a/.github/workflows/integration-compile-mtr.yml b/.github/workflows/integration-compile-mtr.yml index 08ad8dfce4..07dcc72ef2 100644 --- a/.github/workflows/integration-compile-mtr.yml +++ b/.github/workflows/integration-compile-mtr.yml @@ -105,4 +105,4 @@ jobs: sudo mkdir -p /stonedb57/install/log sudo chown -R mysql:mysql /stonedb57 cd /stonedb57/install/mysql-test - sudo ./mysql-test-run.pl --suite=stonedb --nowarnings --force --nocheck-testcases + sudo ./mysql-test-run.pl --suite=tianmu --nowarnings --force --nocheck-testcases diff --git a/.mergify.yml b/.mergify.yml index e5577bd0bb..3e8e05404a 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -32,7 +32,7 @@ pull_request_rules: actions: comment: message: | - This pull request's title is not fulfill the requirements. @{{author}} please update it :point_down:. + This pull request's title should follow requirements next. @{{author}} please check it :point_down:. Valid format: diff --git a/CMakeLists.txt b/CMakeLists.txt index c6236ee303..c2f0c1aa75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -583,7 +583,7 @@ INCLUDE(configure.cmake) # Common defines and includes ADD_DEFINITIONS(-DHAVE_CONFIG_H) -ADD_DEFINITIONS(-DSTONEDB) +ADD_DEFINITIONS(-DTIANMU) INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_SOURCE_DIR}/extra/rapidjson/include diff --git a/client/mysql.cc b/client/mysql.cc index bdfb5623a8..a46564b3f8 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1291,7 +1291,7 @@ int main(int argc,char *argv[]) #endif my_getopt_use_args_separator= TRUE; -#if defined(STONEDB) +#if defined(TIANMU) if (load_defaults(MYSQL_CONFIG_NAME,load_default_groups,&argc,&argv)) #else if (load_defaults("my",load_default_groups,&argc,&argv)) @@ -1941,7 +1941,7 @@ static void usage(int version) } } my_print_help(my_long_options); -#if defined(STONEDB) +#if defined(TIANMU) print_defaults(MYSQL_CONFIG_NAME, load_default_groups); #else print_defaults("my", load_default_groups); diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 2822d80fe1..91067467eb 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -355,7 +355,7 @@ int main(int argc,char *argv[]) MY_INIT(argv[0]); mysql_init(&mysql); my_getopt_use_args_separator= TRUE; -#if defined(STONEDB) +#if defined(TIANMU) if (load_defaults(MYSQL_CONFIG_NAME,load_default_groups,&argc,&argv)) #else if (load_defaults("my",load_default_groups,&argc,&argv)) @@ -1297,7 +1297,7 @@ static void usage(void) } my_print_help(my_long_options); my_print_variables(my_long_options); -#if defined(STONEDB) +#if defined(TIANMU) print_defaults(MYSQL_CONFIG_NAME,load_default_groups); #else print_defaults("my",load_default_groups); diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index a9b55f5dc0..086e15f249 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -3382,7 +3382,7 @@ int main(int argc, char** argv) buff_ev= new Buff_ev(PSI_NOT_INSTRUMENTED); my_getopt_use_args_separator= TRUE; -#if defined(STONEDB) +#if defined(TIANMU) if (load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv)) #else if (load_defaults("my", load_default_groups, &argc, &argv)) diff --git a/client/mysqldump.c b/client/mysqldump.c index 0784f1a574..d9f25952f2 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -669,7 +669,7 @@ static void usage(void) puts(ORACLE_WELCOME_COPYRIGHT_NOTICE(COPYRIGHT_NOTICE_STONEDB_BEGIN_YEAR)); puts("Dumping structure and contents of MySQL databases and tables."); short_usage_sub(); -#if defined(STONEDB) +#if defined(TIANMU) print_defaults(MYSQL_CONFIG_NAME,load_default_groups); #else print_defaults("my",load_default_groups); @@ -1017,7 +1017,7 @@ static int get_options(int *argc, char ***argv) md_result_file= stdout; my_getopt_use_args_separator= TRUE; -#if defined(STONEDB) +#if defined(TIANMU) if (load_defaults(MYSQL_CONFIG_NAME,load_default_groups,argc,argv)) #else if (load_defaults("my",load_default_groups,argc,argv)) diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 9a651a42f3..1887155ce0 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -234,7 +234,7 @@ read the text file directly. In other cases the client will open the text\n\ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n"); printf("\nUsage: %s [OPTIONS] database textfile...",my_progname); -#if defined(STONEDB) +#if defined(TIANMU) print_defaults(MYSQL_CONFIG_NAME,load_default_groups); #else print_defaults("my",load_default_groups); @@ -669,7 +669,7 @@ int main(int argc, char **argv) MY_INIT(argv[0]); my_getopt_use_args_separator= TRUE; -#if defined(STONEDB) +#if defined(TIANMU) if (load_defaults(MYSQL_CONFIG_NAME,load_default_groups,&argc,&argv)) #else if (load_defaults("my",load_default_groups,&argc,&argv)) diff --git a/client/mysqlshow.c b/client/mysqlshow.c index 87d5389d1b..fcf378f1c9 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -82,7 +82,7 @@ int main(int argc, char **argv) MY_INIT(argv[0]); my_getopt_use_args_separator= TRUE; -#if defined(STONEDB) +#if defined(TIANMU) if (load_defaults(MYSQL_CONFIG_NAME,load_default_groups,&argc,&argv)) #else if (load_defaults("my",load_default_groups,&argc,&argv)) @@ -314,7 +314,7 @@ If no database is given then all matching databases are shown.\n\ If no table is given, then all matching tables in database are shown.\n\ If no column is given, then all matching columns and column types in table\n\ are shown."); -#if defined(STONEDB) +#if defined(TIANMU) print_defaults(MYSQL_CONFIG_NAME,load_default_groups); #else print_defaults("my",load_default_groups); diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 53b1847c05..9a01422055 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -7362,7 +7362,7 @@ get_one_option(int optid, const struct my_option *opt, char *argument) int parse_args(int argc, char **argv) { -#if defined(STONEDB) +#if defined(TIANMU) if (load_defaults(MYSQL_CONFIG_NAME,load_default_groups,&argc,&argv)) #else if (load_defaults("my",load_default_groups,&argc,&argv)) diff --git a/include/my_global.h b/include/my_global.h index fc1e093573..64337b54d7 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -584,7 +584,7 @@ typedef char my_bool; /* Small bool */ /* Macros for converting *constants* to the right type */ #define MYF(v) (myf) (v) -//STONEDB UPGRADE +//TIANMU UPGRADE #ifndef USING_X #define reg1 register #endif diff --git a/install_scripts/my.cnf b/install_scripts/my.cnf index f51adacfa6..73960e6c03 100755 --- a/install_scripts/my.cnf +++ b/install_scripts/my.cnf @@ -153,7 +153,7 @@ loose-performance-schema-consumer-thread-instrumentation=ON binlog-direct-non-transactional-updates -default-storage-engine=stonedb +default-storage-engine=tianmu #use_stat_tables=preferably # here, at the end of [mysqld] group mtr will automatically disable diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 112da0e0be..0f3df022e2 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -559,7 +559,7 @@ int init_embedded_server(int argc, char **argv, char **groups) orig_argc= *argcp; orig_argv= *argvp; -#if defined(STONEDB) +#if defined(TIANMU) if (load_defaults(MYSQL_CONFIG_NAME, (const char **)groups, argcp, argvp)) #else if (load_defaults("my", (const char **)groups, argcp, argvp)) diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index 12cffb0291..6cc9fa9938 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -115,7 +115,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, { mysql_read_default_options(&mysql->options, (mysql->options.my_cnf_file ? -#if defined(STONEDB) +#if defined(TIANMU) mysql->options.my_cnf_file : MYSQL_CONFIG_NAME), #else mysql->options.my_cnf_file : "my"), diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index c27e226a04..e0848e0af9 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -77,5 +77,5 @@ binlog-direct-non-transactional-updates loose-show-compatibility-56=ON -stonedb_insert_delayed = 0 -stonedb_ini_allowmysqlquerypath=1 +tianmu_insert_delayed = 0 +tianmu_ini_allowmysqlquerypath=1 diff --git a/mysql-test/std_data/stonedb/bigdata4load b/mysql-test/std_data/tianmu/bigdata4load similarity index 100% rename from mysql-test/std_data/stonedb/bigdata4load rename to mysql-test/std_data/tianmu/bigdata4load diff --git a/mysql-test/std_data/stonedb/column_type_test.frm b/mysql-test/std_data/tianmu/column_type_test.frm similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.frm rename to mysql-test/std_data/tianmu/column_type_test.frm diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00000.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00000.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00000.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00000.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00000000000000.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00000000000000.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00000000000000.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00000000000000.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00000000000001.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00000000000001.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00000000000001.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00000000000001.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00000DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00000DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00000DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00000DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00001.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00001.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00001.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00001.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00001000000000.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00001000000000.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00001000000000.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00001000000000.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00001000000001.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00001000000001.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00001000000001.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00001000000001.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00001DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00001DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00001DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00001DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00002.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00002.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00002.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00002.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00002000000000.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00002000000000.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00002000000000.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00002000000000.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00002000000001.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00002000000001.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00002000000001.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00002000000001.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00002DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00002DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00002DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00002DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00003.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00003.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00003.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00003.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00003000000000.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00003000000000.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00003000000000.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00003000000000.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00003000000001.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00003000000001.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00003000000001.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00003000000001.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00003DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00003DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00003DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00003DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00004.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00004.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00004.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00004.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00004000000000.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00004000000000.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00004000000000.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00004000000000.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00004000000001.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00004000000001.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00004000000001.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00004000000001.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00004DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00004DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00004DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00004DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00005.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00005.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00005.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00005.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00005DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00005DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00005DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00005DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00006.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00006.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00006.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00006.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00006DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00006DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00006DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00006DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00007.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00007.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00007.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00007.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00007000000000.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00007000000000.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00007000000000.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00007000000000.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00007000000001.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00007000000001.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00007000000001.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00007000000001.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00007DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00007DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00007DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00007DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00008.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00008.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00008.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00008.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00008DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00008DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00008DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00008DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00009.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00009.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00009.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00009.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00009DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00009DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00009DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00009DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00010.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00010.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00010.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00010.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00010000000000.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00010000000000.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00010000000000.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00010000000000.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00010000000001.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00010000000001.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00010000000001.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00010000000001.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00010DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00010DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00010DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00010DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00011.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00011.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00011.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00011.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00011DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00011DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00011DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00011DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00012.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00012.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00012.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00012.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00012000000000.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00012000000000.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00012000000000.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00012000000000.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00012000000001.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00012000000001.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00012000000001.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00012000000001.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00012DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00012DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00012DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00012DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00013.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00013.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00013.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00013.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00013000000000.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00013000000000.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00013000000000.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00013000000000.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00013000000001.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00013000000001.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00013000000001.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00013000000001.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00013DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00013DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00013DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00013DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00014.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00014.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00014.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00014.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00014DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00014DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00014DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00014DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00015.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00015.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00015.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00015.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00015000000000.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00015000000000.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00015000000000.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00015000000000.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00015000000001.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00015000000001.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00015000000001.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00015000000001.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00015DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00015DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00015DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00015DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00016.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00016.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00016.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00016.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TA00016DPN.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TA00016DPN.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TA00016DPN.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TA00016DPN.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00000.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00000.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00000.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00000.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00001.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00001.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00001.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00001.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00002.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00002.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00002.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00002.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00003.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00003.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00003.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00003.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00004.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00004.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00004.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00004.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00005.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00005.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00005.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00005.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00006.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00006.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00006.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00006.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00007.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00007.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00007.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00007.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00008.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00008.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00008.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00008.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00009.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00009.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00009.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00009.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00010.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00010.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00010.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00010.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00011.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00011.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00011.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00011.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00012.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00012.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00012.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00012.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00013.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00013.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00013.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00013.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00014.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00014.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00014.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00014.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00015.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00015.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00015.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00015.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/TB00016.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/TB00016.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/TB00016.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/TB00016.ctb diff --git a/mysql-test/std_data/stonedb/column_type_test.bht/Table.ctb b/mysql-test/std_data/tianmu/column_type_test.tm/Table.ctb similarity index 100% rename from mysql-test/std_data/stonedb/column_type_test.bht/Table.ctb rename to mysql-test/std_data/tianmu/column_type_test.tm/Table.ctb diff --git a/mysql-test/std_data/stonedb/loadfile b/mysql-test/std_data/tianmu/loadfile similarity index 100% rename from mysql-test/std_data/stonedb/loadfile rename to mysql-test/std_data/tianmu/loadfile diff --git a/mysql-test/suite/stonedb/r/issue410.result b/mysql-test/suite/stonedb/r/issue410.result deleted file mode 100644 index ac0d6ec4a5..0000000000 --- a/mysql-test/suite/stonedb/r/issue410.result +++ /dev/null @@ -1,8 +0,0 @@ -use test; -create table tlike (val varchar(255)) ENGINE=STONEDB; -insert into tlike values ('abcde'); -select * from tlike where val like NULL; -val -Warnings: -Note 1105 Query syntax not implemented in Stonedb, executed by MySQL engine. -drop table tlike; diff --git a/mysql-test/suite/stonedb_upgrade/t/upgrade.test b/mysql-test/suite/stonedb_upgrade/t/upgrade.test index 2ef4d07c5a..f87c76ac34 100644 --- a/mysql-test/suite/stonedb_upgrade/t/upgrade.test +++ b/mysql-test/suite/stonedb_upgrade/t/upgrade.test @@ -19,153 +19,153 @@ select * from t1; drop table t1; ---mkdir $MYSQLD_DATADIR/test/column_type_test.bht +--mkdir $MYSQLD_DATADIR/test/column_type_test.tm --copy_file std_data/stonedb/column_type_test.frm $MYSQLD_DATADIR/test/column_type_test.frm ---copy_file std_data/stonedb/column_type_test.bht/TA00000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00005.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00005.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00005DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00005DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00006.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00006.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00006DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00006DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00008.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00008.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00008DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00008DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00009.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00009.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00009DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00009DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00011.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00011.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00011DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00011DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00014.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00014.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00014DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00014DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00016.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00016.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00016DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00016DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00002.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00002.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00003.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00003.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00004.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00004.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00005.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00005.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00006.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00006.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00007.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00007.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00008.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00008.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00009.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00009.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00010.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00010.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00011.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00011.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00012.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00012.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00013.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00013.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00014.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00014.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00015.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00015.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00016.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00016.ctb ---copy_file std_data/stonedb/column_type_test.bht/Table.ctb $MYSQLD_DATADIR/test/column_type_test.bht/Table.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00005.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00005.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00005DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00005DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00006.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00006.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00006DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00006DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00008.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00008.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00008DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00008DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00009.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00009.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00009DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00009DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00011.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00011.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00011DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00011DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00014.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00014.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00014DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00014DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00016.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00016.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00016DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00016DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00002.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00002.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00003.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00003.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00004.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00004.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00005.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00005.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00006.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00006.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00007.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00007.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00008.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00008.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00009.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00009.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00010.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00010.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00011.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00011.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00012.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00012.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00013.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00013.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00014.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00014.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00015.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00015.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00016.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00016.ctb +--copy_file std_data/stonedb/column_type_test.tm/Table.ctb $MYSQLD_DATADIR/test/column_type_test.tm/Table.ctb --chmod 0777 $MYSQLD_DATADIR/test/column_type_test.frm ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00005.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00005DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00006.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00006DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00008.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00008DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00009.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00009DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00011.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00011DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00014.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00014DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00016.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00016DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00002.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00003.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00004.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00005.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00006.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00007.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00008.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00009.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00010.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00011.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00012.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00013.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00014.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00015.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00016.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/Table.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00005.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00005DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00006.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00006DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00008.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00008DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00009.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00009DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00011.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00011DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00014.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00014DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00016.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00016DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00002.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00003.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00004.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00005.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00006.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00007.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00008.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00009.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00010.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00011.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00012.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00013.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00014.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00015.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00016.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/Table.ctb SHOW CREATE TABLE column_type_test; select * from column_type_test; drop table column_type_test; diff --git a/mysql-test/suite/stonedb_upgrade/t/upgrade_add_coloumn.test b/mysql-test/suite/stonedb_upgrade/t/upgrade_add_coloumn.test index 4e6ed1ba81..9dc125479b 100644 --- a/mysql-test/suite/stonedb_upgrade/t/upgrade_add_coloumn.test +++ b/mysql-test/suite/stonedb_upgrade/t/upgrade_add_coloumn.test @@ -19,153 +19,153 @@ select * from t1; drop table t1; ---mkdir $MYSQLD_DATADIR/test/column_type_test.bht +--mkdir $MYSQLD_DATADIR/test/column_type_test.tm --copy_file std_data/stonedb/column_type_test.frm $MYSQLD_DATADIR/test/column_type_test.frm ---copy_file std_data/stonedb/column_type_test.bht/TA00000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00005.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00005.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00005DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00005DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00006.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00006.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00006DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00006DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00008.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00008.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00008DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00008DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00009.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00009.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00009DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00009DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00011.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00011.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00011DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00011DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00014.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00014.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00014DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00014DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00016.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00016.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00016DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00016DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00002.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00002.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00003.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00003.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00004.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00004.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00005.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00005.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00006.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00006.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00007.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00007.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00008.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00008.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00009.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00009.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00010.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00010.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00011.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00011.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00012.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00012.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00013.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00013.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00014.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00014.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00015.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00015.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00016.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00016.ctb ---copy_file std_data/stonedb/column_type_test.bht/Table.ctb $MYSQLD_DATADIR/test/column_type_test.bht/Table.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00005.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00005.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00005DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00005DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00006.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00006.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00006DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00006DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00008.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00008.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00008DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00008DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00009.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00009.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00009DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00009DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00011.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00011.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00011DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00011DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00014.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00014.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00014DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00014DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00016.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00016.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00016DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00016DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00002.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00002.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00003.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00003.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00004.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00004.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00005.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00005.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00006.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00006.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00007.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00007.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00008.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00008.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00009.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00009.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00010.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00010.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00011.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00011.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00012.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00012.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00013.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00013.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00014.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00014.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00015.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00015.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00016.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00016.ctb +--copy_file std_data/stonedb/column_type_test.tm/Table.ctb $MYSQLD_DATADIR/test/column_type_test.tm/Table.ctb --chmod 0777 $MYSQLD_DATADIR/test/column_type_test.frm ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00005.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00005DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00006.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00006DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00008.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00008DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00009.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00009DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00011.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00011DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00014.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00014DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00016.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00016DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00002.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00003.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00004.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00005.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00006.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00007.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00008.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00009.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00010.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00011.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00012.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00013.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00014.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00015.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00016.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/Table.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00005.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00005DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00006.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00006DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00008.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00008DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00009.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00009DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00011.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00011DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00014.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00014DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00016.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00016DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00002.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00003.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00004.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00005.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00006.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00007.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00008.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00009.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00010.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00011.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00012.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00013.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00014.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00015.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00016.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/Table.ctb SHOW CREATE TABLE column_type_test; alter table column_type_test add column ex_column int; SHOW CREATE TABLE column_type_test; diff --git a/mysql-test/suite/stonedb_upgrade/t/upgrade_drop_coloumn.test b/mysql-test/suite/stonedb_upgrade/t/upgrade_drop_coloumn.test index 5e3b9efcad..a3406d792c 100644 --- a/mysql-test/suite/stonedb_upgrade/t/upgrade_drop_coloumn.test +++ b/mysql-test/suite/stonedb_upgrade/t/upgrade_drop_coloumn.test @@ -19,153 +19,153 @@ select * from t1; drop table t1; ---mkdir $MYSQLD_DATADIR/test/column_type_test.bht +--mkdir $MYSQLD_DATADIR/test/column_type_test.tm --copy_file std_data/stonedb/column_type_test.frm $MYSQLD_DATADIR/test/column_type_test.frm ---copy_file std_data/stonedb/column_type_test.bht/TA00000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00005.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00005.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00005DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00005DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00006.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00006.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00006DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00006DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00008.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00008.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00008DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00008DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00009.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00009.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00009DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00009DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00011.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00011.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00011DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00011DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00014.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00014.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00014DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00014DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00016.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00016.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00016DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00016DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00002.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00002.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00003.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00003.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00004.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00004.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00005.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00005.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00006.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00006.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00007.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00007.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00008.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00008.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00009.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00009.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00010.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00010.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00011.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00011.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00012.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00012.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00013.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00013.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00014.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00014.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00015.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00015.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00016.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00016.ctb ---copy_file std_data/stonedb/column_type_test.bht/Table.ctb $MYSQLD_DATADIR/test/column_type_test.bht/Table.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00005.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00005.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00005DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00005DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00006.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00006.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00006DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00006DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00008.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00008.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00008DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00008DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00009.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00009.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00009DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00009DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00011.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00011.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00011DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00011DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00014.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00014.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00014DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00014DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00016.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00016.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00016DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00016DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00002.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00002.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00003.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00003.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00004.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00004.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00005.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00005.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00006.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00006.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00007.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00007.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00008.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00008.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00009.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00009.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00010.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00010.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00011.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00011.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00012.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00012.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00013.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00013.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00014.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00014.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00015.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00015.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00016.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00016.ctb +--copy_file std_data/stonedb/column_type_test.tm/Table.ctb $MYSQLD_DATADIR/test/column_type_test.tm/Table.ctb --chmod 0777 $MYSQLD_DATADIR/test/column_type_test.frm ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00005.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00005DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00006.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00006DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00008.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00008DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00009.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00009DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00011.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00011DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00014.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00014DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00016.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00016DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00002.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00003.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00004.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00005.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00006.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00007.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00008.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00009.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00010.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00011.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00012.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00013.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00014.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00015.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00016.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/Table.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00005.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00005DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00006.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00006DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00008.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00008DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00009.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00009DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00011.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00011DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00014.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00014DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00016.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00016DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00002.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00003.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00004.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00005.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00006.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00007.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00008.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00009.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00010.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00011.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00012.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00013.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00014.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00015.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00016.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/Table.ctb SHOW CREATE TABLE column_type_test; alter table column_type_test drop column c_longblob; insert into column_type_test(c_tinyint,c_smallint,c_mediumint,c_bigint,c_float,c_double,c_decimal,c_datetime,c_timestamp,c_time,c_char,c_varchar,c_text) diff --git a/mysql-test/suite/stonedb_upgrade/t/upgrade_insert.test b/mysql-test/suite/stonedb_upgrade/t/upgrade_insert.test index 9e6dfd6f32..20ab814209 100644 --- a/mysql-test/suite/stonedb_upgrade/t/upgrade_insert.test +++ b/mysql-test/suite/stonedb_upgrade/t/upgrade_insert.test @@ -19,153 +19,153 @@ select * from t1; drop table t1; ---mkdir $MYSQLD_DATADIR/test/column_type_test.bht +--mkdir $MYSQLD_DATADIR/test/column_type_test.tm --copy_file std_data/stonedb/column_type_test.frm $MYSQLD_DATADIR/test/column_type_test.frm ---copy_file std_data/stonedb/column_type_test.bht/TA00000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00005.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00005.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00005DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00005DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00006.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00006.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00006DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00006DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00008.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00008.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00008DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00008DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00009.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00009.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00009DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00009DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00011.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00011.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00011DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00011DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00014.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00014.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00014DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00014DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00016.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00016.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00016DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00016DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00002.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00002.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00003.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00003.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00004.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00004.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00005.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00005.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00006.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00006.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00007.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00007.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00008.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00008.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00009.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00009.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00010.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00010.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00011.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00011.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00012.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00012.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00013.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00013.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00014.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00014.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00015.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00015.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00016.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00016.ctb ---copy_file std_data/stonedb/column_type_test.bht/Table.ctb $MYSQLD_DATADIR/test/column_type_test.bht/Table.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00005.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00005.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00005DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00005DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00006.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00006.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00006DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00006DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00008.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00008.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00008DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00008DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00009.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00009.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00009DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00009DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00011.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00011.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00011DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00011DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00014.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00014.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00014DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00014DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00016.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00016.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00016DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00016DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00002.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00002.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00003.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00003.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00004.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00004.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00005.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00005.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00006.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00006.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00007.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00007.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00008.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00008.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00009.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00009.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00010.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00010.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00011.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00011.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00012.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00012.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00013.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00013.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00014.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00014.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00015.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00015.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00016.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00016.ctb +--copy_file std_data/stonedb/column_type_test.tm/Table.ctb $MYSQLD_DATADIR/test/column_type_test.tm/Table.ctb --chmod 0777 $MYSQLD_DATADIR/test/column_type_test.frm ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00005.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00005DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00006.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00006DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00008.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00008DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00009.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00009DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00011.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00011DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00014.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00014DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00016.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00016DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00002.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00003.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00004.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00005.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00006.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00007.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00008.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00009.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00010.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00011.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00012.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00013.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00014.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00015.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00016.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/Table.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00005.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00005DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00006.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00006DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00008.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00008DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00009.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00009DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00011.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00011DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00014.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00014DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00016.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00016DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00002.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00003.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00004.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00005.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00006.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00007.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00008.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00009.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00010.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00011.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00012.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00013.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00014.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00015.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00016.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/Table.ctb SHOW CREATE TABLE column_type_test; insert into column_type_test(c_tinyint,c_smallint,c_mediumint,c_int,c_bigint,c_float,c_double,c_decimal,c_date,c_datetime,c_timestamp,c_time,c_char,c_varchar,c_text) values(100,100,100,100,100,5.2,10.88,100.083,'2016-02-25','2016-02-25 10:20:01','2016-02-25 10:20:01','10:20:01','stoneatom','hello','abcdefghijklmn'); diff --git a/mysql-test/suite/stonedb_upgrade/t/upgrade_load.test b/mysql-test/suite/stonedb_upgrade/t/upgrade_load.test index 35d2c15806..7d35b88cd8 100644 --- a/mysql-test/suite/stonedb_upgrade/t/upgrade_load.test +++ b/mysql-test/suite/stonedb_upgrade/t/upgrade_load.test @@ -19,153 +19,153 @@ select * from t1; drop table t1; ---mkdir $MYSQLD_DATADIR/test/column_type_test.bht +--mkdir $MYSQLD_DATADIR/test/column_type_test.tm --copy_file std_data/stonedb/column_type_test.frm $MYSQLD_DATADIR/test/column_type_test.frm ---copy_file std_data/stonedb/column_type_test.bht/TA00000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00000DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00000DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00001DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00001DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00002DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00002DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00003DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00003DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00004DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00004DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00005.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00005.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00005DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00005DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00006.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00006.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00006DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00006DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00007DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00007DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00008.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00008.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00008DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00008DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00009.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00009.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00009DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00009DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00010DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00010DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00011.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00011.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00011DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00011DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00012DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00012DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00013DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00013DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00014.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00014.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00014DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00014DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015000000000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015000000001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00015DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00015DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00016.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00016.ctb ---copy_file std_data/stonedb/column_type_test.bht/TA00016DPN.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TA00016DPN.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00000.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00000.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00001.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00001.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00002.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00002.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00003.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00003.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00004.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00004.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00005.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00005.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00006.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00006.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00007.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00007.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00008.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00008.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00009.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00009.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00010.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00010.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00011.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00011.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00012.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00012.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00013.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00013.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00014.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00014.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00015.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00015.ctb ---copy_file std_data/stonedb/column_type_test.bht/TB00016.ctb $MYSQLD_DATADIR/test/column_type_test.bht/TB00016.ctb ---copy_file std_data/stonedb/column_type_test.bht/Table.ctb $MYSQLD_DATADIR/test/column_type_test.bht/Table.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00000DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00000DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00001DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00001DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00002DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00002DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00003DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00003DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00004DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00004DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00005.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00005.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00005DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00005DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00006.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00006.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00006DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00006DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00007DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00007DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00008.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00008.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00008DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00008DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00009.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00009.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00009DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00009DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00010DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00010DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00011.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00011.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00011DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00011DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00012DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00012DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00013DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00013DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00014.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00014.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00014DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00014DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015000000000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015000000001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00015DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00015DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00016.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00016.ctb +--copy_file std_data/stonedb/column_type_test.tm/TA00016DPN.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TA00016DPN.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00000.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00000.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00001.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00001.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00002.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00002.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00003.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00003.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00004.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00004.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00005.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00005.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00006.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00006.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00007.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00007.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00008.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00008.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00009.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00009.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00010.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00010.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00011.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00011.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00012.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00012.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00013.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00013.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00014.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00014.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00015.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00015.ctb +--copy_file std_data/stonedb/column_type_test.tm/TB00016.ctb $MYSQLD_DATADIR/test/column_type_test.tm/TB00016.ctb +--copy_file std_data/stonedb/column_type_test.tm/Table.ctb $MYSQLD_DATADIR/test/column_type_test.tm/Table.ctb --chmod 0777 $MYSQLD_DATADIR/test/column_type_test.frm ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00000DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00001DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00002DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00003DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00004DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00005.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00005DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00006.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00006DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00007DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00008.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00008DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00009.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00009DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00010DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00011.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00011DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00012DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00013DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00014.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00014DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015000000001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00015DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00016.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TA00016DPN.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00000.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00001.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00002.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00003.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00004.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00005.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00006.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00007.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00008.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00009.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00010.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00011.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00012.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00013.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00014.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00015.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/TB00016.ctb ---chmod 0777 $MYSQLD_DATADIR/test/column_type_test.bht/Table.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00000DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00001DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00002DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00003DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00004DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00005.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00005DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00006.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00006DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00007DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00008.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00008DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00009.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00009DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00010DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00011.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00011DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00012DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00013DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00014.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00014DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015000000001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00015DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00016.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TA00016DPN.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00000.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00001.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00002.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00003.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00004.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00005.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00006.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00007.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00008.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00009.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00010.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00011.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00012.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00013.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00014.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00015.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/TB00016.ctb +--chmod 0777 $MYSQLD_DATADIR/test/column_type_test.tm/Table.ctb SHOW CREATE TABLE column_type_test; load data infile '../../std_data/stonedb/bigdata4load' into table column_type_test fields terminated by '|'; select count(*) from column_type_test; diff --git a/mysql-test/suite/stonedb/r/add_column.result b/mysql-test/suite/tianmu/r/add_column.result similarity index 93% rename from mysql-test/suite/stonedb/r/add_column.result rename to mysql-test/suite/tianmu/r/add_column.result index a8d126a655..3dc081ed55 100644 --- a/mysql-test/suite/stonedb/r/add_column.result +++ b/mysql-test/suite/tianmu/r/add_column.result @@ -16,8 +16,8 @@ CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob' -) ENGINE=Stonedb; -load data infile '../../std_data/stonedb/bigdata4load' into table column_type_test fields terminated by '|'; +) ENGINE=TIANMU; +load data infile '../../std_data/tianmu/bigdata4load' into table column_type_test fields terminated by '|'; select count(*) from column_type_test; count(*) 100000 @@ -43,7 +43,7 @@ column_type_test CREATE TABLE `column_type_test` ( `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob', `ex_column` int(11) DEFAULT NULL -) ENGINE=STONEDB DEFAULT CHARSET=latin1 +) ENGINE=TIANMU DEFAULT CHARSET=latin1 insert into column_type_test(c_tinyint,c_smallint,c_mediumint,c_int,c_bigint,c_float,c_double,c_decimal,c_date,c_datetime,c_timestamp,c_time,c_char,c_varchar,c_text,ex_column) values(105,105,105,105,105,5.2,10.88,105.083,'2016-02-25','2016-02-25 10:20:01','2016-02-25 05:20:01','10:20:01','stoneatom','hello','bcdefghijklmn',105); select count(*) from column_type_test; diff --git a/mysql-test/suite/stonedb/r/casewhen.result b/mysql-test/suite/tianmu/r/casewhen.result similarity index 92% rename from mysql-test/suite/stonedb/r/casewhen.result rename to mysql-test/suite/tianmu/r/casewhen.result index 63751a27d5..5f7597ce5d 100644 --- a/mysql-test/suite/stonedb/r/casewhen.result +++ b/mysql-test/suite/tianmu/r/casewhen.result @@ -3,7 +3,7 @@ CREATE TABLE `test_case1` ( `id` int(11) DEFAULT NULL, `age` int(11) DEFAULT NULL, `name` text -) ENGINE=STONEDB; +) ENGINE=TIANMU; select id,case age when 2 then '1' else name end from test_case1; id case age when 2 then '1' else name end drop table test_case1; diff --git a/mysql-test/suite/stonedb/r/concat.result b/mysql-test/suite/tianmu/r/concat.result similarity index 94% rename from mysql-test/suite/stonedb/r/concat.result rename to mysql-test/suite/tianmu/r/concat.result index 4b75e834f1..a4db1a7c49 100644 --- a/mysql-test/suite/stonedb/r/concat.result +++ b/mysql-test/suite/tianmu/r/concat.result @@ -2,7 +2,7 @@ use test; CREATE TABLE `test_case` ( `id` int(11) DEFAULT NULL, `name` text -) ENGINE=STONEDB; +) ENGINE=TIANMU; insert into test_case values(1,'test'); insert into test_case (name) values('test2'); insert into test_case values(3,'test3'); diff --git a/mysql-test/suite/stonedb/r/drop_column.result b/mysql-test/suite/tianmu/r/drop_column.result similarity index 97% rename from mysql-test/suite/stonedb/r/drop_column.result rename to mysql-test/suite/tianmu/r/drop_column.result index c5ac018a8d..746703a6dd 100644 --- a/mysql-test/suite/stonedb/r/drop_column.result +++ b/mysql-test/suite/tianmu/r/drop_column.result @@ -17,7 +17,7 @@ CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob' -) ENGINE=Stonedb; +) ENGINE=TIANMU; alter table column_type_test drop column c_char; show create table column_type_test; Table Create Table @@ -38,5 +38,5 @@ column_type_test CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob' -) ENGINE=STONEDB DEFAULT CHARSET=latin1 +) ENGINE=TIANMU DEFAULT CHARSET=latin1 drop table column_type_test; diff --git a/mysql-test/suite/stonedb/r/group_concat.result b/mysql-test/suite/tianmu/r/group_concat.result similarity index 98% rename from mysql-test/suite/stonedb/r/group_concat.result rename to mysql-test/suite/tianmu/r/group_concat.result index a25fb6d792..24ac935daa 100644 --- a/mysql-test/suite/stonedb/r/group_concat.result +++ b/mysql-test/suite/tianmu/r/group_concat.result @@ -2,7 +2,7 @@ use test; CREATE TABLE `test_groupconcat_case` ( `id` int(11) DEFAULT NULL, `name` text -) ENGINE=STONEDB; +) ENGINE=TIANMU; insert into test_groupconcat_case values(1,'test'); insert into test_groupconcat_case values(1,'test1'); insert into test_groupconcat_case values(1,'test1'); diff --git a/mysql-test/suite/stonedb/r/group_concat2.result b/mysql-test/suite/tianmu/r/group_concat2.result similarity index 96% rename from mysql-test/suite/stonedb/r/group_concat2.result rename to mysql-test/suite/tianmu/r/group_concat2.result index 6c04070b75..e6a52b4863 100644 --- a/mysql-test/suite/stonedb/r/group_concat2.result +++ b/mysql-test/suite/tianmu/r/group_concat2.result @@ -2,7 +2,7 @@ use test; CREATE TABLE `test_groupconcat2_case` ( `id` int(11) DEFAULT NULL, `val` int(11) -) ENGINE=STONEDB; +) ENGINE=TIANMU; insert into test_groupconcat2_case values(1, 22); insert into test_groupconcat2_case values(1, 4); select id,group_concat(val order by val desc SEPARATOR " ") from test_groupconcat2_case group by id; diff --git a/mysql-test/suite/stonedb/r/insert.result b/mysql-test/suite/tianmu/r/insert.result similarity index 99% rename from mysql-test/suite/stonedb/r/insert.result rename to mysql-test/suite/tianmu/r/insert.result index d3fad07a0f..da02242cb7 100644 --- a/mysql-test/suite/stonedb/r/insert.result +++ b/mysql-test/suite/tianmu/r/insert.result @@ -17,7 +17,7 @@ CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob' -) ENGINE=Stonedb; +) ENGINE=TIANMU; insert into column_type_test(c_tinyint,c_smallint,c_mediumint,c_int,c_bigint,c_float,c_double,c_decimal,c_date,c_datetime,c_timestamp,c_time,c_char,c_varchar,c_text) values(100,100,100,100,100,5.2,10.88,100.083,'2016-02-25','2016-02-25 10:20:01','2016-02-25 05:20:01','10:20:01','stoneatom','hello','bcdefghijklmn'); insert into column_type_test(c_tinyint,c_smallint,c_mediumint,c_int,c_bigint,c_float,c_double,c_decimal,c_date,c_datetime,c_timestamp,c_time,c_char,c_varchar,c_text) diff --git a/mysql-test/suite/stonedb/r/issue405.result b/mysql-test/suite/tianmu/r/issue405.result similarity index 79% rename from mysql-test/suite/stonedb/r/issue405.result rename to mysql-test/suite/tianmu/r/issue405.result index 112799b4c2..63b37bce3f 100644 --- a/mysql-test/suite/stonedb/r/issue405.result +++ b/mysql-test/suite/tianmu/r/issue405.result @@ -1,5 +1,5 @@ use test; -create table timehi (val time) ENGINE=STONEDB; +create table timehi (val time) ENGINE=TIANMU; insert into timehi values ('00:00:00'), ('01:15:39'), ('09:11:12'), ('20:30:29'); select * from timehi where val >= '08:02:45'; val diff --git a/mysql-test/suite/tianmu/r/issue410.result b/mysql-test/suite/tianmu/r/issue410.result new file mode 100644 index 0000000000..180601da8e --- /dev/null +++ b/mysql-test/suite/tianmu/r/issue410.result @@ -0,0 +1,8 @@ +use test; +create table tlike (val varchar(255)) ENGINE=TIANMU; +insert into tlike values ('abcde'); +select * from tlike where val like NULL; +val +Warnings: +Note 1105 Query syntax not implemented in TIANMU, executed by MySQL engine. +drop table tlike; diff --git a/mysql-test/suite/stonedb/r/issue415.result b/mysql-test/suite/tianmu/r/issue415.result similarity index 97% rename from mysql-test/suite/stonedb/r/issue415.result rename to mysql-test/suite/tianmu/r/issue415.result index ff64d86e1e..9635907c4c 100644 --- a/mysql-test/suite/stonedb/r/issue415.result +++ b/mysql-test/suite/tianmu/r/issue415.result @@ -17,7 +17,7 @@ CREATE TABLE `select_base_with_primary_key` ( `timestamp_test` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, `year_test` year(4) DEFAULT NULL, PRIMARY KEY (`pk`) -) ENGINE=STONEDB DEFAULT CHARSET=gbk; +) ENGINE=TIANMU DEFAULT CHARSET=gbk; insert into select_base_with_primary_key values (11, 'abcde', 123, 'char', 3, 1, 23, 32, 332, 1.4, 25, '2017-11-11', '11:11:11', '2017-11-11 11:11:11', 1, 2017); Warnings: Warning 1265 Data truncated for column 'timestamp_test' at row 1 diff --git a/mysql-test/suite/stonedb/r/issue417.result b/mysql-test/suite/tianmu/r/issue417.result similarity index 77% rename from mysql-test/suite/stonedb/r/issue417.result rename to mysql-test/suite/tianmu/r/issue417.result index 0b627c42cc..3047e8070a 100644 --- a/mysql-test/suite/stonedb/r/issue417.result +++ b/mysql-test/suite/tianmu/r/issue417.result @@ -1,5 +1,5 @@ use test; -create table ttime (val time) ENGINE=STONEDB; +create table ttime (val time) ENGINE=TIANMU; insert into ttime values ('12:15:03'), ('18:30:20'); select (val between '12:00:00' and '12:30:00') as agval from ttime; agval diff --git a/mysql-test/suite/stonedb/r/issue429.result b/mysql-test/suite/tianmu/r/issue429.result similarity index 84% rename from mysql-test/suite/stonedb/r/issue429.result rename to mysql-test/suite/tianmu/r/issue429.result index 436e98a845..463c665c91 100644 --- a/mysql-test/suite/stonedb/r/issue429.result +++ b/mysql-test/suite/tianmu/r/issue429.result @@ -1,5 +1,5 @@ use test; -create table tt (val time) ENGINE=STONEDB; +create table tt (val time) ENGINE=TIANMU; insert into tt values ('06:34:12'), ('13:23:33'); select * from tt where DATE(TIMESTAMP(val)) = CURDATE(); val diff --git a/mysql-test/suite/stonedb/r/issue430.result b/mysql-test/suite/tianmu/r/issue430.result similarity index 93% rename from mysql-test/suite/stonedb/r/issue430.result rename to mysql-test/suite/tianmu/r/issue430.result index 0d79ab5156..55a59010d3 100644 --- a/mysql-test/suite/stonedb/r/issue430.result +++ b/mysql-test/suite/tianmu/r/issue430.result @@ -1,5 +1,5 @@ use test; -create table tt2 (a tinyint(4), b smallint(6), c bigint(20)) ENGINE=STONEDB; +create table tt2 (a tinyint(4), b smallint(6), c bigint(20)) ENGINE=TIANMU; insert into tt2 values (15, 20, 18), (1, 6, 4); select (a/b)/c as agf from tt2 group by agf; agf diff --git a/mysql-test/suite/stonedb/r/issue431.result b/mysql-test/suite/tianmu/r/issue431.result similarity index 72% rename from mysql-test/suite/stonedb/r/issue431.result rename to mysql-test/suite/tianmu/r/issue431.result index bfe23172b4..f4be4aa8c1 100644 --- a/mysql-test/suite/stonedb/r/issue431.result +++ b/mysql-test/suite/tianmu/r/issue431.result @@ -1,5 +1,5 @@ use test; -create table tt(a int, b int) ENGINE=STONEDB; +create table tt(a int, b int) ENGINE=TIANMU; insert into tt values (3, 4); select * from tt where (a >= 3) AND (b = 5 AND a > 2 OR 0); a b diff --git a/mysql-test/suite/stonedb/r/issue433.result b/mysql-test/suite/tianmu/r/issue433.result similarity index 95% rename from mysql-test/suite/stonedb/r/issue433.result rename to mysql-test/suite/tianmu/r/issue433.result index 5d93872c3e..e6b60ce652 100644 --- a/mysql-test/suite/stonedb/r/issue433.result +++ b/mysql-test/suite/tianmu/r/issue433.result @@ -1,5 +1,5 @@ use test; -create table tt(val int) ENGINE=STONEDB; +create table tt(val int) ENGINE=TIANMU; insert into tt values (12); select * from tt where null in (null); val diff --git a/mysql-test/suite/stonedb/r/issue446.result b/mysql-test/suite/tianmu/r/issue446.result similarity index 54% rename from mysql-test/suite/stonedb/r/issue446.result rename to mysql-test/suite/tianmu/r/issue446.result index cc2890eaec..e459f1cca6 100644 --- a/mysql-test/suite/stonedb/r/issue446.result +++ b/mysql-test/suite/tianmu/r/issue446.result @@ -1,9 +1,9 @@ use test; -create table tt (val double) ENGINE=STONEDB; +create table tt (val double) ENGINE=TIANMU; insert into tt values (1.2345); select 1 from (select * from tt) as A join tt where A.val > 1 XOR tt.val > 2; 1 1 Warnings: -Note 1105 Query syntax not implemented in Stonedb, executed by MySQL engine. +Note 1105 Query syntax not implemented in TIANMU, executed by MySQL engine. drop table tt; diff --git a/mysql-test/suite/stonedb/r/issue464.result b/mysql-test/suite/tianmu/r/issue464.result similarity index 98% rename from mysql-test/suite/stonedb/r/issue464.result rename to mysql-test/suite/tianmu/r/issue464.result index 97d968cbd3..27c4fb78f3 100644 --- a/mysql-test/suite/stonedb/r/issue464.result +++ b/mysql-test/suite/tianmu/r/issue464.result @@ -1,5 +1,5 @@ use test; -create table tt (date_test DATE, time_test TIME, datetime_test DATETIME, timestamp_test TIMESTAMP, year_test YEAR) ENGINE=STONEDB; +create table tt (date_test DATE, time_test TIME, datetime_test DATETIME, timestamp_test TIMESTAMP, year_test YEAR) ENGINE=TIANMU; insert into tt values ('2017-12-07', '02:03:04', '2017-12-08 05:06:07', '2018-11-08 09:10:11', '2020'); select DATE(date_test) from tt; DATE(date_test) diff --git a/mysql-test/suite/stonedb/r/issue467.result b/mysql-test/suite/tianmu/r/issue467.result similarity index 79% rename from mysql-test/suite/stonedb/r/issue467.result rename to mysql-test/suite/tianmu/r/issue467.result index b4a36c831d..2aab8ef3db 100644 --- a/mysql-test/suite/stonedb/r/issue467.result +++ b/mysql-test/suite/tianmu/r/issue467.result @@ -1,5 +1,5 @@ use test; -create table tt (date_test date) ENGINE=STONEDB; +create table tt (date_test date) ENGINE=TIANMU; insert into tt values ('2010-02-22'); select * from tt where (date_test<='2003-04-05')AND (date_test>='2011-06-22')OR (date_test<='2012-12-13' ); date_test diff --git a/mysql-test/suite/stonedb/r/issue468.result b/mysql-test/suite/tianmu/r/issue468.result similarity index 89% rename from mysql-test/suite/stonedb/r/issue468.result rename to mysql-test/suite/tianmu/r/issue468.result index 69dfa8f2e6..a13652b75a 100644 --- a/mysql-test/suite/stonedb/r/issue468.result +++ b/mysql-test/suite/tianmu/r/issue468.result @@ -1,5 +1,5 @@ use test; -create table tt (e1 int, e2 int, e3 int, e4 int, e5 int, e6 int, e7 int, e8 int, e9 int) ENGINE=STONEDB; +create table tt (e1 int, e2 int, e3 int, e4 int, e5 int, e6 int, e7 int, e8 int, e9 int) ENGINE=TIANMU; insert into tt values (1,1,1,0,0,0,0,1,0); select * from tt where (e1 AND ((e2 AND e3 AND (e4 OR e5)) OR e6) OR (e7 AND e8 AND e9)); e1 e2 e3 e4 e5 e6 e7 e8 e9 diff --git a/mysql-test/suite/stonedb/r/issue469.result b/mysql-test/suite/tianmu/r/issue469.result similarity index 74% rename from mysql-test/suite/stonedb/r/issue469.result rename to mysql-test/suite/tianmu/r/issue469.result index e9c51b1515..28154df90c 100644 --- a/mysql-test/suite/stonedb/r/issue469.result +++ b/mysql-test/suite/tianmu/r/issue469.result @@ -1,5 +1,5 @@ use test; -create table tt (v1 int, v2 int, v3 int) ENGINE=STONEDB; +create table tt (v1 int, v2 int, v3 int) ENGINE=TIANMU; insert into tt values (20, 30, 40); select * from tt where (v1 = 20) OR ((v1 <=> 80) OR (v2 = 70) AND (v3 = 60)) AND (1); v1 v2 v3 diff --git a/mysql-test/suite/stonedb/r/issue475.result b/mysql-test/suite/tianmu/r/issue475.result similarity index 78% rename from mysql-test/suite/stonedb/r/issue475.result rename to mysql-test/suite/tianmu/r/issue475.result index 2904a7416b..79111d600a 100644 --- a/mysql-test/suite/stonedb/r/issue475.result +++ b/mysql-test/suite/tianmu/r/issue475.result @@ -1,5 +1,5 @@ use test; -create table jl (date_test date) ENGINE=STONEDB; +create table jl (date_test date) ENGINE=TIANMU; insert into jl values ('2015-11-12'); select ADDTIME(date_test, '1 1:1:1.00002') from jl; ADDTIME(date_test, '1 1:1:1.00002') diff --git a/mysql-test/suite/stonedb/r/issue496.result b/mysql-test/suite/tianmu/r/issue496.result similarity index 96% rename from mysql-test/suite/stonedb/r/issue496.result rename to mysql-test/suite/tianmu/r/issue496.result index 48184082cc..54423501f5 100644 --- a/mysql-test/suite/stonedb/r/issue496.result +++ b/mysql-test/suite/tianmu/r/issue496.result @@ -1,5 +1,5 @@ use test; -create table t1 (id int, name varchar(10) comment "LOOKUP") ENGINE=STONEDB; +create table t1 (id int, name varchar(10) comment "LOOKUP") ENGINE=TIANMU; insert into t1 values (1, 'one'); insert into t1 values (2, 'one'); insert into t1 values (3, 'one'); diff --git a/mysql-test/suite/stonedb/r/issue502.result b/mysql-test/suite/tianmu/r/issue502.result similarity index 90% rename from mysql-test/suite/stonedb/r/issue502.result rename to mysql-test/suite/tianmu/r/issue502.result index ff378902d3..935e1a397c 100644 --- a/mysql-test/suite/stonedb/r/issue502.result +++ b/mysql-test/suite/tianmu/r/issue502.result @@ -3,7 +3,7 @@ CREATE TABLE `auto_20` ( `pk` bigint(11) NOT NULL AUTO_INCREMENT, `varchar_test` varchar(255) DEFAULT NULL, PRIMARY KEY (`pk`) -) ENGINE=STONEDB DEFAULT CHARSET=gbk; +) ENGINE=TIANMU DEFAULT CHARSET=gbk; insert into auto_20(varchar_test) values('changsha'); insert into auto_20(varchar_test) values('aaaa'); insert into auto_20(varchar_test) values('bbb'); diff --git a/mysql-test/suite/stonedb/r/issue515.result b/mysql-test/suite/tianmu/r/issue515.result similarity index 87% rename from mysql-test/suite/stonedb/r/issue515.result rename to mysql-test/suite/tianmu/r/issue515.result index a09927d5bd..5d51f2a554 100644 --- a/mysql-test/suite/stonedb/r/issue515.result +++ b/mysql-test/suite/tianmu/r/issue515.result @@ -1,5 +1,5 @@ use test; -create table timetest (val timestamp) ENGINE=STONEDB; +create table timetest (val timestamp) ENGINE=TIANMU; insert into timetest values ('2010-02-22 18:35:23'); select val not between '2010-02-22 18:35:23' and '2015-11-23 08:02:45' from (select * from timetest) as A; val not between '2010-02-22 18:35:23' and '2015-11-23 08:02:45' diff --git a/mysql-test/suite/stonedb/r/load.result b/mysql-test/suite/tianmu/r/load.result similarity index 93% rename from mysql-test/suite/stonedb/r/load.result rename to mysql-test/suite/tianmu/r/load.result index df9cc60726..84dd5c55be 100644 --- a/mysql-test/suite/stonedb/r/load.result +++ b/mysql-test/suite/tianmu/r/load.result @@ -1,5 +1,5 @@ drop table if exists t1; -create table t1 (a date, b date, c date not null, d date)engine=stonedb; +create table t1 (a date, b date, c date not null, d date)engine=TIANMU; load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; Warnings: @@ -19,7 +19,7 @@ t1 CREATE TABLE `t1` ( `b` date DEFAULT NULL, `c` date NOT NULL, `d` date DEFAULT NULL -) ENGINE=STONEDB DEFAULT CHARSET=latin1 +) ENGINE=TIANMU DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE `column_type_test` ( `c_tinyint` tinyint(4) DEFAULT NULL COMMENT 'tinyint', @@ -39,8 +39,8 @@ CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob' -) ENGINE=Stonedb; -load data infile '../../std_data/stonedb/loadfile' into table column_type_test fields terminated by '|'; +) ENGINE=TIANMU; +load data infile '../../std_data/tianmu/loadfile' into table column_type_test fields terminated by '|'; select * from column_type_test; c_tinyint c_smallint c_mediumint c_int c_bigint c_float c_double c_decimal c_date c_datetime c_timestamp c_time c_char c_varchar c_blob c_text c_longblob 100 100 100 100 100 5.2 10.88 100.08300 2016-02-25 2016-02-25 10:20:01 2007-04-23 08:12:49 10:20:01 stoneatom hello NULL bcdefghijklmn NULL diff --git a/mysql-test/suite/stonedb/r/lz4.result b/mysql-test/suite/tianmu/r/lz4.result similarity index 99% rename from mysql-test/suite/stonedb/r/lz4.result rename to mysql-test/suite/tianmu/r/lz4.result index 4b4e1fa0e8..c5cc102783 100644 --- a/mysql-test/suite/stonedb/r/lz4.result +++ b/mysql-test/suite/tianmu/r/lz4.result @@ -17,7 +17,7 @@ CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'lz4', `c_text` text COMMENT 'lz4', `c_longblob` longblob COMMENT 'lz4' -) ENGINE=Stonedb; +) ENGINE=TIANMU; insert into column_type_test(c_tinyint,c_smallint,c_mediumint,c_int,c_bigint,c_float,c_double,c_decimal,c_date,c_datetime,c_timestamp,c_time,c_char,c_varchar,c_text) values(100,100,100,100,100,5.2,10.88,100.083,'2016-02-25','2016-02-25 10:20:01','2016-02-25 05:20:01','10:20:01','stoneatom','hello','bcdefghijklmn'); insert into column_type_test(c_tinyint,c_smallint,c_mediumint,c_int,c_bigint,c_float,c_double,c_decimal,c_date,c_datetime,c_timestamp,c_time,c_char,c_varchar,c_text) diff --git a/mysql-test/suite/stonedb/r/orquery.result b/mysql-test/suite/tianmu/r/orquery.result similarity index 92% rename from mysql-test/suite/stonedb/r/orquery.result rename to mysql-test/suite/tianmu/r/orquery.result index 105c9e55a7..6ee2cf1160 100644 --- a/mysql-test/suite/stonedb/r/orquery.result +++ b/mysql-test/suite/tianmu/r/orquery.result @@ -2,7 +2,7 @@ use test; CREATE TABLE `test_or` ( `id` int(11) DEFAULT NULL, `age` int(11) DEFAULT NULL -) ENGINE=STONEDB; +) ENGINE=TIANMU; insert into test_or values(1,1); insert into test_or values(2,2); select count(*) from test_or where id=1 or age=2; diff --git a/mysql-test/suite/stonedb/r/orquery1.result b/mysql-test/suite/tianmu/r/orquery1.result similarity index 93% rename from mysql-test/suite/stonedb/r/orquery1.result rename to mysql-test/suite/tianmu/r/orquery1.result index 47dcd26c73..60ab0c03f0 100644 --- a/mysql-test/suite/stonedb/r/orquery1.result +++ b/mysql-test/suite/tianmu/r/orquery1.result @@ -2,7 +2,7 @@ use test; CREATE TABLE `test_or` ( `id` int(11) DEFAULT NULL, `name` varchar(11) DEFAULT NULL -) ENGINE=STONEDB; +) ENGINE=TIANMU; insert into test_or values(1,'1'); insert into test_or values(2,'2'); select count(*) from test_or where id=1 or name='2'; diff --git a/mysql-test/suite/stonedb/r/truncate.result b/mysql-test/suite/tianmu/r/truncate.result similarity index 93% rename from mysql-test/suite/stonedb/r/truncate.result rename to mysql-test/suite/tianmu/r/truncate.result index 92cf69fe78..1e5c0e45cc 100644 --- a/mysql-test/suite/stonedb/r/truncate.result +++ b/mysql-test/suite/tianmu/r/truncate.result @@ -17,8 +17,8 @@ CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob' -) ENGINE=Stonedb; -load data infile '../../std_data/stonedb/bigdata4load' into table column_type_test fields terminated by '|'; +) ENGINE=TIANMU; +load data infile '../../std_data/tianmu/bigdata4load' into table column_type_test fields terminated by '|'; select count(*) from column_type_test; count(*) 100000 @@ -43,7 +43,7 @@ column_type_test CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob' -) ENGINE=STONEDB DEFAULT CHARSET=latin1 +) ENGINE=TIANMU DEFAULT CHARSET=latin1 insert into column_type_test(c_tinyint,c_smallint,c_mediumint,c_int,c_bigint,c_float,c_double,c_decimal,c_date,c_datetime,c_timestamp,c_time,c_char,c_varchar,c_text) values(105,105,105,105,105,5.2,10.88,105.083,'2016-02-25','2016-02-25 10:20:01','2016-02-25 05:20:01','10:20:01','stoneatom','hello','bcdefghijklmn'); select * from column_type_test; diff --git a/mysql-test/suite/stonedb/t/add_column.test b/mysql-test/suite/tianmu/t/add_column.test similarity index 91% rename from mysql-test/suite/stonedb/t/add_column.test rename to mysql-test/suite/tianmu/t/add_column.test index e3e164f978..3e1a33a606 100644 --- a/mysql-test/suite/stonedb/t/add_column.test +++ b/mysql-test/suite/tianmu/t/add_column.test @@ -17,9 +17,9 @@ CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob' -) ENGINE=Stonedb; +) ENGINE=TIANMU; -load data infile '../../std_data/stonedb/bigdata4load' into table column_type_test fields terminated by '|'; +load data infile '../../std_data/tianmu/bigdata4load' into table column_type_test fields terminated by '|'; select count(*) from column_type_test; alter table column_type_test add column ex_column int; show create table column_type_test; diff --git a/mysql-test/suite/stonedb/t/casewhen.test b/mysql-test/suite/tianmu/t/casewhen.test similarity index 91% rename from mysql-test/suite/stonedb/t/casewhen.test rename to mysql-test/suite/tianmu/t/casewhen.test index a6baae17f7..1e236dc877 100644 --- a/mysql-test/suite/stonedb/t/casewhen.test +++ b/mysql-test/suite/tianmu/t/casewhen.test @@ -3,7 +3,7 @@ CREATE TABLE `test_case1` ( `id` int(11) DEFAULT NULL, `age` int(11) DEFAULT NULL, `name` text -) ENGINE=STONEDB; +) ENGINE=TIANMU; select id,case age when 2 then '1' else name end from test_case1; drop table test_case1; diff --git a/mysql-test/suite/stonedb/t/concat.test b/mysql-test/suite/tianmu/t/concat.test similarity index 93% rename from mysql-test/suite/stonedb/t/concat.test rename to mysql-test/suite/tianmu/t/concat.test index 211642621f..9d222a0f19 100644 --- a/mysql-test/suite/stonedb/t/concat.test +++ b/mysql-test/suite/tianmu/t/concat.test @@ -2,7 +2,7 @@ use test; CREATE TABLE `test_case` ( `id` int(11) DEFAULT NULL, `name` text -) ENGINE=STONEDB; +) ENGINE=TIANMU; insert into test_case values(1,'test'); insert into test_case (name) values('test2'); insert into test_case values(3,'test3'); diff --git a/mysql-test/suite/stonedb/t/disabled.def b/mysql-test/suite/tianmu/t/disabled.def similarity index 100% rename from mysql-test/suite/stonedb/t/disabled.def rename to mysql-test/suite/tianmu/t/disabled.def diff --git a/mysql-test/suite/stonedb/t/drop_column.test b/mysql-test/suite/tianmu/t/drop_column.test similarity index 98% rename from mysql-test/suite/stonedb/t/drop_column.test rename to mysql-test/suite/tianmu/t/drop_column.test index 8431325c65..994d754359 100644 --- a/mysql-test/suite/stonedb/t/drop_column.test +++ b/mysql-test/suite/tianmu/t/drop_column.test @@ -17,7 +17,7 @@ CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob' -) ENGINE=Stonedb; +) ENGINE=TIANMU; alter table column_type_test drop column c_char; show create table column_type_test; drop table column_type_test; diff --git a/mysql-test/suite/stonedb/t/group_concat.test b/mysql-test/suite/tianmu/t/group_concat.test similarity index 98% rename from mysql-test/suite/stonedb/t/group_concat.test rename to mysql-test/suite/tianmu/t/group_concat.test index 6570fd68ae..d4564bc8a5 100644 --- a/mysql-test/suite/stonedb/t/group_concat.test +++ b/mysql-test/suite/tianmu/t/group_concat.test @@ -2,7 +2,7 @@ use test; CREATE TABLE `test_groupconcat_case` ( `id` int(11) DEFAULT NULL, `name` text -) ENGINE=STONEDB; +) ENGINE=TIANMU; insert into test_groupconcat_case values(1,'test'); insert into test_groupconcat_case values(1,'test1'); insert into test_groupconcat_case values(1,'test1'); diff --git a/mysql-test/suite/stonedb/t/group_concat2.test b/mysql-test/suite/tianmu/t/group_concat2.test similarity index 95% rename from mysql-test/suite/stonedb/t/group_concat2.test rename to mysql-test/suite/tianmu/t/group_concat2.test index 9ab570b769..6fa54bf0c5 100644 --- a/mysql-test/suite/stonedb/t/group_concat2.test +++ b/mysql-test/suite/tianmu/t/group_concat2.test @@ -2,7 +2,7 @@ use test; CREATE TABLE `test_groupconcat2_case` ( `id` int(11) DEFAULT NULL, `val` int(11) -) ENGINE=STONEDB; +) ENGINE=TIANMU; insert into test_groupconcat2_case values(1, 22); insert into test_groupconcat2_case values(1, 4); select id,group_concat(val order by val desc SEPARATOR " ") from test_groupconcat2_case group by id; diff --git a/mysql-test/suite/stonedb/t/insert.test b/mysql-test/suite/tianmu/t/insert.test similarity index 99% rename from mysql-test/suite/stonedb/t/insert.test rename to mysql-test/suite/tianmu/t/insert.test index a8db5182ea..5ab2bee1af 100644 --- a/mysql-test/suite/stonedb/t/insert.test +++ b/mysql-test/suite/tianmu/t/insert.test @@ -17,7 +17,7 @@ CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob' -) ENGINE=Stonedb; +) ENGINE=TIANMU; insert into column_type_test(c_tinyint,c_smallint,c_mediumint,c_int,c_bigint,c_float,c_double,c_decimal,c_date,c_datetime,c_timestamp,c_time,c_char,c_varchar,c_text) values(100,100,100,100,100,5.2,10.88,100.083,'2016-02-25','2016-02-25 10:20:01','2016-02-25 05:20:01','10:20:01','stoneatom','hello','bcdefghijklmn'); diff --git a/mysql-test/suite/stonedb/t/issue405.test b/mysql-test/suite/tianmu/t/issue405.test similarity index 76% rename from mysql-test/suite/stonedb/t/issue405.test rename to mysql-test/suite/tianmu/t/issue405.test index 59b61e1906..004b4b5730 100644 --- a/mysql-test/suite/stonedb/t/issue405.test +++ b/mysql-test/suite/tianmu/t/issue405.test @@ -1,5 +1,5 @@ use test; -create table timehi (val time) ENGINE=STONEDB; +create table timehi (val time) ENGINE=TIANMU; insert into timehi values ('00:00:00'), ('01:15:39'), ('09:11:12'), ('20:30:29'); select * from timehi where val >= '08:02:45'; drop table timehi; diff --git a/mysql-test/suite/stonedb/t/issue410.testbak b/mysql-test/suite/tianmu/t/issue410.testbak similarity index 66% rename from mysql-test/suite/stonedb/t/issue410.testbak rename to mysql-test/suite/tianmu/t/issue410.testbak index 112b8e24f9..9423aaae08 100644 --- a/mysql-test/suite/stonedb/t/issue410.testbak +++ b/mysql-test/suite/tianmu/t/issue410.testbak @@ -1,5 +1,5 @@ use test; -create table tlike (val varchar(255)) ENGINE=STONEDB; +create table tlike (val varchar(255)) ENGINE=TIANMU; insert into tlike values ('abcde'); select * from tlike where val like NULL; drop table tlike; diff --git a/mysql-test/suite/stonedb/t/issue415.testbak b/mysql-test/suite/tianmu/t/issue415.testbak similarity index 97% rename from mysql-test/suite/stonedb/t/issue415.testbak rename to mysql-test/suite/tianmu/t/issue415.testbak index c3bd605f37..3970386559 100644 --- a/mysql-test/suite/stonedb/t/issue415.testbak +++ b/mysql-test/suite/tianmu/t/issue415.testbak @@ -17,7 +17,7 @@ CREATE TABLE `select_base_with_primary_key` ( `timestamp_test` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, `year_test` year(4) DEFAULT NULL, PRIMARY KEY (`pk`) -) ENGINE=STONEDB DEFAULT CHARSET=gbk; +) ENGINE=TIANMU DEFAULT CHARSET=gbk; insert into select_base_with_primary_key values (11, 'abcde', 123, 'char', 3, 1, 23, 32, 332, 1.4, 25, '2017-11-11', '11:11:11', '2017-11-11 11:11:11', 1, 2017); select 'aa' as ag_column1, !( tinyint_1bit_test )as ag_column2, 1 as ag_column3,min((smallint_test + smallint_test) =11)as ag_column_fun from select_base_with_primary_key GROUP BY ag_column1,ag_column2 asc,ag_column3 having ag_column_fun<= 37 order by ag_column1 ,ag_column2 asc,ag_column3 asc,ag_column_fun; drop table select_base_with_primary_key; diff --git a/mysql-test/suite/stonedb/t/issue417.test b/mysql-test/suite/tianmu/t/issue417.test similarity index 76% rename from mysql-test/suite/stonedb/t/issue417.test rename to mysql-test/suite/tianmu/t/issue417.test index c75b2e3319..5eab37e467 100644 --- a/mysql-test/suite/stonedb/t/issue417.test +++ b/mysql-test/suite/tianmu/t/issue417.test @@ -1,5 +1,5 @@ use test; -create table ttime (val time) ENGINE=STONEDB; +create table ttime (val time) ENGINE=TIANMU; insert into ttime values ('12:15:03'), ('18:30:20'); select (val between '12:00:00' and '12:30:00') as agval from ttime; drop table ttime; diff --git a/mysql-test/suite/stonedb/t/issue429.test b/mysql-test/suite/tianmu/t/issue429.test similarity index 81% rename from mysql-test/suite/stonedb/t/issue429.test rename to mysql-test/suite/tianmu/t/issue429.test index 52f402fca9..74b331505f 100644 --- a/mysql-test/suite/stonedb/t/issue429.test +++ b/mysql-test/suite/tianmu/t/issue429.test @@ -1,5 +1,5 @@ use test; -create table tt (val time) ENGINE=STONEDB; +create table tt (val time) ENGINE=TIANMU; insert into tt values ('06:34:12'), ('13:23:33'); select * from tt where DATE(TIMESTAMP(val)) = CURDATE(); select * from tt where DATE(TIMESTAMP(val, val)) = CURDATE(); diff --git a/mysql-test/suite/stonedb/t/issue430.test b/mysql-test/suite/tianmu/t/issue430.test similarity index 93% rename from mysql-test/suite/stonedb/t/issue430.test rename to mysql-test/suite/tianmu/t/issue430.test index 9c00624542..90a88cd825 100644 --- a/mysql-test/suite/stonedb/t/issue430.test +++ b/mysql-test/suite/tianmu/t/issue430.test @@ -1,5 +1,5 @@ use test; -create table tt2 (a tinyint(4), b smallint(6), c bigint(20)) ENGINE=STONEDB; +create table tt2 (a tinyint(4), b smallint(6), c bigint(20)) ENGINE=TIANMU; insert into tt2 values (15, 20, 18), (1, 6, 4); select (a/b)/c as agf from tt2 group by agf; drop table tt2; diff --git a/mysql-test/suite/stonedb/t/issue431.test b/mysql-test/suite/tianmu/t/issue431.test similarity index 71% rename from mysql-test/suite/stonedb/t/issue431.test rename to mysql-test/suite/tianmu/t/issue431.test index 5dd5531285..6e5adba64f 100644 --- a/mysql-test/suite/stonedb/t/issue431.test +++ b/mysql-test/suite/tianmu/t/issue431.test @@ -1,5 +1,5 @@ use test; -create table tt(a int, b int) ENGINE=STONEDB; +create table tt(a int, b int) ENGINE=TIANMU; insert into tt values (3, 4); select * from tt where (a >= 3) AND (b = 5 AND a > 2 OR 0); drop table tt; diff --git a/mysql-test/suite/stonedb/t/issue433.testbak b/mysql-test/suite/tianmu/t/issue433.testbak similarity index 94% rename from mysql-test/suite/stonedb/t/issue433.testbak rename to mysql-test/suite/tianmu/t/issue433.testbak index fb0c11bf1f..c4dfbeec24 100644 --- a/mysql-test/suite/stonedb/t/issue433.testbak +++ b/mysql-test/suite/tianmu/t/issue433.testbak @@ -1,5 +1,5 @@ use test; -create table tt(val int) ENGINE=STONEDB; +create table tt(val int) ENGINE=TIANMU; insert into tt values (12); select * from tt where null in (null); select * from tt where null not in (null); diff --git a/mysql-test/suite/stonedb/t/issue446.testbak b/mysql-test/suite/tianmu/t/issue446.testbak similarity index 75% rename from mysql-test/suite/stonedb/t/issue446.testbak rename to mysql-test/suite/tianmu/t/issue446.testbak index a5c5f63103..6b02c8fd4d 100644 --- a/mysql-test/suite/stonedb/t/issue446.testbak +++ b/mysql-test/suite/tianmu/t/issue446.testbak @@ -1,5 +1,5 @@ use test; -create table tt (val double) ENGINE=STONEDB; +create table tt (val double) ENGINE=TIANMU; insert into tt values (1.2345); select 1 from (select * from tt) as A join tt where A.val > 1 XOR tt.val > 2; drop table tt; diff --git a/mysql-test/suite/stonedb/t/issue464.test b/mysql-test/suite/tianmu/t/issue464.test similarity index 97% rename from mysql-test/suite/stonedb/t/issue464.test rename to mysql-test/suite/tianmu/t/issue464.test index ee1e7b600e..56d0b7cef5 100644 --- a/mysql-test/suite/stonedb/t/issue464.test +++ b/mysql-test/suite/tianmu/t/issue464.test @@ -1,5 +1,5 @@ use test; -create table tt (date_test DATE, time_test TIME, datetime_test DATETIME, timestamp_test TIMESTAMP, year_test YEAR) ENGINE=STONEDB; +create table tt (date_test DATE, time_test TIME, datetime_test DATETIME, timestamp_test TIMESTAMP, year_test YEAR) ENGINE=TIANMU; insert into tt values ('2017-12-07', '02:03:04', '2017-12-08 05:06:07', '2018-11-08 09:10:11', '2020'); select DATE(date_test) from tt; select DATE(datetime_test) from tt; diff --git a/mysql-test/suite/stonedb/t/issue467.test b/mysql-test/suite/tianmu/t/issue467.test similarity index 77% rename from mysql-test/suite/stonedb/t/issue467.test rename to mysql-test/suite/tianmu/t/issue467.test index b8f4316de4..8f35659356 100644 --- a/mysql-test/suite/stonedb/t/issue467.test +++ b/mysql-test/suite/tianmu/t/issue467.test @@ -1,5 +1,5 @@ use test; -create table tt (date_test date) ENGINE=STONEDB; +create table tt (date_test date) ENGINE=TIANMU; insert into tt values ('2010-02-22'); select * from tt where (date_test<='2003-04-05')AND (date_test>='2011-06-22')OR (date_test<='2012-12-13' ); drop table tt; diff --git a/mysql-test/suite/stonedb/t/issue468.test b/mysql-test/suite/tianmu/t/issue468.test similarity index 88% rename from mysql-test/suite/stonedb/t/issue468.test rename to mysql-test/suite/tianmu/t/issue468.test index a5f00b4d0b..90da1e4235 100644 --- a/mysql-test/suite/stonedb/t/issue468.test +++ b/mysql-test/suite/tianmu/t/issue468.test @@ -1,5 +1,5 @@ use test; -create table tt (e1 int, e2 int, e3 int, e4 int, e5 int, e6 int, e7 int, e8 int, e9 int) ENGINE=STONEDB; +create table tt (e1 int, e2 int, e3 int, e4 int, e5 int, e6 int, e7 int, e8 int, e9 int) ENGINE=TIANMU; insert into tt values (1,1,1,0,0,0,0,1,0); select * from tt where (e1 AND ((e2 AND e3 AND (e4 OR e5)) OR e6) OR (e7 AND e8 AND e9)); select * from tt where (e1 AND ((e2 AND e3 AND (e4 OR e5)) OR 0) OR (e7 AND e8 AND e9)); diff --git a/mysql-test/suite/stonedb/t/issue469.test b/mysql-test/suite/tianmu/t/issue469.test similarity index 72% rename from mysql-test/suite/stonedb/t/issue469.test rename to mysql-test/suite/tianmu/t/issue469.test index f91d7db1b2..813f4418c4 100644 --- a/mysql-test/suite/stonedb/t/issue469.test +++ b/mysql-test/suite/tianmu/t/issue469.test @@ -1,5 +1,5 @@ use test; -create table tt (v1 int, v2 int, v3 int) ENGINE=STONEDB; +create table tt (v1 int, v2 int, v3 int) ENGINE=TIANMU; insert into tt values (20, 30, 40); select * from tt where (v1 = 20) OR ((v1 <=> 80) OR (v2 = 70) AND (v3 = 60)) AND (1); drop table tt; diff --git a/mysql-test/suite/stonedb/t/issue475.test b/mysql-test/suite/tianmu/t/issue475.test similarity index 70% rename from mysql-test/suite/stonedb/t/issue475.test rename to mysql-test/suite/tianmu/t/issue475.test index cf33bc7194..a30fbf6ec9 100644 --- a/mysql-test/suite/stonedb/t/issue475.test +++ b/mysql-test/suite/tianmu/t/issue475.test @@ -1,5 +1,5 @@ use test; -create table jl (date_test date) ENGINE=STONEDB; +create table jl (date_test date) ENGINE=TIANMU; insert into jl values ('2015-11-12'); select ADDTIME(date_test, '1 1:1:1.00002') from jl; drop table jl; diff --git a/mysql-test/suite/stonedb/t/issue496.test b/mysql-test/suite/tianmu/t/issue496.test similarity index 95% rename from mysql-test/suite/stonedb/t/issue496.test rename to mysql-test/suite/tianmu/t/issue496.test index e9d84e71ef..ead66a2d12 100644 --- a/mysql-test/suite/stonedb/t/issue496.test +++ b/mysql-test/suite/tianmu/t/issue496.test @@ -1,5 +1,5 @@ use test; -create table t1 (id int, name varchar(10) comment "LOOKUP") ENGINE=STONEDB; +create table t1 (id int, name varchar(10) comment "LOOKUP") ENGINE=TIANMU; insert into t1 values (1, 'one'); insert into t1 values (2, 'one'); insert into t1 values (3, 'one'); diff --git a/mysql-test/suite/stonedb/t/issue502.test b/mysql-test/suite/tianmu/t/issue502.test similarity index 90% rename from mysql-test/suite/stonedb/t/issue502.test rename to mysql-test/suite/tianmu/t/issue502.test index d8cecb6c41..99b2727d05 100644 --- a/mysql-test/suite/stonedb/t/issue502.test +++ b/mysql-test/suite/tianmu/t/issue502.test @@ -3,7 +3,7 @@ CREATE TABLE `auto_20` ( `pk` bigint(11) NOT NULL AUTO_INCREMENT, `varchar_test` varchar(255) DEFAULT NULL, PRIMARY KEY (`pk`) -) ENGINE=STONEDB DEFAULT CHARSET=gbk; +) ENGINE=TIANMU DEFAULT CHARSET=gbk; insert into auto_20(varchar_test) values('changsha'); insert into auto_20(varchar_test) values('aaaa'); insert into auto_20(varchar_test) values('bbb'); diff --git a/mysql-test/suite/stonedb/t/issue515.testbak b/mysql-test/suite/tianmu/t/issue515.testbak similarity index 83% rename from mysql-test/suite/stonedb/t/issue515.testbak rename to mysql-test/suite/tianmu/t/issue515.testbak index 4947b62efa..c916ad5e5a 100644 --- a/mysql-test/suite/stonedb/t/issue515.testbak +++ b/mysql-test/suite/tianmu/t/issue515.testbak @@ -1,5 +1,5 @@ use test; -create table timetest (val timestamp) ENGINE=STONEDB; +create table timetest (val timestamp) ENGINE=TIANMU; insert into timetest values ('2010-02-22 18:35:23'); select val not between '2010-02-22 18:35:23' and '2015-11-23 08:02:45' from (select * from timetest) as A; select val, val >= '2010-02-22 18:35:23' from (select * from timetest) as A; diff --git a/mysql-test/suite/stonedb/t/load.testbak b/mysql-test/suite/tianmu/t/load.testbak similarity index 90% rename from mysql-test/suite/stonedb/t/load.testbak rename to mysql-test/suite/tianmu/t/load.testbak index 5a2067e6d3..7854780f06 100644 --- a/mysql-test/suite/stonedb/t/load.testbak +++ b/mysql-test/suite/tianmu/t/load.testbak @@ -2,7 +2,7 @@ drop table if exists t1; --enable_warnings -create table t1 (a date, b date, c date not null, d date)engine=stonedb; +create table t1 (a date, b date, c date not null, d date)engine=TIANMU; load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; SELECT * from t1; @@ -27,7 +27,7 @@ CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob' -) ENGINE=Stonedb; -load data infile '../../std_data/stonedb/loadfile' into table column_type_test fields terminated by '|'; +) ENGINE=TIANMU; +load data infile '../../std_data/tianmu/loadfile' into table column_type_test fields terminated by '|'; select * from column_type_test; drop table column_type_test; \ No newline at end of file diff --git a/mysql-test/suite/stonedb/t/lz4.test b/mysql-test/suite/tianmu/t/lz4.test similarity index 99% rename from mysql-test/suite/stonedb/t/lz4.test rename to mysql-test/suite/tianmu/t/lz4.test index d13ec3aca9..96d1e88c12 100644 --- a/mysql-test/suite/stonedb/t/lz4.test +++ b/mysql-test/suite/tianmu/t/lz4.test @@ -17,7 +17,7 @@ CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'lz4', `c_text` text COMMENT 'lz4', `c_longblob` longblob COMMENT 'lz4' -) ENGINE=Stonedb; +) ENGINE=TIANMU; insert into column_type_test(c_tinyint,c_smallint,c_mediumint,c_int,c_bigint,c_float,c_double,c_decimal,c_date,c_datetime,c_timestamp,c_time,c_char,c_varchar,c_text) values(100,100,100,100,100,5.2,10.88,100.083,'2016-02-25','2016-02-25 10:20:01','2016-02-25 05:20:01','10:20:01','stoneatom','hello','bcdefghijklmn'); diff --git a/mysql-test/suite/stonedb/t/orquery.test b/mysql-test/suite/tianmu/t/orquery.test similarity index 92% rename from mysql-test/suite/stonedb/t/orquery.test rename to mysql-test/suite/tianmu/t/orquery.test index af27b1a0b0..53d4782efd 100644 --- a/mysql-test/suite/stonedb/t/orquery.test +++ b/mysql-test/suite/tianmu/t/orquery.test @@ -2,7 +2,7 @@ use test; CREATE TABLE `test_or` ( `id` int(11) DEFAULT NULL, `age` int(11) DEFAULT NULL -) ENGINE=STONEDB; +) ENGINE=TIANMU; insert into test_or values(1,1); insert into test_or values(2,2); select count(*) from test_or where id=1 or age=2; diff --git a/mysql-test/suite/stonedb/t/orquery1.test b/mysql-test/suite/tianmu/t/orquery1.test similarity index 93% rename from mysql-test/suite/stonedb/t/orquery1.test rename to mysql-test/suite/tianmu/t/orquery1.test index c568f69e26..1e5d49ab55 100644 --- a/mysql-test/suite/stonedb/t/orquery1.test +++ b/mysql-test/suite/tianmu/t/orquery1.test @@ -2,7 +2,7 @@ use test; CREATE TABLE `test_or` ( `id` int(11) DEFAULT NULL, `name` varchar(11) DEFAULT NULL -) ENGINE=STONEDB; +) ENGINE=TIANMU; insert into test_or values(1,'1'); insert into test_or values(2,'2'); select count(*) from test_or where id=1 or name='2'; diff --git a/mysql-test/suite/stonedb/t/truncate.test b/mysql-test/suite/tianmu/t/truncate.test similarity index 91% rename from mysql-test/suite/stonedb/t/truncate.test rename to mysql-test/suite/tianmu/t/truncate.test index 20e4b26c41..21eb42a5aa 100644 --- a/mysql-test/suite/stonedb/t/truncate.test +++ b/mysql-test/suite/tianmu/t/truncate.test @@ -17,9 +17,9 @@ CREATE TABLE `column_type_test` ( `c_blob` blob COMMENT 'blob', `c_text` text COMMENT 'text', `c_longblob` longblob COMMENT 'longblob' -) ENGINE=Stonedb; +) ENGINE=TIANMU; -load data infile '../../std_data/stonedb/bigdata4load' into table column_type_test fields terminated by '|'; +load data infile '../../std_data/tianmu/bigdata4load' into table column_type_test fields terminated by '|'; select count(*) from column_type_test; truncate table column_type_test; show create table column_type_test; diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index f5b304702c..2dbb489699 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -313,17 +313,17 @@ EXECUTE stmt; DROP PREPARE stmt; -- --- ADD SYS_STONEDB DATABASE --- STONEDB UPGRADE +-- ADD SYS_TIANMU DATABASE +-- TIANMU UPGRADE -- -SET @cmd= "DROP DATABASE IF EXISTS sys_stonedb"; +SET @cmd= "DROP DATABASE IF EXISTS sys_tianmu"; SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; -SET @cmd= "CREATE DATABASE sys_stonedb character set utf8"; +SET @cmd= "CREATE DATABASE sys_tianmu character set utf8"; SET @str = IF(@broken_pfs = 0, @cmd, 'SET @dummy = 0'); PREPARE stmt FROM @str; @@ -3364,11 +3364,11 @@ PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; -# Added for stonedb -CREATE TABLE IF NOT EXISTS sys_stonedb.decomposition_dictionary ( ID varchar(20) NOT NULL, RULE varchar(100) NOT NULL, COMMENT varchar(255) NOT NULL ) ENGINE=CSV; -CREATE TABLE IF NOT EXISTS sys_stonedb.columns ( database_name VARCHAR( 255 ) NOT NULL, table_name VARCHAR( 255 ) NOT NULL, column_name VARCHAR( 255 ) NOT NULL, decomposition VARCHAR( 20 ) NOT NULL ) ENGINE=CSV; +# Added for tianmu +CREATE TABLE IF NOT EXISTS sys_tianmu.decomposition_dictionary ( ID varchar(20) NOT NULL, RULE varchar(100) NOT NULL, COMMENT varchar(255) NOT NULL ) ENGINE=CSV; +CREATE TABLE IF NOT EXISTS sys_tianmu.columns ( database_name VARCHAR( 255 ) NOT NULL, table_name VARCHAR( 255 ) NOT NULL, column_name VARCHAR( 255 ) NOT NULL, decomposition VARCHAR( 20 ) NOT NULL ) ENGINE=CSV; set @had_decomp_dict_table= @@warning_count != 0; # this needs to be oneline here... see tool/column__ttl.sql for the readable script -CREATE TABLE IF NOT EXISTS sys_stonedb.column_ttl ( database_name VARCHAR( 255 ) NOT NULL, table_name VARCHAR( 255 ) NOT NULL, column_name VARCHAR( 255 ) NOT NULL, database_suffix VARCHAR( 255 ) NOT NULL, table_suffix VARCHAR( 255 ) NOT NULL, ttl INT NOT NULL ) ENGINE=CSV; -CREATE TABLE IF NOT EXISTS sys_stonedb.logs ( ts timestamp NOT NULL DEFAULT NOW(), msg VARCHAR(255) NOT NULL) ENGINE=CSV; -CREATE EVENT IF NOT EXISTS sys_stonedb.daily_event ON SCHEDULE EVERY 10 SECOND DO BEGIN DECLARE db_name_base VARCHAR(255); DECLARE tab_name_base VARCHAR(255); DECLARE col_name VARCHAR(255); DECLARE db_suffix VARCHAR(255); DECLARE tab_suffix VARCHAR(255); DECLARE db_name VARCHAR(255); DECLARE tab_name VARCHAR(255); DECLARE col_default VARCHAR(255); DECLARE nullable VARCHAR(255); DECLARE col_type VARCHAR(255); DECLARE col_comment VARCHAR(255); DECLARE pos INT; DECLARE col_def VARCHAR(255); DECLARE ttl_val INT; DECLARE not_found INT DEFAULT FALSE; DECLARE cur1 CURSOR FOR SELECT database_name, table_name, column_name, database_suffix, table_suffix, ttl FROM sys_stonedb.column_ttl; DECLARE CONTINUE HANDLER FOR NOT FOUND SET not_found = TRUE; OPEN cur1; loop1: LOOP FETCH cur1 INTO db_name_base,tab_name_base,col_name,db_suffix,tab_suffix,ttl_val; IF not_found THEN LEAVE loop1; END IF; BLOCK2: BEGIN DECLARE cur2 CURSOR FOR SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_DEFAULT,IS_NULLABLE,COLUMN_TYPE,COLUMN_COMMENT,ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA RLIKE CONCAT(db_name_base, db_suffix) AND TABLE_NAME RLIKE CONCAT_WS('_', tab_name_base, DATE_FORMAT(NOW() - INTERVAL ttl_val+1 DAY, '%Y%m%d'), tab_suffix) AND COLUMN_NAME=col_name; OPEN cur2; loop2: LOOP FETCH cur2 INTO db_name, tab_name, col_default, nullable,col_type,col_comment,pos; IF not_found THEN LEAVE loop2; END IF; set col_def = CONCAT_WS(' ', col_name, col_type); IF nullable='NO' THEN set col_def = CONCAT_WS(' ', col_def, "NOT NULL"); END IF; IF col_default IS NOT NULL THEN set col_def = CONCAT_WS(' ', col_def, "DEFAULT", col_default); END IF; SET col_comment = SUBSTRING(col_comment, 1, instr(col_comment, '; Size[MB]:')-1); IF col_comment != '' THEN set col_def = CONCAT(col_def, " COMMENT ", QUOTE(col_comment)); END IF; IF pos = 1 THEN set col_def = CONCAT_WS(' ', col_def, "FIRST"); ELSE set pos = pos-1; select COLUMN_NAME INTO @b4 from information_schema.columns where TABLE_SCHEMA=db_name AND TABLE_NAME=tab_name AND ORDINAL_POSITION=pos; set col_def = CONCAT_WS(' ', col_def, "AFTER", @b4); END IF; SET @sql_text = CONCAT('ALTER TABLE ', db_name, '.', tab_name, ' DROP COLUMN ', col_name); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; SET @sql_text = CONCAT('ALTER TABLE ', db_name, '.', tab_name, ' ADD COLUMN ', col_def); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; INSERT INTO sys_stonedb.logs(msg) VALUES (CONCAT_WS(' ', 'NULLed column', db_name, tab_name, col_def)); END LOOP; close cur2; END BLOCK2; END LOOP; END; +CREATE TABLE IF NOT EXISTS sys_tianmu.column_ttl ( database_name VARCHAR( 255 ) NOT NULL, table_name VARCHAR( 255 ) NOT NULL, column_name VARCHAR( 255 ) NOT NULL, database_suffix VARCHAR( 255 ) NOT NULL, table_suffix VARCHAR( 255 ) NOT NULL, ttl INT NOT NULL ) ENGINE=CSV; +CREATE TABLE IF NOT EXISTS sys_tianmu.logs ( ts timestamp NOT NULL DEFAULT NOW(), msg VARCHAR(255) NOT NULL) ENGINE=CSV; +CREATE EVENT IF NOT EXISTS sys_tianmu.daily_event ON SCHEDULE EVERY 10 SECOND DO BEGIN DECLARE db_name_base VARCHAR(255); DECLARE tab_name_base VARCHAR(255); DECLARE col_name VARCHAR(255); DECLARE db_suffix VARCHAR(255); DECLARE tab_suffix VARCHAR(255); DECLARE db_name VARCHAR(255); DECLARE tab_name VARCHAR(255); DECLARE col_default VARCHAR(255); DECLARE nullable VARCHAR(255); DECLARE col_type VARCHAR(255); DECLARE col_comment VARCHAR(255); DECLARE pos INT; DECLARE col_def VARCHAR(255); DECLARE ttl_val INT; DECLARE not_found INT DEFAULT FALSE; DECLARE cur1 CURSOR FOR SELECT database_name, table_name, column_name, database_suffix, table_suffix, ttl FROM sys_tianmu.column_ttl; DECLARE CONTINUE HANDLER FOR NOT FOUND SET not_found = TRUE; OPEN cur1; loop1: LOOP FETCH cur1 INTO db_name_base,tab_name_base,col_name,db_suffix,tab_suffix,ttl_val; IF not_found THEN LEAVE loop1; END IF; BLOCK2: BEGIN DECLARE cur2 CURSOR FOR SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_DEFAULT,IS_NULLABLE,COLUMN_TYPE,COLUMN_COMMENT,ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA RLIKE CONCAT(db_name_base, db_suffix) AND TABLE_NAME RLIKE CONCAT_WS('_', tab_name_base, DATE_FORMAT(NOW() - INTERVAL ttl_val+1 DAY, '%Y%m%d'), tab_suffix) AND COLUMN_NAME=col_name; OPEN cur2; loop2: LOOP FETCH cur2 INTO db_name, tab_name, col_default, nullable,col_type,col_comment,pos; IF not_found THEN LEAVE loop2; END IF; set col_def = CONCAT_WS(' ', col_name, col_type); IF nullable='NO' THEN set col_def = CONCAT_WS(' ', col_def, "NOT NULL"); END IF; IF col_default IS NOT NULL THEN set col_def = CONCAT_WS(' ', col_def, "DEFAULT", col_default); END IF; SET col_comment = SUBSTRING(col_comment, 1, instr(col_comment, '; Size[MB]:')-1); IF col_comment != '' THEN set col_def = CONCAT(col_def, " COMMENT ", QUOTE(col_comment)); END IF; IF pos = 1 THEN set col_def = CONCAT_WS(' ', col_def, "FIRST"); ELSE set pos = pos-1; select COLUMN_NAME INTO @b4 from information_schema.columns where TABLE_SCHEMA=db_name AND TABLE_NAME=tab_name AND ORDINAL_POSITION=pos; set col_def = CONCAT_WS(' ', col_def, "AFTER", @b4); END IF; SET @sql_text = CONCAT('ALTER TABLE ', db_name, '.', tab_name, ' DROP COLUMN ', col_name); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; SET @sql_text = CONCAT('ALTER TABLE ', db_name, '.', tab_name, ' ADD COLUMN ', col_def); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; INSERT INTO sys_tianmu.logs(msg) VALUES (CONCAT_WS(' ', 'NULLed column', db_name, tab_name, col_def)); END LOOP; close cur2; END BLOCK2; END LOOP; END; diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index aca1f484ab..45789f1d5a 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -25,66 +25,66 @@ -- --- added for stonedb -CREATE TEMPORARY TABLE tmp_decomp LIKE sys_stonedb.decomposition_dictionary; +-- added for tianmu +CREATE TEMPORARY TABLE tmp_decomp LIKE sys_tianmu.decomposition_dictionary; INSERT INTO tmp_decomp VALUES ('IPv4','PREDEFINED',''); INSERT INTO tmp_decomp VALUES ('IPv4_C','%d.%d.%d.%d',''); INSERT INTO tmp_decomp VALUES ('EMAIL','%s@%s',''); INSERT INTO tmp_decomp VALUES ('URL','%s://%s?%s',''); -INSERT INTO sys_stonedb.decomposition_dictionary SELECT * FROM tmp_decomp WHERE @had_decomp_dict_table=0; +INSERT INTO sys_tianmu.decomposition_dictionary SELECT * FROM tmp_decomp WHERE @had_decomp_dict_table=0; DROP TABLE tmp_decomp; -DROP trigger IF EXISTS sys_stonedb.before_insert_on_columns; -CREATE DEFINER=`root`@`localhost` TRIGGER sys_stonedb.before_insert_on_columns BEFORE INSERT ON sys_stonedb.columns FOR EACH ROW BEGIN select count(*) from sys_stonedb.columns where database_name = NEW.database_name and table_name = NEW.table_name and column_name = NEW.column_name into @count; IF @count <> 0 THEN SET @@stonedb_trigger_error = concat ('Insert failed: The decomposition for column ', NEW.database_name, '.', NEW.table_name, '.', NEW.column_name, ' already set.'); END IF; select count(*) from sys_stonedb.decomposition_dictionary where ID = NEW.decomposition into @count; IF @count = 0 THEN SET @@stonedb_trigger_error = concat ('Insert failed: The decomposition \'', NEW.decomposition, '\' does not exist.'); END IF; END ; +DROP trigger IF EXISTS sys_tianmu.before_insert_on_columns; +CREATE DEFINER=`root`@`localhost` TRIGGER sys_tianmu.before_insert_on_columns BEFORE INSERT ON sys_tianmu.columns FOR EACH ROW BEGIN select count(*) from sys_tianmu.columns where database_name = NEW.database_name and table_name = NEW.table_name and column_name = NEW.column_name into @count; IF @count <> 0 THEN SET @@tianmu_trigger_error = concat ('Insert failed: The decomposition for column ', NEW.database_name, '.', NEW.table_name, '.', NEW.column_name, ' already set.'); END IF; select count(*) from sys_tianmu.decomposition_dictionary where ID = NEW.decomposition into @count; IF @count = 0 THEN SET @@tianmu_trigger_error = concat ('Insert failed: The decomposition \'', NEW.decomposition, '\' does not exist.'); END IF; END ; -DROP trigger IF EXISTS sys_stonedb.before_update_on_columns; -CREATE DEFINER=`root`@`localhost` TRIGGER sys_stonedb.before_update_on_columns BEFORE UPDATE ON sys_stonedb.columns FOR EACH ROW BEGIN SELECT COUNT(*) FROM sys_stonedb.decomposition_dictionary WHERE ID = NEW.decomposition INTO @count; IF @count = 0 THEN SET @@stonedb_trigger_error = concat ('Update failed: The decomposition \'', NEW.decomposition, '\' does NOT exist.'); END IF; END ; +DROP trigger IF EXISTS sys_tianmu.before_update_on_columns; +CREATE DEFINER=`root`@`localhost` TRIGGER sys_tianmu.before_update_on_columns BEFORE UPDATE ON sys_tianmu.columns FOR EACH ROW BEGIN SELECT COUNT(*) FROM sys_tianmu.decomposition_dictionary WHERE ID = NEW.decomposition INTO @count; IF @count = 0 THEN SET @@tianmu_trigger_error = concat ('Update failed: The decomposition \'', NEW.decomposition, '\' does NOT exist.'); END IF; END ; -DROP trigger IF EXISTS sys_stonedb.before_insert_on_decomposition_dictionary; -CREATE DEFINER=`root`@`localhost` TRIGGER sys_stonedb.before_insert_on_decomposition_dictionary BEFORE INSERT ON sys_stonedb.decomposition_dictionary FOR EACH ROW BEGIN SELECT COUNT(*) FROM sys_stonedb.decomposition_dictionary WHERE ID = NEW.ID INTO @count; IF @count <> 0 THEN SET @@stonedb_trigger_error = concat ('Insert failed: The decomposition \'', NEW.ID, '\' already exists.'); END IF; select is_decomposition_rule_correct( NEW.RULE ) into @valid; IF @valid = 0 THEN SET @@stonedb_trigger_error = concat ('Insert failed: The decomposition rule \'', NEW.RULE, '\' is invalid.'); END IF; END ; +DROP trigger IF EXISTS sys_tianmu.before_insert_on_decomposition_dictionary; +CREATE DEFINER=`root`@`localhost` TRIGGER sys_tianmu.before_insert_on_decomposition_dictionary BEFORE INSERT ON sys_tianmu.decomposition_dictionary FOR EACH ROW BEGIN SELECT COUNT(*) FROM sys_tianmu.decomposition_dictionary WHERE ID = NEW.ID INTO @count; IF @count <> 0 THEN SET @@tianmu_trigger_error = concat ('Insert failed: The decomposition \'', NEW.ID, '\' already exists.'); END IF; select is_decomposition_rule_correct( NEW.RULE ) into @valid; IF @valid = 0 THEN SET @@tianmu_trigger_error = concat ('Insert failed: The decomposition rule \'', NEW.RULE, '\' is invalid.'); END IF; END ; -DROP trigger IF EXISTS sys_stonedb.before_update_on_decomposition_dictionary; -CREATE DEFINER=`root`@`localhost` TRIGGER sys_stonedb.before_update_on_decomposition_dictionary BEFORE UPDATE ON decomposition_dictionary FOR EACH ROW BEGIN IF OLD.RULE <> NEW.RULE then select is_decomposition_rule_correct( NEW.RULE ) into @valid; IF @valid = 0 THEN SET @@stonedb_trigger_error = concat ('Update failed: The decomposition rule \'', NEW.RULE, '\' is invalid.'); END IF; END IF; IF OLD.ID <> NEW.ID then SET @@stonedb_trigger_error = concat ('Update failed: The column ID is not allowed to be changed in DECOMPOSITION_DICTIONARY.'); END IF; END ; +DROP trigger IF EXISTS sys_tianmu.before_update_on_decomposition_dictionary; +CREATE DEFINER=`root`@`localhost` TRIGGER sys_tianmu.before_update_on_decomposition_dictionary BEFORE UPDATE ON decomposition_dictionary FOR EACH ROW BEGIN IF OLD.RULE <> NEW.RULE then select is_decomposition_rule_correct( NEW.RULE ) into @valid; IF @valid = 0 THEN SET @@tianmu_trigger_error = concat ('Update failed: The decomposition rule \'', NEW.RULE, '\' is invalid.'); END IF; END IF; IF OLD.ID <> NEW.ID then SET @@tianmu_trigger_error = concat ('Update failed: The column ID is not allowed to be changed in DECOMPOSITION_DICTIONARY.'); END IF; END ; -DROP trigger IF EXISTS sys_stonedb.before_delete_on_decomposition_dictionary; -CREATE DEFINER=`root`@`localhost` TRIGGER sys_stonedb.before_delete_on_decomposition_dictionary BEFORE DELETE ON sys_stonedb.decomposition_dictionary FOR EACH ROW BEGIN SELECT COUNT(*) FROM sys_stonedb.columns WHERE decomposition = OLD.ID INTO @count; IF @count <> 0 THEN SET @@stonedb_trigger_error = concat ('Delete failed: The decomposition \'', OLD.ID, '\' IS used IN at least one column.'); END IF; END ; +DROP trigger IF EXISTS sys_tianmu.before_delete_on_decomposition_dictionary; +CREATE DEFINER=`root`@`localhost` TRIGGER sys_tianmu.before_delete_on_decomposition_dictionary BEFORE DELETE ON sys_tianmu.decomposition_dictionary FOR EACH ROW BEGIN SELECT COUNT(*) FROM sys_tianmu.columns WHERE decomposition = OLD.ID INTO @count; IF @count <> 0 THEN SET @@tianmu_trigger_error = concat ('Delete failed: The decomposition \'', OLD.ID, '\' IS used IN at least one column.'); END IF; END ; -DROP trigger IF EXISTS sys_stonedb.after_insert_on_columns; -CREATE DEFINER=`root`@`localhost` TRIGGER sys_stonedb.after_insert_on_columns AFTER INSERT ON sys_stonedb.columns FOR EACH ROW BEGIN SET @@global.stonedb_refresh_sys_stonedb = TRUE; END ; +DROP trigger IF EXISTS sys_tianmu.after_insert_on_columns; +CREATE DEFINER=`root`@`localhost` TRIGGER sys_tianmu.after_insert_on_columns AFTER INSERT ON sys_tianmu.columns FOR EACH ROW BEGIN SET @@global.tianmu_refresh_sys_tianmu = TRUE; END ; -DROP trigger IF EXISTS sys_stonedb.after_update_on_columns; -CREATE DEFINER=`root`@`localhost` TRIGGER sys_stonedb.after_update_on_columns AFTER UPDATE ON sys_stonedb.columns FOR EACH ROW BEGIN SET @@global.stonedb_refresh_sys_stonedb = TRUE; END ; +DROP trigger IF EXISTS sys_tianmu.after_update_on_columns; +CREATE DEFINER=`root`@`localhost` TRIGGER sys_tianmu.after_update_on_columns AFTER UPDATE ON sys_tianmu.columns FOR EACH ROW BEGIN SET @@global.tianmu_refresh_sys_tianmu = TRUE; END ; -DROP trigger IF EXISTS sys_stonedb.after_delete_on_columns; -CREATE DEFINER=`root`@`localhost` TRIGGER sys_stonedb.after_delete_on_columns AFTER DELETE ON sys_stonedb.columns FOR EACH ROW BEGIN SET @@global.stonedb_refresh_sys_stonedb = TRUE; END ; +DROP trigger IF EXISTS sys_tianmu.after_delete_on_columns; +CREATE DEFINER=`root`@`localhost` TRIGGER sys_tianmu.after_delete_on_columns AFTER DELETE ON sys_tianmu.columns FOR EACH ROW BEGIN SET @@global.tianmu_refresh_sys_tianmu = TRUE; END ; -DROP trigger IF EXISTS sys_stonedb.after_insert_on_decomposition_dictionary; -CREATE DEFINER=`root`@`localhost` TRIGGER sys_stonedb.after_insert_on_decomposition_dictionary AFTER INSERT ON sys_stonedb.decomposition_dictionary FOR EACH ROW BEGIN SET @@global.stonedb_refresh_sys_stonedb = TRUE; END ; +DROP trigger IF EXISTS sys_tianmu.after_insert_on_decomposition_dictionary; +CREATE DEFINER=`root`@`localhost` TRIGGER sys_tianmu.after_insert_on_decomposition_dictionary AFTER INSERT ON sys_tianmu.decomposition_dictionary FOR EACH ROW BEGIN SET @@global.tianmu_refresh_sys_tianmu = TRUE; END ; -DROP trigger IF EXISTS sys_stonedb.after_update_on_decomposition_dictionary; -CREATE DEFINER=`root`@`localhost` TRIGGER sys_stonedb.after_update_on_decomposition_dictionary AFTER UPDATE ON sys_stonedb.decomposition_dictionary FOR EACH ROW BEGIN SET @@global.stonedb_refresh_sys_stonedb = TRUE; END ; +DROP trigger IF EXISTS sys_tianmu.after_update_on_decomposition_dictionary; +CREATE DEFINER=`root`@`localhost` TRIGGER sys_tianmu.after_update_on_decomposition_dictionary AFTER UPDATE ON sys_tianmu.decomposition_dictionary FOR EACH ROW BEGIN SET @@global.tianmu_refresh_sys_tianmu = TRUE; END ; -DROP trigger IF EXISTS sys_stonedb.after_delete_on_decomposition_dictionary; -CREATE DEFINER=`root`@`localhost` TRIGGER sys_stonedb.after_delete_on_decomposition_dictionary AFTER DELETE ON sys_stonedb.decomposition_dictionary FOR EACH ROW BEGIN SET @@global.stonedb_refresh_sys_stonedb = TRUE; END ; +DROP trigger IF EXISTS sys_tianmu.after_delete_on_decomposition_dictionary; +CREATE DEFINER=`root`@`localhost` TRIGGER sys_tianmu.after_delete_on_decomposition_dictionary AFTER DELETE ON sys_tianmu.decomposition_dictionary FOR EACH ROW BEGIN SET @@global.tianmu_refresh_sys_tianmu = TRUE; END ; -DROP PROCEDURE IF EXISTS `sys_stonedb`.`CREATE_RULE`; -CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_stonedb`.`CREATE_RULE` ( IN id_ VARCHAR(4000), IN expression_ VARCHAR(4000), IN comment_ VARCHAR(4000) ) BEGIN INSERT INTO sys_stonedb.decomposition_dictionary ( ID, RULE, COMMENT ) VALUES( id_, expression_, comment_ ); END; +DROP PROCEDURE IF EXISTS `sys_tianmu`.`CREATE_RULE`; +CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_tianmu`.`CREATE_RULE` ( IN id_ VARCHAR(4000), IN expression_ VARCHAR(4000), IN comment_ VARCHAR(4000) ) BEGIN INSERT INTO sys_tianmu.decomposition_dictionary ( ID, RULE, COMMENT ) VALUES( id_, expression_, comment_ ); END; -DROP PROCEDURE IF EXISTS `sys_stonedb`.`UPDATE_RULE`; -CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_stonedb`.`UPDATE_RULE` ( IN id_ VARCHAR(4000), IN expression_ VARCHAR(4000) ) BEGIN UPDATE sys_stonedb.decomposition_dictionary SET RULE = expression_ WHERE ID = id_; END; +DROP PROCEDURE IF EXISTS `sys_tianmu`.`UPDATE_RULE`; +CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_tianmu`.`UPDATE_RULE` ( IN id_ VARCHAR(4000), IN expression_ VARCHAR(4000) ) BEGIN UPDATE sys_tianmu.decomposition_dictionary SET RULE = expression_ WHERE ID = id_; END; -DROP PROCEDURE IF EXISTS `sys_stonedb`.`DELETE_RULE`; -CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_stonedb`.`DELETE_RULE` ( IN id_ VARCHAR(4000) ) BEGIN DELETE FROM sys_stonedb.decomposition_dictionary WHERE ID = id_; END; +DROP PROCEDURE IF EXISTS `sys_tianmu`.`DELETE_RULE`; +CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_tianmu`.`DELETE_RULE` ( IN id_ VARCHAR(4000) ) BEGIN DELETE FROM sys_tianmu.decomposition_dictionary WHERE ID = id_; END; -DROP PROCEDURE IF EXISTS `sys_stonedb`.`CHANGE_RULE_COMMENT`; -CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_stonedb`.`CHANGE_RULE_COMMENT` ( IN id_ VARCHAR(4000), IN comment_ VARCHAR(4000) ) BEGIN UPDATE sys_stonedb.decomposition_dictionary SET COMMENT = comment_ WHERE ID = id_; END; +DROP PROCEDURE IF EXISTS `sys_tianmu`.`CHANGE_RULE_COMMENT`; +CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_tianmu`.`CHANGE_RULE_COMMENT` ( IN id_ VARCHAR(4000), IN comment_ VARCHAR(4000) ) BEGIN UPDATE sys_tianmu.decomposition_dictionary SET COMMENT = comment_ WHERE ID = id_; END; -DROP PROCEDURE IF EXISTS `sys_stonedb`.`SET_DECOMPOSITION_RULE`; -CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_stonedb`.`SET_DECOMPOSITION_RULE` ( IN database_ VARCHAR(4000), IN table_ VARCHAR(4000), IN column_ VARCHAR(4000), IN id_ VARCHAR(4000) ) BEGIN DELETE FROM sys_stonedb.columns WHERE database_name = database_ AND table_name = table_ AND column_name = column_; INSERT INTO sys_stonedb.columns ( database_name, table_name, column_name, decomposition ) VALUES( database_, table_, column_, id_ ); END; +DROP PROCEDURE IF EXISTS `sys_tianmu`.`SET_DECOMPOSITION_RULE`; +CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_tianmu`.`SET_DECOMPOSITION_RULE` ( IN database_ VARCHAR(4000), IN table_ VARCHAR(4000), IN column_ VARCHAR(4000), IN id_ VARCHAR(4000) ) BEGIN DELETE FROM sys_tianmu.columns WHERE database_name = database_ AND table_name = table_ AND column_name = column_; INSERT INTO sys_tianmu.columns ( database_name, table_name, column_name, decomposition ) VALUES( database_, table_, column_, id_ ); END; -DROP PROCEDURE IF EXISTS `sys_stonedb`.`DELETE_DECOMPOSITION_RULE`; -CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_stonedb`.`DELETE_DECOMPOSITION_RULE` ( IN database_ VARCHAR(4000), IN table_ VARCHAR(4000), IN column_ VARCHAR(4000) ) BEGIN DELETE FROM sys_stonedb.columns WHERE database_name = database_ AND table_name = table_ AND column_name = column_; END; +DROP PROCEDURE IF EXISTS `sys_tianmu`.`DELETE_DECOMPOSITION_RULE`; +CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_tianmu`.`DELETE_DECOMPOSITION_RULE` ( IN database_ VARCHAR(4000), IN table_ VARCHAR(4000), IN column_ VARCHAR(4000) ) BEGIN DELETE FROM sys_tianmu.columns WHERE database_name = database_ AND table_name = table_ AND column_name = column_; END; -DROP PROCEDURE IF EXISTS `sys_stonedb`.`SHOW_DECOMPOSITION`; -CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_stonedb`.`SHOW_DECOMPOSITION` ( IN database_ VARCHAR(4000), IN table_ VARCHAR(4000) ) BEGIN SELECT s.ordinal_position AS '#', s.column_name AS 'column name', s.data_type AS 'data type', MIN( c.decomposition ) AS decomposition, MIN( d.rule ) AS rule FROM information_schema.columns AS s LEFT JOIN sys_stonedb.columns c ON s.table_schema = c.database_name AND s.table_name = c.table_name AND s.column_name = c.column_name LEFT JOIN sys_stonedb.decomposition_dictionary d ON c.decomposition = d.id WHERE s.table_schema = database_ AND s.table_name = table_ GROUP BY s.ordinal_position, s.column_name, s.data_type ORDER BY s.ordinal_position; END; +DROP PROCEDURE IF EXISTS `sys_tianmu`.`SHOW_DECOMPOSITION`; +CREATE DEFINER=`root`@`localhost` PROCEDURE `sys_tianmu`.`SHOW_DECOMPOSITION` ( IN database_ VARCHAR(4000), IN table_ VARCHAR(4000) ) BEGIN SELECT s.ordinal_position AS '#', s.column_name AS 'column name', s.data_type AS 'data type', MIN( c.decomposition ) AS decomposition, MIN( d.rule ) AS rule FROM information_schema.columns AS s LEFT JOIN sys_tianmu.columns c ON s.table_schema = c.database_name AND s.table_name = c.table_name AND s.column_name = c.column_name LEFT JOIN sys_tianmu.decomposition_dictionary d ON c.decomposition = d.id WHERE s.table_schema = database_ AND s.table_name = table_ GROUP BY s.ordinal_position, s.column_name, s.data_type ORDER BY s.ordinal_position; END; diff --git a/sql-common/client.c b/sql-common/client.c index d926d9ca84..7853714ebd 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -4124,8 +4124,8 @@ MYSQL *STDCALL CLI_MYSQL_REAL_CONNECT(MYSQL *mysql, const char *host, mysql_read_default_options( &mysql->options, (mysql->options.my_cnf_file ? -#if defined(STONEDB) - mysql->options.my_cnf_file : MYSQL_CONFIG_NAME), //STONEDB UPGRADE +#if defined(TIANMU) + mysql->options.my_cnf_file : MYSQL_CONFIG_NAME), //TIANMU UPGRADE #else mysql->options.my_cnf_file : "my"), #endif diff --git a/sql/binlog.cc b/sql/binlog.cc index 7f8968a9c0..5017b573d6 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -7606,7 +7606,7 @@ int MYSQL_BIN_LOG::rotate(bool force_rotate, bool* check_purge) void MYSQL_BIN_LOG::purge() { #ifdef HAVE_REPLICATION -#if defined(STONEDB) +#if defined(TIANMU) if (expire_logs_days >= 0.1) #else if (expire_logs_days) diff --git a/sql/handler.cc b/sql/handler.cc index aaaccc77a2..b01157d680 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -776,7 +776,7 @@ int ha_finalize_handlerton(st_plugin_int *plugin) if (!hton) goto end; -#if !defined(STONEDB) +#if !defined(TIANMU) switch (hton->state) { case SHOW_OPTION_NO: @@ -806,7 +806,7 @@ int ha_finalize_handlerton(st_plugin_int *plugin) } } -#if defined(STONEDB) +#if defined(TIANMU) switch (hton->state) { case SHOW_OPTION_NO: diff --git a/sql/handler.h b/sql/handler.h index f3ac656cf4..16072f9d11 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -305,7 +305,7 @@ enum enum_alter_inplace_result { /* The handler supports non-KEY auto_increment column */ -#define HA_NON_KEY_AUTO_INC (1LL << 48) //STONEDB UPGRADE +#define HA_NON_KEY_AUTO_INC (1LL << 48) //TIANMU UPGRADE /* bits in index_flags(index_number) for what you can do with index */ #define HA_READ_NEXT 1 /* TODO really use this flag */ @@ -417,7 +417,7 @@ enum legacy_db_type DB_TYPE_TABLE_FUNCTION, DB_TYPE_MEMCACHE, DB_TYPE_FALCON, - DB_TYPE_STONEDB, + DB_TYPE_TIANMU, DB_TYPE_MARIA, /** Performance schema engine. */ DB_TYPE_PERFORMANCE_SCHEMA, @@ -2826,9 +2826,9 @@ class handler :public Sql_alloc return HA_ERR_WRONG_COMMAND; } /** - StoneDB update + Tianmu update */ -#if defined(STONEDB) +#if defined(TIANMU) virtual bool explain_message(const Item *a_cond, String *buf) { return true; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 12189d12c1..2a28b4f7c2 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -529,7 +529,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item, !((*item)->field_type() == field_item->field_type() && (*item)->basic_const_item())) { - /* FIXME: Stonedb integration disables subquery execution in this phase */ + /* FIXME: Tianmu integration disables subquery execution in this phase */ if ((*item)->type()==Item::SUBSELECT_ITEM) return 0; TABLE *table= field->table; diff --git a/sql/item_create.cc b/sql/item_create.cc index 7aebda0ba7..a1a7e12242 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -4156,7 +4156,7 @@ class Create_func_year_week : public Create_native_func virtual ~Create_func_year_week() {} }; -#ifdef STONEDB +#ifdef TIANMU class Create_func_multivalue_find : public Create_func_arg3 { public: @@ -4835,7 +4835,7 @@ Create_func_degrees::create(THD *thd, Item *arg1) 180/M_PI, 0.0); } -#ifdef STONEDB +#ifdef TIANMU Create_func_multivalue_find Create_func_multivalue_find::s_singleton; Item* @@ -7852,7 +7852,7 @@ static Native_func_registry func_array[] = { { C_STRING_WITH_LEN("X") }, GEOM_BUILDER(Create_func_x_deprecated)}, { { C_STRING_WITH_LEN("Y") }, GEOM_BUILDER(Create_func_y_deprecated)}, { { C_STRING_WITH_LEN("YEARWEEK") }, BUILDER(Create_func_year_week)}, - #ifdef STONEDB + #ifdef TIANMU { { C_STRING_WITH_LEN("MULTIVALUE_FIND") }, BUILDER(Create_func_multivalue_find)}, #endif { {0, 0}, NULL} diff --git a/sql/item_func.cc b/sql/item_func.cc index f62727c8a7..726094373b 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -8961,7 +8961,7 @@ bool Item_func_version::itemize(Parse_context *pc, Item **res) pc->thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); return false; } -#ifdef STONEDB +#ifdef TIANMU std::set Item_func_multivalue_find::sepstr(const std::string &sStr, const std::string &sSep, bool withEmpty) { std::set setResult; diff --git a/sql/item_func.h b/sql/item_func.h index 9577187237..f5b7cba51e 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -33,7 +33,7 @@ class PT_item_list; /* Function items used by mysql */ -#ifdef STONEDB +#ifdef TIANMU #include #endif @@ -2891,7 +2891,7 @@ Item_field *get_gc_for_expr(Item_func **func, Field *fld, Item_result type); extern bool volatile mqh_used; -#ifdef STONEDB +#ifdef TIANMU class Item_func_multivalue_find :public Item_int_func { String value0,value1,value2; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index eb130a0dc6..8103852f83 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -3827,7 +3827,7 @@ ORDER::enum_order Item_func_group_concat::direction() { for (uint i= 0 ; i < arg_count_order ; i++) { - //just return the 1st arg order as StoneDB only support one + //just return the 1st arg order as Tianmu only support one return order_array[i].direction; } } diff --git a/sql/item_sum.h b/sql/item_sum.h index 01514961d5..d0f958a685 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -394,7 +394,7 @@ class Item_sum :public Item_result_field { init_aggregator(); } - //STONEDB UPGRADE + //TIANMU UPGRADE Item_sum() :next(NULL), quick_group(1), arg_count(0), forced_const(FALSE) { mark_as_sum_func(); @@ -718,7 +718,7 @@ class Item_sum_num :public Item_sum Item_sum_num(const POS &pos, PT_item_list *list) :Item_sum(pos, list), is_evaluated(FALSE) {} - //STONEDB UPGRADE + //TIANMU UPGRADE Item_sum_num() :Item_sum(),is_evaluated(FALSE) {} //END diff --git a/sql/log.cc b/sql/log.cc index 5c6ef4a93a..7ea4c99962 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -51,7 +51,7 @@ #include #endif -#include "stonedb.h" +#include "tianmu.h" using std::min; using std::max; @@ -2112,7 +2112,7 @@ static void print_buffer_to_file(enum loglevel level, const char *buffer, if (error_log_initialized) mysql_mutex_unlock(&LOCK_error_log); - stonedb_log(level, buffer, length); + tianmu_log(level, buffer, length); DBUG_VOID_RETURN; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index dcae3a754b..d1bab41f1c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -497,7 +497,7 @@ ulong binlog_cache_use= 0, binlog_cache_disk_use= 0; ulong binlog_stmt_cache_use= 0, binlog_stmt_cache_disk_use= 0; ulong max_connections, max_connect_errors; ulong rpl_stop_slave_timeout= LONG_TIMEOUT; -ulong stonedb_group_concat_max_len = 1024; +ulong tianmu_group_concat_max_len = 1024; my_bool log_bin_use_v1_row_events= 0; bool thread_cache_size_specified= false; bool host_cache_size_specified= false; @@ -525,7 +525,7 @@ ulong current_pid; uint sync_binlog_period= 0, sync_relaylog_period= 0, sync_relayloginfo_period= 0, sync_masterinfo_period= 0, opt_mts_checkpoint_period, opt_mts_checkpoint_group; -#if defined(STONEDB) +#if defined(TIANMU) double expire_logs_days = 0; #else ulong expire_logs_days = 0; @@ -863,7 +863,7 @@ static char shutdown_event_name[40]; static NTService Service; ///< Service object for WinNT #endif /* EMBEDDED_LIBRARY */ #endif /* _WIN32 */ -//STONEDB UPGRADE BEGIN +//TIANMU UPGRADE BEGIN #ifndef _WIN32 #if !defined(EMBEDDED_LIBRARY) static mysql_mutex_t LOCK_handler_count; @@ -928,7 +928,7 @@ static void delete_pid_file(myf flags); /**************************************************************************** ** Code to end mysqld ****************************************************************************/ -//STONEDB UPGRADE BEGIN +//TIANMU UPGRADE BEGIN static std::set _threadcb; int registeClose(CALLBACK_KILLTHREAD cb){ @@ -1528,7 +1528,7 @@ static void set_ports() #if MYSQL_PORT_DEFAULT == 0 struct servent *serv_ptr; - /* TODO: should we create a stonedb entry in /etc/services? */ + /* TODO: should we create a tianmu entry in /etc/services? */ if ((serv_ptr= getservbyname("mysql", "tcp"))) mysqld_port= ntohs((u_short) serv_ptr->s_port); /* purecov: inspected */ #endif @@ -2813,7 +2813,7 @@ int init_common_variables() be MyISAM) */ - default_storage_engine= const_cast("stonedb"); + default_storage_engine= const_cast("tianmu"); default_tmp_storage_engine= const_cast("InnoDB"); @@ -4348,7 +4348,7 @@ a file name for --log-bin-index option", opt_binlog_index_name); #endif locked_in_memory=0; -//STONEDB UPGRADE BEGIN +//TIANMU UPGRADE BEGIN #ifdef PR_SET_DUMPABLE if (test_flags & TEST_CORE_ON_SIGNAL) { @@ -4965,8 +4965,8 @@ int mysqld_main(int argc, char **argv) #ifdef HAVE_REPLICATION -//STONEDB UPGRADE -#if defined(STONEDB) +//TIANMU UPGRADE +#if defined(TIANMU) if (opt_bin_log && (expire_logs_days >= 0.1)) #else if (opt_bin_log && expire_logs_days) @@ -5751,10 +5751,10 @@ struct my_option my_long_early_options[]= "Port number to use for connection.", &opt_keyring_migration_port, &opt_keyring_migration_port, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -//STONEDB UPGRADE BEGIN -#if defined(STONEDB) - {"stonedb-data-dir", OPT_STONEDB_DATA_DIRECTORY, - "Specifies a directory to add to the stonedb data storage.", +//TIANMU UPGRADE BEGIN +#if defined(TIANMU) + {"tianmu-data-dir", OPT_TIANMU_DATA_DIRECTORY, + "Specifies a directory to add to the tianmu data storage.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif //END @@ -7041,7 +7041,7 @@ static void print_version(void) printf("%s Ver %s for %s on %s (%s)\n",my_progname, server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT); } -//STONEDB UPGRADE BEGIN +//TIANMU UPGRADE BEGIN static void print_build_info(void) { printf("build information as follow: \n"); @@ -7408,7 +7408,7 @@ mysqld_get_one_option(int optid, #ifndef EMBEDDED_LIBRARY case 'V': print_version(); - //STONEDB UPGRADE BEGIN + //TIANMU UPGRADE BEGIN print_build_info(); //END exit(MYSQLD_SUCCESS_EXIT); @@ -7753,14 +7753,14 @@ mysqld_get_one_option(int optid, case OPT_SHOW_OLD_TEMPORALS: push_deprecated_warn_no_replacement(NULL, "show_old_temporals"); break; -//STONEDB UPGRADE BEGIN -#if defined(STONEDB) - case OPT_STONEDB_DATA_DIRECTORY: - extern int stonedb_push_data_dir(const char*); - if (stonedb_push_data_dir(argument)) +//TIANMU UPGRADE BEGIN +#if defined(TIANMU) + case OPT_TIANMU_DATA_DIRECTORY: + extern int tianmu_push_data_dir(const char*); + if (tianmu_push_data_dir(argument)) { sql_print_error("Can't start server: " - "cannot process --stonedb-data-dir=%.*s", + "cannot process --tianmu-data-dir=%.*s", FN_REFLEN, argument); return 1; } diff --git a/sql/mysqld.h b/sql/mysqld.h index deeec801df..cab036d742 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -194,7 +194,7 @@ extern my_bool locked_in_memory; extern bool opt_using_transactions; extern ulong max_long_data_size; extern ulong current_pid; -#if defined(STONEDB) +#if defined(TIANMU) extern double expire_logs_days; #else extern ulong expire_logs_days; @@ -241,7 +241,7 @@ extern ulong aborted_threads; extern ulong delayed_insert_timeout; extern ulong delayed_insert_limit, delayed_queue_size; extern ulong delayed_insert_threads, delayed_insert_writes; -extern ulong stonedb_group_concat_max_len; +extern ulong tianmu_group_concat_max_len; extern ulong delayed_rows_in_use,delayed_insert_errors; extern Atomic_int32 slave_open_temp_tables; extern ulong query_cache_size, query_cache_min_res_unit; @@ -953,8 +953,8 @@ enum options_mysqld OPT_KEYRING_MIGRATION_SOCKET, OPT_KEYRING_MIGRATION_PORT, OPT_NAMED_PIPE_FULL_ACCESS_GROUP, -#if defined(STONEDB) - OPT_STONEDB_DATA_DIRECTORY, +#if defined(TIANMU) + OPT_TIANMU_DATA_DIRECTORY, #endif }; diff --git a/sql/opt_explain.cc b/sql/opt_explain.cc index 71d6941fe8..2901142ae9 100644 --- a/sql/opt_explain.cc +++ b/sql/opt_explain.cc @@ -1016,8 +1016,8 @@ bool Explain_table_base::explain_extra_common(int quick_type, StringBuffer<64> buff(cs); if (can_print_clauses()) ((Item *)pushed_cond)->print(&buff, cond_print_flags); - //STONEDB UPGRADE BEGIN - #if defined(STONEDB) + //TIANMU UPGRADE BEGIN + #if defined(TIANMU) table->file->explain_message(tab->condition_optim(), &buff); #endif //END diff --git a/sql/plistsort.c b/sql/plistsort.c index 564efb5ffe..13badd003a 100644 --- a/sql/plistsort.c +++ b/sql/plistsort.c @@ -107,7 +107,7 @@ LS_SCOPE LS_LIST_ITEM* LS_NAME(LS_COMPARE_FUNC_DECL LS_LIST_ITEM *list, int list return_point0: sp->list1= sorted_list; { - //STONEDB UPGRADE BEGIN + //TIANMU UPGRADE BEGIN register struct LS_STRUCT_NAME *sp0= sp++; //END list= list_end; @@ -117,7 +117,7 @@ LS_SCOPE LS_LIST_ITEM* LS_NAME(LS_COMPARE_FUNC_DECL LS_LIST_ITEM *list, int list goto recursion_point; return_point1: { - //STONEDB UPGRADE BEGIN + //TIANMU UPGRADE BEGIN register LS_LIST_ITEM **hook= &sorted_list; register LS_LIST_ITEM *list1= sp->list1; register LS_LIST_ITEM *list2= sorted_list; diff --git a/sql/records.cc b/sql/records.cc index 0bce180e84..7fc31d59c5 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -285,9 +285,9 @@ bool init_read_record(READ_RECORD *info,THD *thd, } else if (info->quick) { -#ifdef STONEDB - //pk processed by engine for stonedb - if (table->s->db_type()->db_type == DB_TYPE_STONEDB) { +#ifdef TIANMU + //pk processed by engine for tianmu + if (table->s->db_type()->db_type == DB_TYPE_TIANMU) { info->read_record = rr_sequential; if ((error = table->file->ha_rnd_init(1))) goto err; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index e4bfde28da..7e0deb655d 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -346,7 +346,7 @@ TODO list: #include #include #include -//STONEDB UPGRADE BEGIN +//TIANMU UPGRADE BEGIN //#ifdef WITH_MYISAMMRG_STORAGE_ENGINE #include "../storage/myisammrg/ha_myisammrg.h" #include "../storage/myisammrg/myrg_def.h" diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 285d63e399..15c2dce260 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1251,7 +1251,7 @@ THD::THD(bool enable_plugins) timer= NULL; timer_cache= NULL; - //STONEDB UPGRADE BEGIN + //TIANMU UPGRADE BEGIN //rplContextPtr = NULL; //END m_token_array= NULL; diff --git a/sql/sql_class.h b/sql/sql_class.h index 4ea471d9d4..fd4554ed63 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -201,7 +201,7 @@ extern LEX_CSTRING NULL_CSTR; extern "C" LEX_CSTRING thd_query_unsafe(MYSQL_THD thd); extern "C" size_t thd_query_safe(MYSQL_THD thd, char *buf, size_t buflen); -extern "C" LEX_STRING * thd_query_string (MYSQL_THD thd);//STONEDB UPGRADE +extern "C" LEX_STRING * thd_query_string (MYSQL_THD thd);//TIANMU UPGRADE /** @class CSET_STRING @@ -5083,8 +5083,8 @@ class Query_result_to_file :public Query_result_interceptor { void send_error(uint errcode,const char *err); bool send_eof(); void cleanup(); - //STONEDB UPGRADE BEGIN - // FIXME: for stonedb. this is a kludge! + //TIANMU UPGRADE BEGIN + // FIXME: for tianmu. this is a kludge! sql_exchange* get_sql_exchange() const { return exchange; } //END }; @@ -5100,14 +5100,14 @@ class Query_result_to_file :public Query_result_interceptor { class Query_result_export :public Query_result_to_file { - //STONEDB UPGRADE BEGIN -protected: // FIXME: for stonedb + //TIANMU UPGRADE BEGIN +protected: // FIXME: for tianmu size_t field_term_length; int field_sep_char,escape_char,line_sep_char; int field_term_char; // first char of FIELDS TERMINATED BY or MAX_INT bool fixed_row_size; private: -// STONEDB UPGRADE END +// TIANMU UPGRADE END /* The is_ambiguous_field_sep field is true if a value of the field_sep_char field is one of the 'n', 't', 'r' etc characters diff --git a/sql/sql_const.h b/sql/sql_const.h index 76261ea628..0d1efd8365 100644 --- a/sql/sql_const.h +++ b/sql/sql_const.h @@ -311,7 +311,7 @@ #define OPTIMIZER_SWITCH_PREFER_ORDERING_INDEX (1ULL << 19) #define OPTIMIZER_SWITCH_LAST (1ULL << 20) -#ifdef STONEDB /*Turn off SEMIJOIN by default as StoneDB does not support it*/ +#ifdef TIANMU /*Turn off SEMIJOIN by default as Tianmu does not support it*/ #define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \ OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \ OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \ diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 4b668cde77..065f7ccbb9 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -408,7 +408,7 @@ void Diagnostics_area::set_eof_status(THD *thd) { DBUG_ENTER("set_eof_status"); /* Only allowed to report eof if has not yet reported an error */ - //STONEDB UPGRADE BEGIN + //TIANMU UPGRADE BEGIN //assert(! is_set()); //END /* diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 1255f1c6bf..35cbf379da 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -830,10 +830,10 @@ bool Sql_cmd_insert::mysql_insert(THD *thd,TABLE_LIST *table_list) if (error <= 0 || thd->get_transaction()->cannot_safely_rollback( Transaction_ctx::STMT)) { -//STONEDB UPGRADE BEGIN -#if defined(STONEDB) - bool stonedb_engine = insert_table->s->db_type() ? insert_table->s->db_type()->db_type == DB_TYPE_STONEDB : false; - if (mysql_bin_log.is_open()&& !stonedb_engine) +//TIANMU UPGRADE BEGIN +#if defined(TIANMU) + bool tianmu_engine = insert_table->s->db_type() ? insert_table->s->db_type()->db_type == DB_TYPE_TIANMU: false; + if (mysql_bin_log.is_open()&& !tianmu_engine) #else if (mysql_bin_log.is_open()) #endif diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index a705273cb7..f28acb791d 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -996,7 +996,7 @@ static LEX_STRING get_quoted_token(Lex_input_stream *lip, static char *get_text(Lex_input_stream *lip, int pre_skip, int post_skip) { - reg1 uchar c,sep; //STONEDB UPGRADE + reg1 uchar c,sep; //TIANMU UPGRADE uint found_escape=0; const CHARSET_INFO *cs= lip->m_thd->charset(); @@ -1383,7 +1383,7 @@ int MYSQLlex(YYSTYPE *yylval, YYLTYPE *yylloc, THD *thd) static int lex_one_token(YYSTYPE *yylval, THD *thd) { - reg1 char c= 0; //STONEDB UPGRADE + reg1 char c= 0; //TIANMU UPGRADE bool comment_closed; int tokval, result_state; uint length; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index e78f6e4362..69996f0551 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -147,7 +147,7 @@ enum keytype { enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME }; -enum enum_filetype { FILETYPE_CSV, FILETYPE_XML,FILETYPE_MEM };//STONEDB UPGRADE +enum enum_filetype { FILETYPE_CSV, FILETYPE_XML,FILETYPE_MEM };//TIANMU UPGRADE enum fk_match_opt { FK_MATCH_UNDEF, FK_MATCH_FULL, FK_MATCH_PARTIAL, FK_MATCH_SIMPLE}; @@ -533,8 +533,8 @@ class st_select_lex_unit: public Sql_alloc SELECT_LEX *master; /// The first query block in this query expression. SELECT_LEX *slave; - ulonglong found_rows_for_union;//STONEDB UPGRADE - bool saved_error; //STONEDB UPGRADE + ulonglong found_rows_for_union;//TIANMU UPGRADE + bool saved_error; //TIANMU UPGRADE private: /** Marker for subqueries in WHERE, HAVING, ORDER BY, GROUP BY and @@ -655,9 +655,9 @@ class st_select_lex_unit: public Sql_alloc bool prepare(THD *thd, Query_result *result, ulonglong added_options, ulonglong removed_options); bool optimize(THD *thd); - //STONEDB UPGRADE END - int optimize_for_stonedb(); - int optimize_after_stonedb(); + //TIANMU UPGRADE END + int optimize_for_tianmu(); + int optimize_after_tianmu(); //END bool execute(THD *thd); bool explain(THD *ethd); diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 0527b4b4cb..358d6c6eb9 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -51,7 +51,7 @@ #include -#include "../storage/stonedb/handler/ha_rcengine.h" // stonedb code +#include "../storage/tianmu/handler/ha_rcengine.h" // tianmu code using std::min; using std::max; @@ -216,8 +216,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, const char *tdb= thd->db().str ? thd->db().str : db; //Result is never null ulong skip_lines= ex->skip_lines; DBUG_ENTER("mysql_load"); - //STONEDB UPGRADE BEGIN - //bool stonedb::dbhandler::stonedb_load(THD *thd, sql_exchange *ex, TABLE_LIST *table_list, void* arg); if (mysql_bin_log.is_open()) { lf_info.thd = thd; @@ -310,8 +308,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->table_name); DBUG_RETURN(TRUE); } - //STONEDB UPGRADE BEGIN - if (!stonedb::dbhandler::stonedb_load(thd, ex, table_list, (void*) &lf_info)) { + // TIANMU UPGRADE BEGIN + if (!Tianmu::dbhandler::tianmu_load(thd, ex, table_list, (void*) &lf_info)) { DBUG_RETURN(FALSE); } //END diff --git a/sql/sql_optimizer.cc b/sql/sql_optimizer.cc index 83756ead6b..8485cfa791 100644 --- a/sql/sql_optimizer.cc +++ b/sql/sql_optimizer.cc @@ -135,7 +135,7 @@ static uint32 get_key_length_tmp_table(Item *item); @retval 1 Error, error code saved in member JOIN::error. */ int -JOIN::optimize(unsigned char part) //STONEDB UPGRADE +JOIN::optimize(unsigned char part) //TIANMU UPGRADE { uint no_jbuf_after= UINT_MAX; @@ -146,7 +146,7 @@ JOIN::optimize(unsigned char part) //STONEDB UPGRADE //assert(tables == 0 && // primary_tables == 0 && // tables_list == (TABLE_LIST*)1); - //STONEDB UPGRADE BEGIN + //TIANMU UPGRADE BEGIN /* Two more values of part were introduced part=3 and part=4. The main reason is to break optimization in sense of part=2 in point where all transformations of LOJ conditions are finished. The optimization is continued in case we switch to MySQL. @@ -189,7 +189,7 @@ JOIN::optimize(unsigned char part) //STONEDB UPGRADE if (select_lex->apply_local_transforms(thd, false)) DBUG_RETURN(error= 1); } - //STONEDB UPGRADE + //TIANMU UPGRADE /* Opt_trace_context * const trace= &thd->opt_trace; Opt_trace_object trace_wrapper(trace); @@ -257,11 +257,11 @@ JOIN::optimize(unsigned char part) //STONEDB UPGRADE best_rowcount= 0; goto setup_subq_exit; } - }//STONEDB UPGRADE END part=0||part=1 + }//TIANMU UPGRADE END part=0||part=1 if (where_cond || select_lex->outer_join) { if (optimize_cond(thd, &where_cond, &cond_equal, - &select_lex->top_join_list, &select_lex->cond_value,part))//STONEDB UPGRADE + &select_lex->top_join_list, &select_lex->cond_value,part))//TIANMU UPGRADE { error= 1; DBUG_PRINT("error",("Error from optimize_cond")); @@ -277,7 +277,7 @@ JOIN::optimize(unsigned char part) //STONEDB UPGRADE if (having_cond) { if (optimize_cond(thd, &having_cond, &cond_equal, NULL, - &select_lex->having_value, part))//STONEDB UPGRADE + &select_lex->having_value, part))//TIANMU UPGRADE { error= 1; DBUG_PRINT("error",("Error from optimize_cond")); @@ -290,7 +290,7 @@ JOIN::optimize(unsigned char part) //STONEDB UPGRADE goto setup_subq_exit; } } - //STONEDB UPGRADE + //TIANMU UPGRADE if (part == 1) { error= 0; @@ -436,7 +436,7 @@ JOIN::optimize(unsigned char part) //STONEDB UPGRADE } if (const_tables && !thd->locked_tables_mode && - !(select_lex->active_options() & SELECT_NO_UNLOCK )&& part!=3) //STONEDB UPGRADE + !(select_lex->active_options() & SELECT_NO_UNLOCK )&& part!=3) //TIANMU UPGRADE { TABLE *ct[MAX_TABLES]; for (uint i= 0; i < const_tables; i++) @@ -493,7 +493,7 @@ JOIN::optimize(unsigned char part) //STONEDB UPGRADE tab->join_cond()->update_used_tables(); } } - //STONEDB UPGRADE BEGIN + //TIANMU UPGRADE BEGIN // this is end of part=3 and beginning of part=4 if(part == 3) { DBUG_RETURN(0); // error == 0 @@ -10032,7 +10032,7 @@ ORDER *JOIN::remove_const(ORDER *first_order, Item *cond, bool change_list, bool optimize_cond(THD *thd, Item **cond, COND_EQUAL **cond_equal, List *join_list, Item::cond_result *cond_value, - unsigned char part)//STONEDB UPGRADE + unsigned char part)//TIANMU UPGRADE { Opt_trace_context * const trace= &thd->opt_trace; DBUG_ENTER("optimize_cond"); @@ -10287,7 +10287,7 @@ static bool internal_remove_eq_conds(THD *thd, Item *cond, if (cond->const_item()) { if (part!=1 || cond->type()!=Item::SUBSELECT_ITEM) - {//STONEDB UPGRADE + {//TIANMU UPGRADE bool value; if (eval_const_cond(thd, cond, &value)) return true; @@ -10349,7 +10349,7 @@ static bool internal_remove_eq_conds(THD *thd, Item *cond, */ bool remove_eq_conds(THD *thd, Item *cond, Item **retcond, - Item::cond_result *cond_value, unsigned char part)//STONEDB UPGRADE + Item::cond_result *cond_value, unsigned char part)//TIANMU UPGRADE { if (cond->type() == Item::FUNC_ITEM && down_cast(cond)->functype() == Item_func::ISNULL_FUNC) @@ -10400,7 +10400,7 @@ bool remove_eq_conds(THD *thd, Item *cond, Item **retcond, } } } - return internal_remove_eq_conds(thd, cond, retcond, cond_value, part);//STONEDB UPGRADE + return internal_remove_eq_conds(thd, cond, retcond, cond_value, part);//TIANMU UPGRADE } diff --git a/sql/sql_optimizer.h b/sql/sql_optimizer.h index 236697701f..47ef82ec60 100644 --- a/sql/sql_optimizer.h +++ b/sql/sql_optimizer.h @@ -172,7 +172,7 @@ class JOIN :public Sql_alloc SELECT_LEX_UNIT *const unit; /// Thread handler THD *const thd; - //STONEDB UPGRADE + //TIANMU UPGRADE List *join_list; ulonglong select_options; /** @@ -556,7 +556,7 @@ class JOIN :public Sql_alloc */ bool plan_is_single_table() { return primary_tables - const_tables == 1; } - int optimize(unsigned char part = 0);//STONEDB UPGRADE + int optimize(unsigned char part = 0);//TIANMU UPGRADE void reset(); void exec(); bool prepare_result(); @@ -874,10 +874,10 @@ class Prepare_error_tracker bool uses_index_fields_only(Item *item, TABLE *tbl, uint keyno, bool other_tbls_ok); bool remove_eq_conds(THD *thd, Item *cond, Item **retcond, - Item::cond_result *cond_value, unsigned char part = 0);//STONEDB UPGRADE + Item::cond_result *cond_value, unsigned char part = 0);//TIANMU UPGRADE bool optimize_cond(THD *thd, Item **conds, COND_EQUAL **cond_equal, List *join_list, - Item::cond_result *cond_value, unsigned char part = 0);//STONEDB UPGRADE + Item::cond_result *cond_value, unsigned char part = 0);//TIANMU UPGRADE Item* substitute_for_best_equal_field(Item *cond, COND_EQUAL *cond_equal, void *table_join_idx); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c9dfa37cb0..63bd520662 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -118,7 +118,7 @@ #include "rpl_group_replication.h" #include -#include "../storage/stonedb/handler/ha_rcengine.h" // stonedb code +#include "../storage/tianmu/handler/ha_rcengine.h" // tianmu code using std::max; /** @@ -3259,10 +3259,10 @@ case SQLCOM_PREPARE: */ //res= handle_query(thd, lex, result, SELECT_NO_UNLOCK, 0); - // StoneDB hook added + // Tianmu hook added - int sdb_res, free_join_from_sdb, optimize_after_sdb;//STONEDB UPGRADE - if (stonedb::dbhandler::SDB_HandleSelect(thd, lex, result, 0, sdb_res, optimize_after_sdb, free_join_from_sdb, (int)true) == 0) + int sdb_res, free_join_from_sdb, optimize_after_sdb;//TIANMU UPGRADE + if (Tianmu::dbhandler::TIANMU_HandleSelect(thd, lex, result, 0, sdb_res, optimize_after_sdb, free_join_from_sdb, (int)true) == 0) res = handle_query(thd, lex, result, SELECT_NO_UNLOCK, (ulong)0, optimize_after_sdb, free_join_from_sdb); else res = sdb_res; @@ -3727,7 +3727,7 @@ case SQLCOM_PREPARE: if ((check_table_access(thd, SELECT_ACL, all_tables, FALSE, UINT_MAX, FALSE) || open_and_lock_tables(thd, all_tables, 0))) goto error; - if (!stonedb::dbhandler::SDB_SetStatementAllowed(thd, lex)) { + if (!Tianmu::dbhandler::TIANMU_SetStatementAllowed(thd, lex)) { goto error; } if (!(res= sql_set_variables(thd, lex_var_list))) @@ -5179,7 +5179,7 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables) //res= handle_query(thd, lex, result, 0, 0, 0, 0); int sdb_res, free_join_from_sdb, optimize_after_sdb;//ATIMSTORE UPGRADE - if (stonedb::dbhandler::SDB_HandleSelect(thd, lex, result, (ulong)0, + if (Tianmu::dbhandler::TIANMU_HandleSelect(thd, lex, result, (ulong)0, sdb_res, optimize_after_sdb, free_join_from_sdb) == 0) { res = handle_query(thd, lex, result, (ulonglong)0, (ulonglong)0, optimize_after_sdb, free_join_from_sdb); } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 0d3704de12..1b19995c84 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -145,7 +145,7 @@ bool handle_query(THD *thd, LEX *lex, Query_result *result, ulonglong added_opti { res = FALSE; if (optimize_after_bh) - res = lex->unit->optimize_after_stonedb(); // optimization after Stonedb + res = lex->unit->optimize_after_tianmu(); // optimization after Tianmu if (!res) if (unit->prepare(thd, result, SELECT_NO_UNLOCK | added_options, removed_options)) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 264a311ee6..1c4c752108 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -77,7 +77,7 @@ #include #include -#include "../storage/stonedb/handler/ha_rcengine.h" //STONEDB UPGRADE +#include "../storage/tianmu/handler/ha_rcengine.h" // TIANMU UPGRADE using std::max; using std::min; @@ -5223,7 +5223,7 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables, table->field[18]->set_notnull(); } - //STONEDB UPGRADE BEGIN + //TIANMU UPGRADE BEGIN char* comment=share->comment.str; if (comment) { @@ -5535,7 +5535,7 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables, table->field[IS_COLUMNS_GENERATION_EXPRESSION]->set_null(); //table->field[IS_COLUMNS_COLUMN_COMMENT]->store(field->comment.str, // field->comment.length, cs); - stonedb::dbhandler::SDB_UpdateAndStoreColumnComment(table, IS_COLUMNS_COLUMN_COMMENT, field, count - 1, cs);//STONEDB UPGRADE + Tianmu::dbhandler::TIANMU_UpdateAndStoreColumnComment(table, IS_COLUMNS_COLUMN_COMMENT, field, count - 1, cs);//TIANMU UPGRADE if (schema_table_store_record(thd, table)) DBUG_RETURN(1); } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 0392bcf2f6..0bac02ce3a 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -74,7 +74,7 @@ #include -#include "mysys_err.h" //STONEDB UPGRADE +#include "mysys_err.h" //TIANMU UPGRADE using std::max; using std::min; @@ -4522,7 +4522,7 @@ mysql_prepare_create_table(THD *thd, const char *error_schema_name, my_message(ER_REQUIRES_PRIMARY_KEY, ER(ER_REQUIRES_PRIMARY_KEY), MYF(0)); DBUG_RETURN(TRUE); } - if (auto_increment > 0 && !(file->ha_table_flags() & HA_NON_KEY_AUTO_INC))//STONEDB UPGRADE + if (auto_increment > 0 && !(file->ha_table_flags() & HA_NON_KEY_AUTO_INC))//TIANMU UPGRADE { my_message(ER_WRONG_AUTO_KEY, ER(ER_WRONG_AUTO_KEY), MYF(0)); DBUG_RETURN(TRUE); @@ -5702,7 +5702,7 @@ mysql_rename_table(handlerton *base, const char *old_db, else if (error) { char errbuf[MYSYS_STRERROR_SIZE]; - //STONEDB UPGRADE + //TIANMU UPGRADE if( error == -1 ) my_error(EE_DROP_COLUMN, MYF(0)); //END diff --git a/sql/sql_tmp_table.cc b/sql/sql_tmp_table.cc index 1cd688048c..fb7aa2c65a 100644 --- a/sql/sql_tmp_table.cc +++ b/sql/sql_tmp_table.cc @@ -1074,7 +1074,7 @@ create_tmp_table(THD *thd, Temp_table_param *param, List &fields, table->file= get_new_handler(share, &table->mem_root, share->db_type()); } - else if (blob_count || (heap_hton == NULL) || //STONEDB UPGRADE + else if (blob_count || (heap_hton == NULL) || //TIANMU UPGRADE (thd->variables.big_tables && !(select_options & SELECT_SMALL_RESULT))) { diff --git a/sql/sql_union.cc b/sql/sql_union.cc index af33016c39..44ef561805 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -721,7 +721,7 @@ bool st_select_lex_unit::optimize(THD *thd) if (query_result()) query_result()->estimated_rowcount+= sl->is_implicitly_grouped() || sl->join->group_optimized_away ? - 2 : sl->join->best_rowcount; //STONEDB UPGRADE + 2 : sl->join->best_rowcount; //TIANMU UPGRADE } if (fake_select_lex) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 5da198796e..a241df636b 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -963,7 +963,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, YYLTYPE **c, ulong *yystacksize); %token RIGHT /* SQL-2003-R */ %token ROLLBACK_SYM /* SQL-2003-R */ %token ROLLUP_SYM /* SQL-2003-R */ -%token ROUGHLY_SYM /*STONEDB UPGRADE*/ +%token ROUGHLY_SYM /*TIANMU UPGRADE*/ %token ROTATE_SYM %token ROUTINE_SYM /* SQL-2003-N */ %token ROWS_SYM /* SQL-2003-R */ @@ -14872,7 +14872,7 @@ query_spec_option: | DISTINCT { $$= SELECT_DISTINCT; } | SQL_SMALL_RESULT { $$= SELECT_SMALL_RESULT; } | SQL_BIG_RESULT { $$= SELECT_BIG_RESULT; } - | ROUGHLY_SYM { $$= SELECT_ROUGHLY; }//STONEDB UPGRADE + | ROUGHLY_SYM { $$= SELECT_ROUGHLY; }//TIANMU UPGRADE | SQL_BUFFER_RESULT { $$= OPTION_BUFFER_RESULT; } | SQL_CALC_FOUND_ROWS { $$= OPTION_FOUND_ROWS; } | ALL { $$= SELECT_ALL; } diff --git a/sql/stonedb.h b/sql/stonedb.h deleted file mode 100755 index e5eef7c036..0000000000 --- a/sql/stonedb.h +++ /dev/null @@ -1,8 +0,0 @@ -/* Copyright (c) 2021, StoneAtom Group Holding Limited. All rights reserved. */ - -#pragma once - -// stonedb interface for mysql server - -void stonedb_log(enum loglevel level, const char *buffer, size_t length); - diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 4ef8b9b689..8ddd0aef9d 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1636,8 +1636,8 @@ static Sys_var_enum Sys_event_scheduler( NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(event_scheduler_check), ON_UPDATE(event_scheduler_update)); #endif -//STONEDB UPGRADE BEGIN -#if defined(STONEDB) +//TIANMU UPGRADE BEGIN +#if defined(TIANMU) static Sys_var_double Sys_expire_logs_days( "expire_logs_days", "If non-zero, binary logs will be purged after expire_logs_days " @@ -4894,7 +4894,7 @@ static Sys_var_ulong Sys_default_week_format( "The default week format used by WEEK() functions", SESSION_VAR(default_week_format), CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 7), DEFAULT(0), BLOCK_SIZE(1)); -//STONEDB UPGRADE BEGIN +//TIANMU UPGRADE BEGIN /* static Sys_var_ulong Sys_group_concat_max_len( "group_concat_max_len", @@ -4902,10 +4902,10 @@ static Sys_var_ulong Sys_group_concat_max_len( SESSION_VAR(group_concat_max_len), CMD_LINE(REQUIRED_ARG), VALID_RANGE(4, ULONG_MAX), DEFAULT(1024), BLOCK_SIZE(1)); */ -static bool upd_stonedb_group_concat_max_len(sys_var *self, THD *thd, enum_var_type type) +static bool upd_tianmu_group_concat_max_len(sys_var *self, THD *thd, enum_var_type type) { if (type == OPT_SESSION) - stonedb_group_concat_max_len = thd->variables.group_concat_max_len; + tianmu_group_concat_max_len = thd->variables.group_concat_max_len; return false; } static Sys_var_ulong Sys_group_concat_max_len( @@ -4913,7 +4913,7 @@ static Sys_var_ulong Sys_group_concat_max_len( "The maximum length of the result of function GROUP_CONCAT()", SESSION_VAR(group_concat_max_len), CMD_LINE(REQUIRED_ARG), VALID_RANGE(4, ULONG_MAX), DEFAULT(1024), BLOCK_SIZE(1), - NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(upd_stonedb_group_concat_max_len), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(upd_tianmu_group_concat_max_len), DEPRECATED("")); //END static char *glob_hostname_ptr; diff --git a/sql/sys_vars.h b/sql/sys_vars.h index 59759f8132..55eab21e07 100644 --- a/sql/sys_vars.h +++ b/sql/sys_vars.h @@ -91,7 +91,7 @@ #else #define GET_HA_ROWS GET_ULONG #endif -#define DEPRECATED(X) X //STONEDB UPGRADE +#define DEPRECATED(X) X //TIANMU UPGRADE extern sys_var_chain all_sys_vars; enum charset_enum {IN_SYSTEM_CHARSET, IN_FS_CHARSET}; diff --git a/sql/table.cc b/sql/table.cc index a56a3863bb..0af29643ab 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2638,7 +2638,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, &share->next_number_key_offset, &share->next_number_keypart)) < 0) */ - //STONEDB UPGRADE + //TIANMU UPGRADE share->next_number_index= (uint) find_ref_key(share->key_info, share->keys, share->default_values, reg_field, &share->next_number_key_offset, @@ -3927,7 +3927,7 @@ static uint find_field(Field **fields, uchar *record, uint start, uint length) /* Check that the integer is in the internal */ -int set_zone(register int nr, int min_zone, int max_zone)//STONEDB UPGRADE +int set_zone(register int nr, int min_zone, int max_zone)//TIANMU UPGRADE { if (nr<=min_zone) return (min_zone); @@ -3938,7 +3938,7 @@ int set_zone(register int nr, int min_zone, int max_zone)//STONEDB UPGRADE /* Adjust number to next larger disk buffer */ -ulong next_io_size(register ulong pos)//STONEDB UPGRADE +ulong next_io_size(register ulong pos)//TIANMU UPGRADE { ulong offset; if ((offset= pos & (IO_SIZE-1))) @@ -4004,7 +4004,7 @@ File create_frm(THD *thd, const char *name, const char *db, const char *table, uint reclength, uchar *fileinfo, HA_CREATE_INFO *create_info, uint keys, KEY *key_info) { - register File file; //STONEDB UPGRADE + register File file; //TIANMU UPGRADE ulong length; uchar fill[IO_SIZE]; int create_flags= O_RDWR | O_TRUNC; diff --git a/sql/tianmu.h b/sql/tianmu.h new file mode 100755 index 0000000000..fc0db69353 --- /dev/null +++ b/sql/tianmu.h @@ -0,0 +1,8 @@ +/* Copyright (c) 2021, StoneAtom Group Holding Limited. All rights reserved. */ + +#pragma once + +// tianmu interface for mysql server + +void tianmu_log(enum loglevel level, const char *buffer, size_t length); + diff --git a/sql/tztime.cc b/sql/tztime.cc index a374e68667..78f47ea916 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -835,8 +835,8 @@ sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec) return ((days * HOURS_PER_DAY + hour) * MINS_PER_HOUR + min) * SECS_PER_MIN + sec; } -// FIXME: for stonedb -my_time_t stonedb_sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec) +// FIXME: for tianmu +my_time_t tianmu_sec_since_epoch(int year, int mon, int mday, int hour, int min ,int sec) { return sec_since_epoch(year, mon, mday, hour, min ,sec); } diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h index 97c46049ec..1b7cecdd35 100644 --- a/storage/heap/ha_heap.h +++ b/storage/heap/ha_heap.h @@ -124,7 +124,7 @@ class ha_heap: public handler return memcmp(ref1, ref2, sizeof(HEAP_PTR)); } bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); - HP_INFO* get_hp_info() { return file; } //STONEDB UPGRADE + HP_INFO* get_hp_info() { return file; } //TIANMU UPGRADE private: void update_key_stats(); }; diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 2c9390855c..560c891fef 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -32,7 +32,7 @@ #ifdef HAVE_SYS_MMAN_H #include #endif -#include "mysql_version.h" //STONEDB UPGRADE +#include "mysql_version.h" //TIANMU UPGRADE static uint decode_bits; static char **default_argv; static const char *load_default_groups[]= { "myisamchk", 0 }; @@ -473,8 +473,8 @@ static void usage(void) Find a record, a block at given offset belongs to."); //print_defaults("my", load_default_groups); - //STONEDB UPGRADE BEGIN - #if defined(STONEDB) + //TIANMU UPGRADE BEGIN + #if defined(TIANMU) print_defaults(MYSQL_CONFIG_NAME, load_default_groups); #else print_defaults("my", load_default_groups); @@ -748,8 +748,8 @@ get_one_option(int optid, static void get_options(int *argc,char ***argv) { int ho_error; -//STONEDB UPGRADE BEGIN -#if defined(STONEDB) +//TIANMU UPGRADE BEGIN +#if defined(TIANMU) if (load_defaults(MYSQL_CONFIG_NAME, load_default_groups, argc, argv)) #else if (load_defaults("my", load_default_groups, argc, argv)) diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index defc5f41bc..88a17c872f 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -28,7 +28,7 @@ #include "myisamdef.h" #include "my_default.h" -#include "mysql_version.h"//STONEDB UPGRADE +#include "mysql_version.h"//TIANMU UPGRADE #include #include #include "mysys_err.h" @@ -227,8 +227,8 @@ int main(int argc, char **argv) &main_thread_keycache_var.suspend); - //STONEDB UPGRADE BEGIN -#if defined(STONEDB) + //TIANMU UPGRADE BEGIN +#if defined(TIANMU) if (load_defaults(MYSQL_CONFIG_NAME,load_default_groups,&argc,&argv)) #else if (load_defaults("my",load_default_groups,&argc,&argv)) @@ -338,8 +338,8 @@ static void usage(void) printf("\nUsage: %s [OPTIONS] filename...\n", my_progname); my_print_help(my_long_options); -//STONEDB UPGRADE BEGIN -#if defined(STONEDB) +//TIANMU UPGRADE BEGIN +#if defined(TIANMU) print_defaults(MYSQL_CONFIG_NAME, load_default_groups); #else print_defaults("my", load_default_groups); diff --git a/storage/perfschema/pfs_defaults.cc b/storage/perfschema/pfs_defaults.cc index 29d571f1de..b44b92d16e 100644 --- a/storage/perfschema/pfs_defaults.cc +++ b/storage/perfschema/pfs_defaults.cc @@ -59,8 +59,8 @@ void install_default_setup(PSI_bootstrap *boot) String mysql_db("mysql", 5, &my_charset_utf8_bin); String PS_db("performance_schema", 18, &my_charset_utf8_bin); String IS_db("information_schema", 18, &my_charset_utf8_bin); - //STONEDB UPGRADE,ADD SYS_STONEDB - String stonedb_db("sys_stonedb", 13, &my_charset_utf8_bin); + //TIANMU UPGRADE,ADD SYS_TIANMU + String tianmu_db("sys_tianmu", 13, &my_charset_utf8_bin); //String cache_db("cache", 5, &my_charset_utf8_bin); //END /* Disable sp by default in mysql. */ @@ -68,8 +68,8 @@ void install_default_setup(PSI_bootstrap *boot) /* Disable sp in performance/information schema. */ insert_setup_object(OBJECT_TYPE_EVENT, &PS_db, &percent, false, false); insert_setup_object(OBJECT_TYPE_EVENT, &IS_db, &percent, false, false); - /*STONEDB UPGRADE Disable sp in sys_stonedb/cache*/ - insert_setup_object(OBJECT_TYPE_EVENT, &stonedb_db, &percent, false, false); + /*TIANMU UPGRADE Disable sp in sys_tianmu/cache*/ + insert_setup_object(OBJECT_TYPE_EVENT, &tianmu_db, &percent, false, false); //insert_setup_object(OBJECT_TYPE_EVENT, &cache_db, &percent, false, false); /* Enable every other sp. */ insert_setup_object(OBJECT_TYPE_EVENT, &percent, &percent, true, true); @@ -79,8 +79,8 @@ void install_default_setup(PSI_bootstrap *boot) /* Disable sp in performance/information schema. */ insert_setup_object(OBJECT_TYPE_FUNCTION, &PS_db, &percent, false, false); insert_setup_object(OBJECT_TYPE_FUNCTION, &IS_db, &percent, false, false); - /*STONEDB UPGRADE Disable sp in sys_stonedb/cache*/ - insert_setup_object(OBJECT_TYPE_FUNCTION, &stonedb_db, &percent, false, false); + /*TIANMU UPGRADE Disable sp in sys_tianmu/cache*/ + insert_setup_object(OBJECT_TYPE_FUNCTION, &tianmu_db, &percent, false, false); //insert_setup_object(OBJECT_TYPE_FUNCTION, &cache_db, &percent, false, false); /* Enable every other sp. */ insert_setup_object(OBJECT_TYPE_FUNCTION, &percent, &percent, true, true); @@ -90,8 +90,8 @@ void install_default_setup(PSI_bootstrap *boot) /* Disable sp in performance/information schema. */ insert_setup_object(OBJECT_TYPE_PROCEDURE, &PS_db, &percent, false, false); insert_setup_object(OBJECT_TYPE_PROCEDURE, &IS_db, &percent, false, false); - /*STONEDB UPGRADE Disable sp in sys_stonedb/cache*/ - insert_setup_object(OBJECT_TYPE_PROCEDURE, &stonedb_db, &percent, false, false); + /*TIANMU UPGRADE Disable sp in sys_tianmu/cache*/ + insert_setup_object(OBJECT_TYPE_PROCEDURE, &tianmu_db, &percent, false, false); //insert_setup_object(OBJECT_TYPE_PROCEDURE, &cache_db, &percent, false, false); /* Enable every other sp. */ insert_setup_object(OBJECT_TYPE_PROCEDURE, &percent, &percent, true, true); @@ -101,8 +101,8 @@ void install_default_setup(PSI_bootstrap *boot) /* Disable performance/information schema tables. */ insert_setup_object(OBJECT_TYPE_TABLE, &PS_db, &percent, false, false); insert_setup_object(OBJECT_TYPE_TABLE, &IS_db, &percent, false, false); - /*STONEDB UPGRADE Disable sp in sys_stonedb/cache*/ - insert_setup_object(OBJECT_TYPE_TABLE, &stonedb_db, &percent, false, false); + /*TIANMU UPGRADE Disable sp in sys_tianmu/cache*/ + insert_setup_object(OBJECT_TYPE_TABLE, &tianmu_db, &percent, false, false); //insert_setup_object(OBJECT_TYPE_TABLE, &cache_db, &percent, false, false); /* Enable every other tables */ insert_setup_object(OBJECT_TYPE_TABLE, &percent, &percent, true, true); @@ -112,8 +112,8 @@ void install_default_setup(PSI_bootstrap *boot) /* Disable sp in performance/information schema. */ insert_setup_object(OBJECT_TYPE_TRIGGER, &PS_db, &percent, false, false); insert_setup_object(OBJECT_TYPE_TRIGGER, &IS_db, &percent, false, false); - /*STONEDB UPGRADE Disable sp in sys_stonedb/cache*/ - insert_setup_object(OBJECT_TYPE_TRIGGER, &stonedb_db, &percent, false, false); + /*TIANMU UPGRADE Disable sp in sys_tianmu/cache*/ + insert_setup_object(OBJECT_TYPE_TRIGGER, &tianmu_db, &percent, false, false); //insert_setup_object(OBJECT_TYPE_TRIGGER, &cache_db, &percent, false, false); /* Enable every other sp. */ insert_setup_object(OBJECT_TYPE_TRIGGER, &percent, &percent, true, true); diff --git a/storage/stonedb/system/configuration.cpp b/storage/stonedb/system/configuration.cpp deleted file mode 100644 index 72fed13bd0..0000000000 --- a/storage/stonedb/system/configuration.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* Copyright (c) 2022 StoneAtom, Inc. All rights reserved. - Use is subject to license terms - - 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA -*/ - -#include "system/rc_system.h" - -// Variables to show config through mysql 'show variables' command -char stonedb_sysvar_pushdown; -char stonedb_sysvar_refresh_sys_table; -char stonedb_sysvar_usemysqlimportexportdefaults; -char *stonedb_sysvar_cachefolder; -char *stonedb_sysvar_hugefiledir; -char *stonedb_sysvar_mm_policy; -char *stonedb_sysvar_mm_releasepolicy; -int stonedb_sysvar_allowmysqlquerypath; -int stonedb_sysvar_bg_load_threads; -int stonedb_sysvar_cachereleasethreshold; -int stonedb_sysvar_cachesizethreshold; -int stonedb_sysvar_cachinglevel; -int stonedb_sysvar_controlquerylog; -int stonedb_sysvar_controltrace; -int stonedb_sysvar_disk_usage_threshold; -int stonedb_sysvar_distcache_size; -int stonedb_sysvar_global_debug_level; -int stonedb_sysvar_insert_buffer_size; -int stonedb_sysvar_insert_cntthreshold; -int stonedb_sysvar_insert_max_buffered; -int stonedb_sysvar_insert_numthreshold; -int stonedb_sysvar_insert_wait_ms; -int stonedb_sysvar_insert_wait_time; -int stonedb_sysvar_knlevel; -int stonedb_sysvar_load_threads; -int stonedb_sysvar_max_execution_time; -int stonedb_sysvar_mm_hardlimit; -int stonedb_sysvar_mm_large_threshold; -int stonedb_sysvar_mm_largetempratio; -int stonedb_sysvar_query_threads; -int stonedb_sysvar_servermainheapsize; -int stonedb_sysvar_sync_buffers; -int stonedb_sysvar_threadpoolsize; -int stonedb_sysvar_join_parallel; -int stonedb_sysvar_join_splitrows; -my_bool stonedb_sysvar_compensation_start; -my_bool stonedb_sysvar_filterevaluation_speedup; -my_bool stonedb_sysvar_groupby_speedup; -unsigned int stonedb_sysvar_index_cache_size; -my_bool stonedb_sysvar_index_search; -my_bool stonedb_sysvar_enable_rowstore; -my_bool stonedb_sysvar_insert_delayed; -my_bool stonedb_sysvar_minmax_speedup; -my_bool stonedb_sysvar_orderby_speedup; -my_bool stonedb_sysvar_parallel_filloutput; -my_bool stonedb_sysvar_parallel_mapjoin; -my_bool stonedb_sysvar_qps_log; -unsigned int stonedb_sysvar_lookup_max_size; -unsigned long stonedb_sysvar_dist_policy; -char stonedb_sysvar_force_hashjoin; -int stonedb_sysvar_start_async; -char *stonedb_sysvar_async_join; -char stonedb_sysvar_join_disable_switch_side; -char stonedb_sysvar_enable_histogram_cmap_bloom; -unsigned int stonedb_sysvar_result_sender_rows; - -async_join_setting stonedb_sysvar_async_join_setting; - -void ConfigureRCControl() { - using namespace stonedb; - int control_level = stonedb_sysvar_controltrace; - (control_level > 0) ? rccontrol.setOn() : rccontrol.setOff(); -} diff --git a/storage/stonedb/system/configuration.h b/storage/stonedb/system/configuration.h deleted file mode 100644 index 399eb4b889..0000000000 --- a/storage/stonedb/system/configuration.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Copyright (c) 2022 StoneAtom, Inc. All rights reserved. - Use is subject to license terms - - 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA -*/ -#ifndef STONEDB_SYSTEM_CONFIGURATION_H_ -#define STONEDB_SYSTEM_CONFIGURATION_H_ -#pragma once - -extern char stonedb_sysvar_compensation_start; -extern char stonedb_sysvar_filterevaluation_speedup; -extern char stonedb_sysvar_groupby_speedup; -extern unsigned int stonedb_sysvar_index_cache_size; -extern char stonedb_sysvar_index_search; -extern char stonedb_sysvar_enable_rowstore; -extern char stonedb_sysvar_insert_delayed; -extern char stonedb_sysvar_minmax_speedup; -extern char stonedb_sysvar_orderby_speedup; -extern char stonedb_sysvar_parallel_filloutput; -extern char stonedb_sysvar_parallel_mapjoin; -extern char stonedb_sysvar_pushdown; -extern char stonedb_sysvar_qps_log; -extern char stonedb_sysvar_refresh_sys_table; -extern char stonedb_sysvar_usemysqlimportexportdefaults; -extern char *stonedb_sysvar_cachefolder; -extern char *stonedb_sysvar_hugefiledir; -extern char *stonedb_sysvar_mm_policy; -extern char *stonedb_sysvar_mm_releasepolicy; -extern int stonedb_sysvar_allowmysqlquerypath; -extern int stonedb_sysvar_bg_load_threads; -extern int stonedb_sysvar_cachereleasethreshold; -extern int stonedb_sysvar_cachesizethreshold; -extern int stonedb_sysvar_cachinglevel; -extern int stonedb_sysvar_controlquerylog; -extern int stonedb_sysvar_controltrace; -extern int stonedb_sysvar_disk_usage_threshold; -extern int stonedb_sysvar_distcache_size; -extern int stonedb_sysvar_global_debug_level; -extern int stonedb_sysvar_insert_buffer_size; -extern int stonedb_sysvar_insert_cntthreshold; -extern int stonedb_sysvar_insert_max_buffered; -extern int stonedb_sysvar_insert_numthreshold; -extern int stonedb_sysvar_insert_wait_ms; -extern int stonedb_sysvar_insert_wait_time; -extern int stonedb_sysvar_join_parallel; -extern int stonedb_sysvar_join_splitrows; -extern int stonedb_sysvar_knlevel; -extern int stonedb_sysvar_load_threads; -extern unsigned int stonedb_sysvar_lookup_max_size; -extern int stonedb_sysvar_max_execution_time; -extern int stonedb_sysvar_mm_hardlimit; -extern int stonedb_sysvar_mm_large_threshold; -extern int stonedb_sysvar_mm_largetempratio; -extern int stonedb_sysvar_query_threads; -extern int stonedb_sysvar_servermainheapsize; -extern int stonedb_sysvar_sync_buffers; -extern int stonedb_sysvar_threadpoolsize; -extern unsigned long stonedb_sysvar_dist_policy; -extern char stonedb_sysvar_force_hashjoin; -extern int stonedb_sysvar_start_async; -// Format: a;b;c;d -// a : iterator pack count one step,default 1, 0 is disable -// b : iterator rows count one step,default 0, 0 is disable,if a and b all is -// setted, use a priority c : traverse slices count, default 0 is the async -// thread count d : match slices count, default 0 is the async thread count -extern char *stonedb_sysvar_async_join; -// If there is too much conflict in the hash join building hash table, program -// will automatically switching another table to make a hash table, -// stonedb_sysvar_join_disable_switch_side is the option to avoid this switching -// process. -extern char stonedb_sysvar_join_disable_switch_side; -// enable histogram/cmap/bloom filtering -extern char stonedb_sysvar_enable_histogram_cmap_bloom; -// The number of rows to load at a time when processing queries like select xxx -// from yyy -extern unsigned int stonedb_sysvar_result_sender_rows; - -void ConfigureRCControl(); - -struct async_join_setting { - int pack_per_step = 1; - int rows_per_step = 0; - int traverse_slices = 0; - int match_slices = 0; - - bool is_enabled() const { return (pack_per_step > 0) || (rows_per_step > 0); } -}; - -extern async_join_setting stonedb_sysvar_async_join_setting; - -#endif // STONEDB_SYSTEM_CONFIGURATION_H_ diff --git a/storage/stonedb/.clang-format b/storage/tianmu/.clang-format similarity index 100% rename from storage/stonedb/.clang-format rename to storage/tianmu/.clang-format diff --git a/storage/stonedb/CMakeLists.txt b/storage/tianmu/CMakeLists.txt similarity index 69% rename from storage/stonedb/CMakeLists.txt rename to storage/tianmu/CMakeLists.txt index f3ee739f8b..8d7db33c5e 100644 --- a/storage/stonedb/CMakeLists.txt +++ b/storage/tianmu/CMakeLists.txt @@ -17,11 +17,11 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.7) -SET(STONEDB_PLUGIN_STATIC "stonedb") -SET(STONEDB_PLUGIN_MANDATORY TRUE) +SET(TIANMU_PLUGIN_STATIC "tianmu") +SET(TIANMU_PLUGIN_MANDATORY TRUE) MESSAGE(STATUS "Using cmake version ${CMAKE_VERSION}") -MESSAGE(STATUS "Building StoneDB") +MESSAGE(STATUS "Building Tianmu") #lihao Here, the dependency libs will be moved to 'third_party' directory. SET(BOOST_ROOT ${WITH_BOOST}) @@ -56,7 +56,7 @@ AUX_SOURCE_DIRECTORY(base/fmt SOURCE_base_fmt) AUX_SOURCE_DIRECTORY(base/net SOURCE_base_net) AUX_SOURCE_DIRECTORY(base/util SOURCE_base_util) -SET(STONEDB_SOURCES ${SOURCE_common} +SET(TIANMU_SOURCES ${SOURCE_common} ${SOURCE_compress} ${SOURCE_core} ${SOURCE_exporter} @@ -74,25 +74,25 @@ SET(STONEDB_SOURCES ${SOURCE_common} ${SOURCE_base_net} ${SOURCE_base_util}) -MYSQL_ADD_PLUGIN(stonedb ${STONEDB_SOURCES} +MYSQL_ADD_PLUGIN(tianmu ${TIANMU_SOURCES} STORAGE_ENGINE MANDATORY STATIC_ONLY LINK_LIBRARIES ${LINK_LIBS}) -TARGET_INCLUDE_DIRECTORIES(stonedb SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/include) -TARGET_INCLUDE_DIRECTORIES(stonedb SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/sql) -TARGET_INCLUDE_DIRECTORIES(stonedb SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/regex) -TARGET_INCLUDE_DIRECTORIES(stonedb SYSTEM PRIVATE ${SSL_INCLUDE_DIRS}) -TARGET_INCLUDE_DIRECTORIES(stonedb SYSTEM PRIVATE ${ZLIB_INCLUDE_DIR}) -TARGET_INCLUDE_DIRECTORIES(stonedb SYSTEM PRIVATE ${ROCKSDB_ROOT}/include) -TARGET_INCLUDE_DIRECTORIES(stonedb SYSTEM PRIVATE ${BOOST_ROOT}/include) -TARGET_INCLUDE_DIRECTORIES(stonedb SYSTEM PRIVATE ${MARISA_ROOT}/include) -TARGET_INCLUDE_DIRECTORIES(stonedb PRIVATE ${CMAKE_SOURCE_DIR}/storage/stonedb) -TARGET_INCLUDE_DIRECTORIES(stonedb PRIVATE ${CMAKE_SOURCE_DIR}/storage/stonedb/base) +TARGET_INCLUDE_DIRECTORIES(tianmu SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/include) +TARGET_INCLUDE_DIRECTORIES(tianmu SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/sql) +TARGET_INCLUDE_DIRECTORIES(tianmu SYSTEM PRIVATE ${CMAKE_SOURCE_DIR}/regex) +TARGET_INCLUDE_DIRECTORIES(tianmu SYSTEM PRIVATE ${SSL_INCLUDE_DIRS}) +TARGET_INCLUDE_DIRECTORIES(tianmu SYSTEM PRIVATE ${ZLIB_INCLUDE_DIR}) +TARGET_INCLUDE_DIRECTORIES(tianmu SYSTEM PRIVATE ${ROCKSDB_ROOT}/include) +TARGET_INCLUDE_DIRECTORIES(tianmu SYSTEM PRIVATE ${BOOST_ROOT}/include) +TARGET_INCLUDE_DIRECTORIES(tianmu SYSTEM PRIVATE ${MARISA_ROOT}/include) +TARGET_INCLUDE_DIRECTORIES(tianmu PRIVATE ${CMAKE_SOURCE_DIR}/storage/tianmu) +TARGET_INCLUDE_DIRECTORIES(tianmu PRIVATE ${CMAKE_SOURCE_DIR}/storage/tianmu/base) #Wno-error for release build -TARGET_COMPILE_OPTIONS(stonedb PRIVATE -Wno-error -Wextra -Wall) -TARGET_COMPILE_OPTIONS(stonedb PRIVATE -Wunused-parameter) -TARGET_COMPILE_OPTIONS(stonedb PRIVATE -Wsuggest-override) +TARGET_COMPILE_OPTIONS(tianmu PRIVATE -Wno-error -Wextra -Wall) +TARGET_COMPILE_OPTIONS(tianmu PRIVATE -Wunused-parameter) +TARGET_COMPILE_OPTIONS(tianmu PRIVATE -Wsuggest-override) add_subdirectory(async_tests) diff --git a/storage/stonedb/async_tests/CMakeLists.txt b/storage/tianmu/async_tests/CMakeLists.txt similarity index 59% rename from storage/stonedb/async_tests/CMakeLists.txt rename to storage/tianmu/async_tests/CMakeLists.txt index 1a751c0355..6f3142b190 100644 --- a/storage/stonedb/async_tests/CMakeLists.txt +++ b/storage/tianmu/async_tests/CMakeLists.txt @@ -1,23 +1,23 @@ SET(BOOST_ROOT /usr/local/stonedb-boost) AUX_SOURCE_DIRECTORY(. DIR_SRCS) -ADD_DEFINITIONS(-DDISABLE_USED_FOR_STONEDB) +ADD_DEFINITIONS(-DDISABLE_USED_FOR_TIANMU) -SET(ASYNC_ROOT "${CMAKE_SOURCE_DIR}/storage/stonedb/") +SET(ASYNC_ROOT "${CMAKE_SOURCE_DIR}/storage/tianmu/") INCLUDE_DIRECTORIES(${BOOST_ROOT}/include) INCLUDE_DIRECTORIES(SYSTEM ${BOOST_ROOT}/include) -INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/stonedb/base) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/tianmu/base) INCLUDE_DIRECTORIES(${ASYNC_ROOT}) INCLUDE_DIRECTORIES(${ASYNC_ROOT}/base) INCLUDE_DIRECTORIES(${BOOST_ROOT}/include) AUX_SOURCE_DIRECTORY(. DIR_SRCS) -AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/storage/stonedb/base/core SOURCE_async_core) -AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/storage/stonedb/base/fmt SOURCE_async_fmt) -AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/storage/stonedb/base/net SOURCE_async_net) -AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/storage/stonedb/base/util SOURCE_async_util) +AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/storage/tianmu/base/core SOURCE_async_core) +AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/storage/tianmu/base/fmt SOURCE_async_fmt) +AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/storage/tianmu/base/net SOURCE_async_net) +AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR}/storage/tianmu/base/util SOURCE_async_util) SET(ASYNC_SOURCES ${SOURCE_async_core} ${SOURCE_async_fmt} diff --git a/storage/stonedb/async_tests/main.cc b/storage/tianmu/async_tests/main.cc similarity index 70% rename from storage/stonedb/async_tests/main.cc rename to storage/tianmu/async_tests/main.cc index 801b9b5853..753d1c020a 100644 --- a/storage/stonedb/async_tests/main.cc +++ b/storage/tianmu/async_tests/main.cc @@ -12,11 +12,11 @@ copyright info #include "async_tests/task_executor.h" using namespace std::chrono_literals; -using namespace stonedb; +using namespace Tianmu; namespace stdexp = std::experimental; class TaskRunner { - class MyTask : public stonedb::base::task { + class MyTask : public Tianmu::base::task { public: MyTask(int count, uint64_t *result) { _count = count; @@ -26,7 +26,7 @@ class TaskRunner { ~MyTask() noexcept override {} void run() noexcept override { - stonedb::base::print("Established task on cpu %3d\n", stonedb::base::engine().cpu_id()); + Tianmu::base::print("Established task on cpu %3d\n", Tianmu::base::engine().cpu_id()); for (int index = 0; index < _count; ++index) { for (int jndex = 0; jndex < index; ++jndex) { *_result += jndex; @@ -45,9 +45,9 @@ class TaskRunner { _result = 0; } - stonedb::base::future<> Run() { - return stonedb::base::sleep(std::chrono::milliseconds(1)).then([this]() { - stonedb::base::print("Established task on cpu %3d\n", stonedb::base::engine().cpu_id()); + Tianmu::base::future<> Run() { + return Tianmu::base::sleep(std::chrono::milliseconds(1)).then([this]() { + Tianmu::base::print("Established task on cpu %3d\n", Tianmu::base::engine().cpu_id()); uint64_t count = 0; for (int index = 0; index < _count; ++index) { for (int jndex = 0; jndex < index; ++jndex) { @@ -55,17 +55,17 @@ class TaskRunner { count++; } } - stonedb::base::print("%ld\n", count); - return stonedb::base::make_ready_future(); + Tianmu::base::print("%ld\n", count); + return Tianmu::base::make_ready_future(); }); } - stonedb::base::future get_result() { - stonedb::base::print("Requests on cpu %2d: %ld\n", stonedb::base::engine().cpu_id(), _result); - return stonedb::base::make_ready_future(_result); + Tianmu::base::future get_result() { + Tianmu::base::print("Requests on cpu %2d: %ld\n", Tianmu::base::engine().cpu_id(), _result); + return Tianmu::base::make_ready_future(_result); } - stonedb::base::future<> stop() { return stonedb::base::make_ready_future(); } + Tianmu::base::future<> stop() { return Tianmu::base::make_ready_future(); } private: int _count; @@ -79,69 +79,69 @@ uint64_t test_pool(int count, bool print_result = true) { result += jndex; } } - if (print_result) stonedb::base::print("Total requests: %u\n", result); + if (print_result) Tianmu::base::print("Total requests: %u\n", result); return result; } -stonedb::base::future RecurseFuture(int *count) { +Tianmu::base::future RecurseFuture(int *count) { if (*count == 0) { - return stonedb::base::make_ready_future(true); + return Tianmu::base::make_ready_future(true); } - stonedb::base::print("Count:%d\n", (*count)--); - return stonedb::base::sleep(1ms).then([] { return false; }); + Tianmu::base::print("Count:%d\n", (*count)--); + return Tianmu::base::sleep(1ms).then([] { return false; }); // return sleep(1ms).then([count]{ return RecurseFuture(count); }); } -stonedb::base::future> Recurse(std::shared_ptr counter, unsigned thd) { +Tianmu::base::future> Recurse(std::shared_ptr counter, unsigned thd) { if (*counter == 0) { - return stonedb::base::make_ready_future>(true); + return Tianmu::base::make_ready_future>(true); } int count = (*counter)--; - return stonedb::base::smp::submit_to(thd, + return Tianmu::base::smp::submit_to(thd, [count, thd] { // std::this_thread::sleep_for(1000ms); - stonedb::base::print("Calling on : %d thread counter: %d\n", thd, count); + Tianmu::base::print("Calling on : %d thread counter: %d\n", thd, count); test_pool(50000, false); }) .then([thd]() { - stonedb::base::print("Called completed on : %d thread \n", thd); + Tianmu::base::print("Called completed on : %d thread \n", thd); return stdexp::optional(stdexp::nullopt); }); } void TestPostTask(std::shared_ptr task_executor) { std::chrono::duration total_elapsed = - stonedb::base::steady_clock_type::now() - stonedb::base::steady_clock_type::now(); + Tianmu::base::steady_clock_type::now() - Tianmu::base::steady_clock_type::now(); std::chrono::duration max_elapsed = total_elapsed; for (int index = 0; index < 100000; ++index) { - auto started = stonedb::base::steady_clock_type::now(); + auto started = Tianmu::base::steady_clock_type::now(); task_executor ->Execute([started, &total_elapsed, &max_elapsed]() { - auto elapsed = stonedb::base::steady_clock_type::now() - started; + auto elapsed = Tianmu::base::steady_clock_type::now() - started; if (elapsed > max_elapsed) max_elapsed = elapsed; total_elapsed += elapsed; - return stonedb::base::make_ready_future<>(); + return Tianmu::base::make_ready_future<>(); }) .wait(); } auto ave_secs = static_cast(total_elapsed.count() / 100000.0); auto max_secs = static_cast(max_elapsed.count()); - stonedb::base::print("Ave post task time: %fs max post time:%fs\n", ave_secs, max_secs); + Tianmu::base::print("Ave post task time: %fs max post time:%fs\n", ave_secs, max_secs); } void TestSubmit(std::shared_ptr task_executor) { auto ready_future = task_executor->Execute([]() { std::shared_ptr counter(new int(10)); - stonedb::base::future<> parallel_future = - stonedb::base::parallel_for_each(boost::irange(0, stonedb::base::smp::count), [counter](unsigned c) { - return stonedb::base::repeat_until_value(std::bind(&Recurse, counter, c)).then([](bool) { - stonedb::base::print("Repeat completed\n"); + Tianmu::base::future<> parallel_future = + Tianmu::base::parallel_for_each(boost::irange(0, Tianmu::base::smp::count), [counter](unsigned c) { + return Tianmu::base::repeat_until_value(std::bind(&Recurse, counter, c)).then([](bool) { + Tianmu::base::print("Repeat completed\n"); }); }); - return parallel_future.then([]() { stonedb::base::print("Parallel completed\n"); }); + return parallel_future.then([]() { Tianmu::base::print("Parallel completed\n"); }); }); ready_future.wait(); @@ -149,14 +149,14 @@ void TestSubmit(std::shared_ptr task_executor) { void TestSubmitRandom(std::shared_ptr task_executor) { auto ready_future = task_executor->Execute([]() { - for (auto t : boost::irange(1u, stonedb::base::smp::count - 1)) { - stonedb::base::smp::submit_to(t, [] { test_pool(100000); }); + for (auto t : boost::irange(1u, Tianmu::base::smp::count - 1)) { + Tianmu::base::smp::submit_to(t, [] { test_pool(100000); }); } // std::this_thread::sleep_for(10s); - // stonedb::base::print("10s completed\n"); - return stonedb::base::sleep(3s).then([]() { - stonedb::base::print("3s completed\n"); - stonedb::base::smp::submit([] { test_pool(100); }); + // Tianmu::base::print("10s completed\n"); + return Tianmu::base::sleep(3s).then([]() { + Tianmu::base::print("3s completed\n"); + Tianmu::base::smp::submit([] { test_pool(100); }); }); }); @@ -164,13 +164,13 @@ void TestSubmitRandom(std::shared_ptr task_executor) { } int main(int argc, char **argv) { - auto started = stonedb::base::steady_clock_type::now(); + auto started = Tianmu::base::steady_clock_type::now(); std::shared_ptr task_executor(new core::TaskExecutor); std::future ready_future = task_executor->Init(std::thread::hardware_concurrency()); ready_future.wait(); - auto elapsed = stonedb::base::steady_clock_type::now() - started; + auto elapsed = Tianmu::base::steady_clock_type::now() - started; auto secs = static_cast(elapsed.count() / 1000000000.0); - stonedb::base::print("Init time: %f\n", secs); + Tianmu::base::print("Init time: %f\n", secs); std::this_thread::sleep_for(2s); TestPostTask(task_executor); TestSubmit(task_executor); @@ -184,7 +184,7 @@ int main(int argc, char **argv) { #if 0 int main(int argc, char** argv) { auto thd = std::thread([]() { - stonedb::base::app_template app(stonedb::base::create_default_options(3)); + Tianmu::base::app_template app(Tianmu::base::create_default_options(3)); app.run_deprecated([] { ::pthread_setname_np(::pthread_self(), "reactor-main"); return smp::submit_to(1, []{ return test_pool(1000000); }) @@ -268,24 +268,24 @@ int main(int argc, char** argv) { // }); // }); - // stonedb::base::async([] { - // auto t1 = new stonedb::base::thread([] { + // Tianmu::base::async([] { + // auto t1 = new Tianmu::base::thread([] { // int repeat = 0; // while (repeat < 5) { // for (int index = 0; index < 5; ++index) { // print("Excute from t1 %d:%d\n", repeat, index); // } // repeat++; - // stonedb::base::thread::yield(); + // Tianmu::base::thread::yield(); // } // }); - // auto t2 = new stonedb::base::thread([] { + // auto t2 = new Tianmu::base::thread([] { // int repeat = 0; // while (repeat < 5) { // print("Excute from t2 %d\n", repeat); // repeat++; - // stonedb::base::thread::yield(); + // Tianmu::base::thread::yield(); // } // }); diff --git a/storage/stonedb/async_tests/task_executor.cpp b/storage/tianmu/async_tests/task_executor.cpp similarity index 96% rename from storage/stonedb/async_tests/task_executor.cpp rename to storage/tianmu/async_tests/task_executor.cpp index 3939d499a3..f60f9b4540 100644 --- a/storage/stonedb/async_tests/task_executor.cpp +++ b/storage/tianmu/async_tests/task_executor.cpp @@ -21,12 +21,12 @@ #include "base/core/future.h" #include "core/task_executor.h" -#ifndef DISABLE_USED_FOR_STONEDB +#ifndef DISABLE_USED_FOR_TIANMU #include "core/engine.h" #include "system/rc_system.h" #endif -namespace stonedb { +namespace Tianmu { namespace core { class AppTemplate { static constexpr size_t queue_length = 128; @@ -96,9 +96,9 @@ void TaskExecutor::Exit() { void TaskExecutor::AddTask(std::unique_ptr task) { _app_template->AddTask(std::move(task)); } -#ifndef DISABLE_USED_FOR_STONEDB +#ifndef DISABLE_USED_FOR_TIANMU TaskExecutor *GetTaskExecutor() { return rceng->GetTaskExecutor(); } #endif } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/task_executor.h b/storage/tianmu/async_tests/task_executor.h similarity index 91% rename from storage/stonedb/core/task_executor.h rename to storage/tianmu/async_tests/task_executor.h index 9ae067da20..c30ede7ad2 100644 --- a/storage/stonedb/core/task_executor.h +++ b/storage/tianmu/async_tests/task_executor.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_TASK_EXECUTOR_H_ -#define STONEDB_CORE_TASK_EXECUTOR_H_ +#ifndef TIANMU_CORE_TASK_EXECUTOR_H_ +#define TIANMU_CORE_TASK_EXECUTOR_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "base/core/reactor.h" -namespace stonedb { +namespace Tianmu { namespace core { class AppTemplate; @@ -78,7 +78,7 @@ class TaskExecutor { std::unique_ptr _app_template; }; -#ifndef DISABLE_USED_FOR_STONEDB +#ifndef DISABLE_USED_FOR_TIANMU TaskExecutor *GetTaskExecutor(); template @@ -88,6 +88,6 @@ inline std::future ScheduleAsyncTask(Func &&func) { #endif } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_TASK_EXECUTOR_H_ +#endif // TIANMU_CORE_TASK_EXECUTOR_H_ diff --git a/storage/stonedb/base/core/align.h b/storage/tianmu/base/core/align.h similarity index 92% rename from storage/stonedb/base/core/align.h rename to storage/tianmu/base/core/align.h index 5e6455b97e..7634f0a6b8 100644 --- a/storage/stonedb/base/core/align.h +++ b/storage/tianmu/base/core/align.h @@ -19,14 +19,14 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_ALIGN_H_ -#define STONEDB_BASE_ALIGN_H_ +#ifndef TIANMU_BASE_ALIGN_H_ +#define TIANMU_BASE_ALIGN_H_ #pragma once #include #include -namespace stonedb { +namespace Tianmu { namespace base { template @@ -52,6 +52,6 @@ inline constexpr T *align_down(T *v, size_t align) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_ALIGN_H_ +#endif // TIANMU_BASE_ALIGN_H_ diff --git a/storage/stonedb/base/core/aligned_buffer.h b/storage/tianmu/base/core/aligned_buffer.h similarity index 90% rename from storage/stonedb/base/core/aligned_buffer.h rename to storage/tianmu/base/core/aligned_buffer.h index 5c6c802fe6..836e2a5661 100644 --- a/storage/stonedb/base/core/aligned_buffer.h +++ b/storage/tianmu/base/core/aligned_buffer.h @@ -19,8 +19,8 @@ * Copyright (C) 2016 ScyllaDB. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_ALIGNED_BUFFER_H_ -#define STONEDB_BASE_ALIGNED_BUFFER_H_ +#ifndef TIANMU_BASE_ALIGNED_BUFFER_H_ +#define TIANMU_BASE_ALIGNED_BUFFER_H_ #pragma once #include @@ -29,7 +29,7 @@ #include "base/core/print.h" -namespace stonedb { +namespace Tianmu { namespace base { struct free_deleter { @@ -54,6 +54,6 @@ inline std::unique_ptr allocate_aligned_buffer(size_t } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_ALIGNED_BUFFER_H__ +#endif // TIANMU_BASE_ALIGNED_BUFFER_H__ diff --git a/storage/stonedb/base/core/app_template.cpp b/storage/tianmu/base/core/app_template.cpp similarity index 98% rename from storage/stonedb/base/core/app_template.cpp rename to storage/tianmu/base/core/app_template.cpp index 503e5c063d..2b094503f3 100644 --- a/storage/stonedb/base/core/app_template.cpp +++ b/storage/tianmu/base/core/app_template.cpp @@ -33,7 +33,7 @@ #include "base/util/log.h" #include "base/util/log_cli.h" -namespace stonedb { +namespace Tianmu { namespace base { using namespace std::chrono_literals; @@ -100,4 +100,4 @@ int app_template::run_deprecated(std::function &&func) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/core/app_template.h b/storage/tianmu/base/core/app_template.h similarity index 91% rename from storage/stonedb/base/core/app_template.h rename to storage/tianmu/base/core/app_template.h index 7fbae51f1b..5fd5acda69 100644 --- a/storage/stonedb/base/core/app_template.h +++ b/storage/tianmu/base/core/app_template.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_APP_TEMPLATE_H_ -#define STONEDB_BASE_APP_TEMPLATE_H_ +#ifndef TIANMU_BASE_APP_TEMPLATE_H_ +#define TIANMU_BASE_APP_TEMPLATE_H_ #pragma once #include @@ -31,7 +31,7 @@ #include #include -namespace stonedb { +namespace Tianmu { namespace base { options create_default_options(unsigned threads, @@ -58,6 +58,6 @@ class app_template { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_ALIGNED_BUFFER_H__ +#endif // TIANMU_BASE_ALIGNED_BUFFER_H__ diff --git a/storage/stonedb/base/core/apply.h b/storage/tianmu/base/core/apply.h similarity index 93% rename from storage/stonedb/base/core/apply.h rename to storage/tianmu/base/core/apply.h index 4329402e71..4a54689d59 100644 --- a/storage/stonedb/base/core/apply.h +++ b/storage/tianmu/base/core/apply.h @@ -19,14 +19,14 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_APPLY_H_ -#define STONEDB_BASE_APPLY_H_ +#ifndef TIANMU_BASE_APPLY_H_ +#define TIANMU_BASE_APPLY_H_ #pragma once #include #include -namespace stonedb { +namespace Tianmu { namespace base { template @@ -56,6 +56,6 @@ inline auto apply(Func &&func, const std::tuple &args) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_APPLY_H_ +#endif // TIANMU_BASE_APPLY_H_ diff --git a/storage/stonedb/base/core/array_map.h b/storage/tianmu/base/core/array_map.h similarity index 90% rename from storage/stonedb/base/core/array_map.h rename to storage/tianmu/base/core/array_map.h index cc3a14cb80..e48811c1f6 100644 --- a/storage/stonedb/base/core/array_map.h +++ b/storage/tianmu/base/core/array_map.h @@ -19,13 +19,13 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_ARRAY_MAP_H_ -#define STONEDB_BASE_ARRAY_MAP_H_ +#ifndef TIANMU_BASE_ARRAY_MAP_H_ +#define TIANMU_BASE_ARRAY_MAP_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace base { // unordered_map implemented as a simple array @@ -53,6 +53,6 @@ class array_map { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_ARRAY_MAP_H_ +#endif // TIANMU_BASE_ARRAY_MAP_H_ diff --git a/storage/stonedb/base/core/bitops.h b/storage/tianmu/base/core/bitops.h similarity index 92% rename from storage/stonedb/base/core/bitops.h rename to storage/tianmu/base/core/bitops.h index 5efa9da616..b7c1c73543 100644 --- a/storage/stonedb/base/core/bitops.h +++ b/storage/tianmu/base/core/bitops.h @@ -19,13 +19,13 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_BITOPS_H_ -#define STONEDB_BASE_BITOPS_H_ +#ifndef TIANMU_BASE_BITOPS_H_ +#define TIANMU_BASE_BITOPS_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace base { inline constexpr unsigned count_leading_zeros(unsigned x) { return __builtin_clz(x); } @@ -53,6 +53,6 @@ inline constexpr unsigned log2floor(T n) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_BITOPS_H +#endif // TIANMU_BASE_BITOPS_H diff --git a/storage/stonedb/base/core/bitset_iter.h b/storage/tianmu/base/core/bitset_iter.h similarity index 96% rename from storage/stonedb/base/core/bitset_iter.h rename to storage/tianmu/base/core/bitset_iter.h index 162de76e3e..d420314b31 100644 --- a/storage/stonedb/base/core/bitset_iter.h +++ b/storage/tianmu/base/core/bitset_iter.h @@ -11,14 +11,14 @@ * This work is open source software, licensed under the terms of the * BSD license as described in the LICENSE file in the top-level directory. */ -#ifndef STONEDB_BASE_BITSET_ITER_H_ -#define STONEDB_BASE_BITSET_ITER_H_ +#ifndef TIANMU_BASE_BITSET_ITER_H_ +#define TIANMU_BASE_BITSET_ITER_H_ #pragma once #include #include -namespace stonedb { +namespace Tianmu { namespace base { namespace bitsets { @@ -148,6 +148,6 @@ static inline set_range for_each_set(std::bitset bitset, int offset = 0) { } // namespace bitsets } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_BITSET_ITER_H_ +#endif // TIANMU_BASE_BITSET_ITER_H_ diff --git a/storage/stonedb/base/core/byteorder.h b/storage/tianmu/base/core/byteorder.h similarity index 95% rename from storage/stonedb/base/core/byteorder.h rename to storage/tianmu/base/core/byteorder.h index fc4db1cd4a..efec70ec4a 100644 --- a/storage/stonedb/base/core/byteorder.h +++ b/storage/tianmu/base/core/byteorder.h @@ -19,8 +19,8 @@ * Copyright (C) 2015 Scylladb, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_CORE_BYTEORDER_H_ -#define STONEDB_BASE_CORE_BYTEORDER_H_ +#ifndef TIANMU_BASE_CORE_BYTEORDER_H_ +#define TIANMU_BASE_CORE_BYTEORDER_H_ #pragma once #include @@ -28,7 +28,7 @@ #include #include "base/core/unaligned.h" -namespace stonedb { +namespace Tianmu { namespace base { inline uint8_t cpu_to_le(uint8_t x) { return x; } @@ -117,6 +117,6 @@ inline void produce_be(char *&p, T datum) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_CORE_BYTEORDER_H_ +#endif // TIANMU_BASE_CORE_BYTEORDER_H_ diff --git a/storage/stonedb/base/core/cacheline.h b/storage/tianmu/base/core/cacheline.h similarity index 89% rename from storage/stonedb/base/core/cacheline.h rename to storage/tianmu/base/core/cacheline.h index 0c627bdc1b..c42d67a916 100644 --- a/storage/stonedb/base/core/cacheline.h +++ b/storage/tianmu/base/core/cacheline.h @@ -19,13 +19,13 @@ * Copyright (C) 2017 IBM. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_CACHELINE_H_ -#define STONEDB_BASE_CACHELINE_H_ +#ifndef TIANMU_BASE_CACHELINE_H_ +#define TIANMU_BASE_CACHELINE_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace base { // Platform-dependent cache line size for alignment and padding purposes. @@ -41,6 +41,6 @@ static constexpr size_t cache_line_size = #endif } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_CACHELINE_H_ +#endif // TIANMU_BASE_CACHELINE_H_ diff --git a/storage/stonedb/base/core/checked_ptr.h b/storage/tianmu/base/core/checked_ptr.h similarity index 97% rename from storage/stonedb/base/core/checked_ptr.h rename to storage/tianmu/base/core/checked_ptr.h index e51fb04d05..7ca69fbefd 100644 --- a/storage/stonedb/base/core/checked_ptr.h +++ b/storage/tianmu/base/core/checked_ptr.h @@ -19,15 +19,15 @@ * Copyright (C) 2017 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_CHECKED_PTR_H_ -#define STONEDB_BASE_CHECKED_PTR_H_ +#ifndef TIANMU_BASE_CHECKED_PTR_H_ +#define TIANMU_BASE_CHECKED_PTR_H_ #pragma once #include #include "util/gcc6-concepts.h" -namespace stonedb { +namespace Tianmu { namespace base { /// The exception thrown by a default_null_deref_action. @@ -44,7 +44,7 @@ struct default_null_deref_action { }; /// \cond internal -/// \namespace stonedb::base::internal +/// \namespace Tianmu::base::internal namespace internal { /// \name base::checked_ptr::get() helpers /// Helper functions that simplify the base::checked_ptr::get() implementation. @@ -183,7 +183,7 @@ GCC6_CONCEPT(requires std::is_default_constructible::value &&re }; } // namespace base -} // namespace stonedb +} // namespace Tianmu namespace std { /// std::hash specialization for base::checked_ptr class @@ -198,4 +198,4 @@ struct hash> { } // namespace std -#endif STONEDB_BASE_CHECKED_PTR_H_ +#endif TIANMU_BASE_CHECKED_PTR_H_ diff --git a/storage/stonedb/base/core/chunked_fifo.h b/storage/tianmu/base/core/chunked_fifo.h similarity index 99% rename from storage/stonedb/base/core/chunked_fifo.h rename to storage/tianmu/base/core/chunked_fifo.h index f90d1a36cf..65529849c1 100644 --- a/storage/stonedb/base/core/chunked_fifo.h +++ b/storage/tianmu/base/core/chunked_fifo.h @@ -19,14 +19,14 @@ * Copyright (C) 2016 ScyllaDB Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_CHUNKED_FIFO_H_ -#define STONEDB_BASE_CHUNKED_FIFO_H_ +#ifndef TIANMU_BASE_CHUNKED_FIFO_H_ +#define TIANMU_BASE_CHUNKED_FIFO_H_ #pragma once #include #include -namespace stonedb { +namespace Tianmu { namespace base { // An unbounded FIFO queue of objects of type T. @@ -449,6 +449,6 @@ void chunked_fifo::reserve(size_t n) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_CHUNKED_FIFO_H_ +#endif // TIANMU_BASE_CHUNKED_FIFO_H_ diff --git a/storage/stonedb/base/core/circular_buffer.h b/storage/tianmu/base/core/circular_buffer.h similarity index 98% rename from storage/stonedb/base/core/circular_buffer.h rename to storage/tianmu/base/core/circular_buffer.h index 73bf221203..5ce8738fa3 100644 --- a/storage/stonedb/base/core/circular_buffer.h +++ b/storage/tianmu/base/core/circular_buffer.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_CIR_BUFF_H_ -#define STONEDB_BASE_CIR_BUFF_H_ +#ifndef TIANMU_BASE_CIR_BUFF_H_ +#define TIANMU_BASE_CIR_BUFF_H_ #pragma once // A growable double-ended queue container that can be efficiently @@ -38,7 +38,7 @@ #include "base/core/bitops.h" #include "base/core/transfer.h" -namespace stonedb { +namespace Tianmu { namespace base { template > @@ -379,6 +379,6 @@ inline typename circular_buffer::iterator circular_buffer::e } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_CIR_BUFF_H_ +#endif // TIANMU_BASE_CIR_BUFF_H_ diff --git a/storage/stonedb/base/core/circular_buffer_fixed_capacity.h b/storage/tianmu/base/core/circular_buffer_fixed_capacity.h similarity index 98% rename from storage/stonedb/base/core/circular_buffer_fixed_capacity.h rename to storage/tianmu/base/core/circular_buffer_fixed_capacity.h index a4cde1949e..474dafe117 100644 --- a/storage/stonedb/base/core/circular_buffer_fixed_capacity.h +++ b/storage/tianmu/base/core/circular_buffer_fixed_capacity.h @@ -19,8 +19,8 @@ * Copyright (C) 2017 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_CIRCBUFF_FIX_CAP_H_ -#define STONEDB_BASE_CIRCBUFF_FIX_CAP_H_ +#ifndef TIANMU_BASE_CIRCBUFF_FIX_CAP_H_ +#define TIANMU_BASE_CIRCBUFF_FIX_CAP_H_ #pragma once // A fixed capacity double-ended queue container that can be efficiently @@ -37,7 +37,7 @@ /// \file -namespace stonedb { +namespace Tianmu { namespace base { /// A fixed-capacity container (like boost::static_vector) that can insert @@ -326,6 +326,6 @@ inline void circular_buffer_fixed_capacity::clear() { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_CIRCBUFF_FIX_CAP_H_ +#endif // TIANMU_BASE_CIRCBUFF_FIX_CAP_H_ diff --git a/storage/stonedb/base/core/condition_variable.h b/storage/tianmu/base/core/condition_variable.h similarity index 97% rename from storage/stonedb/base/core/condition_variable.h rename to storage/tianmu/base/core/condition_variable.h index 5e5c46d04a..f5aea7caeb 100644 --- a/storage/stonedb/base/core/condition_variable.h +++ b/storage/tianmu/base/core/condition_variable.h @@ -19,14 +19,14 @@ * Copyright (C) 2016 ScyllaDB, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_COND_VAR_H_ -#define STONEDB_BASE_COND_VAR_H_ +#ifndef TIANMU_BASE_COND_VAR_H_ +#define TIANMU_BASE_COND_VAR_H_ #pragma once #include "base/core/future_util.h" #include "base/core/semaphore.h" -namespace stonedb { +namespace Tianmu { namespace base { /// \addtogroup fiber-module @@ -166,6 +166,6 @@ class condition_variable { /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_COND_VAR_H_ +#endif // TIANMU_BASE_COND_VAR_H_ diff --git a/storage/stonedb/base/core/deleter.h b/storage/tianmu/base/core/deleter.h similarity index 98% rename from storage/stonedb/base/core/deleter.h rename to storage/tianmu/base/core/deleter.h index 189a034ae0..04c24480ec 100644 --- a/storage/stonedb/base/core/deleter.h +++ b/storage/tianmu/base/core/deleter.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_DELETER_H_ -#define STONEDB_BASE_DELETER_H_ +#ifndef TIANMU_BASE_DELETER_H_ +#define TIANMU_BASE_DELETER_H_ #pragma once #include @@ -28,7 +28,7 @@ #include #include -namespace stonedb { +namespace Tianmu { namespace base { /// \addtogroup memory-module @@ -258,6 +258,6 @@ inline deleter make_object_deleter(deleter d, T &&obj) { /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_DELETER_H_ +#endif // TIANMU_BASE_DELETER_H_ diff --git a/storage/stonedb/base/core/distributed.h b/storage/tianmu/base/core/distributed.h similarity index 86% rename from storage/stonedb/base/core/distributed.h rename to storage/tianmu/base/core/distributed.h index 5025d0cdb5..826230e394 100644 --- a/storage/stonedb/base/core/distributed.h +++ b/storage/tianmu/base/core/distributed.h @@ -19,19 +19,19 @@ * Copyright (C) 2015 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_DISTRIBUTED_H_ -#define STONEDB_BASE_DISTRIBUTED_H_ +#ifndef TIANMU_BASE_DISTRIBUTED_H_ +#define TIANMU_BASE_DISTRIBUTED_H_ #pragma once #include "base/core/sharded.h" -namespace stonedb { +namespace Tianmu { namespace base { template using distributed = sharded; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_DISTRIBUTED_H_ +#endif // TIANMU_BASE_DISTRIBUTED_H_ diff --git a/storage/stonedb/base/core/do_with.h b/storage/tianmu/base/core/do_with.h similarity index 96% rename from storage/stonedb/base/core/do_with.h rename to storage/tianmu/base/core/do_with.h index e69aac2ac0..affe725dd2 100644 --- a/storage/stonedb/base/core/do_with.h +++ b/storage/tianmu/base/core/do_with.h @@ -19,8 +19,8 @@ * Copyright (C) 2015 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_DO_WITH_H_ -#define STONEDB_BASE_DO_WITH_H_ +#ifndef TIANMU_BASE_DO_WITH_H_ +#define TIANMU_BASE_DO_WITH_H_ #pragma once #include @@ -28,7 +28,7 @@ #include #include "base/core/apply.h" -namespace stonedb { +namespace Tianmu { namespace base { /// \addtogroup future-util @@ -107,6 +107,6 @@ inline auto do_with(T1 &&rv1, T2 &&rv2, T3_or_F &&rv3, More &&...more) { /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_DO_WITH_H_ +#endif // TIANMU_BASE_DO_WITH_H_ diff --git a/storage/stonedb/base/core/enum.h b/storage/tianmu/base/core/enum.h similarity index 91% rename from storage/stonedb/base/core/enum.h rename to storage/tianmu/base/core/enum.h index 5586a7f4a8..abb4b111ad 100644 --- a/storage/stonedb/base/core/enum.h +++ b/storage/tianmu/base/core/enum.h @@ -19,8 +19,8 @@ * Copyright (C) 2015 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_ENUM_H_ -#define STONEDB_BASE_ENUM_H_ +#ifndef TIANMU_BASE_ENUM_H_ +#define TIANMU_BASE_ENUM_H_ #pragma once /* @@ -33,7 +33,7 @@ #include #include -namespace stonedb { +namespace Tianmu { namespace base { template @@ -48,6 +48,6 @@ class enum_hash { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_ENUM_H_ +#endif // TIANMU_BASE_ENUM_H_ diff --git a/storage/stonedb/base/core/exception_hacks.cpp b/storage/tianmu/base/core/exception_hacks.cpp similarity index 95% rename from storage/stonedb/base/core/exception_hacks.cpp rename to storage/tianmu/base/core/exception_hacks.cpp index cd2a1bc046..b1b94ba9ab 100644 --- a/storage/stonedb/base/core/exception_hacks.cpp +++ b/storage/tianmu/base/core/exception_hacks.cpp @@ -62,7 +62,7 @@ #include #include -namespace stonedb { +namespace Tianmu { namespace base { using dl_iterate_fn = int (*)(int (*callback)(struct dl_phdr_info *info, size_t size, void *data), void *data); @@ -90,16 +90,16 @@ void init_phdr_cache() { } } // namespace base -} // namespace stonedb +} // namespace Tianmu extern "C" [[gnu::visibility("default")]] [[gnu::externally_visible]] int dl_iterate_phdr( int (*callback)(struct dl_phdr_info *info, size_t size, void *data), void *data) { - if (!stonedb::base::phdrs_cache.size()) { + if (!Tianmu::base::phdrs_cache.size()) { // Cache is not yet populated, pass through to original function - return stonedb::base::dl_iterate_phdr_org()(callback, data); + return Tianmu::base::dl_iterate_phdr_org()(callback, data); } int r = 0; - for (auto h : stonedb::base::phdrs_cache) { + for (auto h : Tianmu::base::phdrs_cache) { // Pass dl_phdr_info size that does not include dlpi_adds and dlpi_subs. // This forces libgcc to disable caching which is not thread safe and // requires dl_iterate_phdr to serialize calls to callback. Since we do diff --git a/storage/stonedb/base/core/exception_hacks.h b/storage/tianmu/base/core/exception_hacks.h similarity index 84% rename from storage/stonedb/base/core/exception_hacks.h rename to storage/tianmu/base/core/exception_hacks.h index f83d5d220b..a6da5328c2 100644 --- a/storage/stonedb/base/core/exception_hacks.h +++ b/storage/tianmu/base/core/exception_hacks.h @@ -19,16 +19,16 @@ * Copyright (C) 2017 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_EXCEPTION_HACKS_H_ -#define STONEDB_BASE_EXCEPTION_HACKS_H_ +#ifndef TIANMU_BASE_EXCEPTION_HACKS_H_ +#define TIANMU_BASE_EXCEPTION_HACKS_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace base { void init_phdr_cache(); } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_EXCEPTION_HACKS_H_ +#endif // TIANMU_BASE_EXCEPTION_HACKS_H_ diff --git a/storage/stonedb/base/core/execution_stage.h b/storage/tianmu/base/core/execution_stage.h similarity index 99% rename from storage/stonedb/base/core/execution_stage.h rename to storage/tianmu/base/core/execution_stage.h index 9915e1826e..bcaf76939e 100644 --- a/storage/stonedb/base/core/execution_stage.h +++ b/storage/tianmu/base/core/execution_stage.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_EXECUTION_STAGE_H_ -#define STONEDB_BASE_EXECUTION_STAGE_H_ +#ifndef TIANMU_BASE_EXECUTION_STAGE_H_ +#define TIANMU_BASE_EXECUTION_STAGE_H_ #pragma once #include "base/core/chunked_fifo.h" @@ -35,7 +35,7 @@ #include "base/util/gcc6-concepts.h" #include "base/util/reference_wrapper.h" -namespace stonedb { +namespace Tianmu { namespace base { /// \defgroup execution-stages Execution Stages @@ -519,6 +519,6 @@ inline execution_stage::execution_stage(execution_stage &&other) } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_EXECUTION_STAGE_H_ +#endif // TIANMU_BASE_EXECUTION_STAGE_H_ diff --git a/storage/stonedb/base/core/expiring_fifo.h b/storage/tianmu/base/core/expiring_fifo.h similarity index 96% rename from storage/stonedb/base/core/expiring_fifo.h rename to storage/tianmu/base/core/expiring_fifo.h index 61472e4abd..cff66262a1 100644 --- a/storage/stonedb/base/core/expiring_fifo.h +++ b/storage/tianmu/base/core/expiring_fifo.h @@ -19,8 +19,8 @@ * Copyright (C) 2016 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_EXPIRING_FIFO_H_ -#define STONEDB_BASE_EXPIRING_FIFO_H_ +#ifndef TIANMU_BASE_EXPIRING_FIFO_H_ +#define TIANMU_BASE_EXPIRING_FIFO_H_ #pragma once #include @@ -32,7 +32,7 @@ #include "base/core/lowres_clock.h" #include "base/core/timer.h" -namespace stonedb { +namespace Tianmu { namespace base { template @@ -163,6 +163,6 @@ class expiring_fifo { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_EXPIRING_FIFO_H_ +#endif // TIANMU_BASE_EXPIRING_FIFO_H_ diff --git a/storage/stonedb/base/core/fair_queue.h b/storage/tianmu/base/core/fair_queue.h similarity index 98% rename from storage/stonedb/base/core/fair_queue.h rename to storage/tianmu/base/core/fair_queue.h index a2c9b5d751..5e1c627048 100644 --- a/storage/stonedb/base/core/fair_queue.h +++ b/storage/tianmu/base/core/fair_queue.h @@ -20,8 +20,8 @@ * Copyright (C) 2016 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_FAIR_QUEUE_H_ -#define STONEDB_BASE_FAIR_QUEUE_H_ +#ifndef TIANMU_BASE_FAIR_QUEUE_H_ +#define TIANMU_BASE_FAIR_QUEUE_H_ #pragma once #include @@ -37,7 +37,7 @@ #include "base/core/semaphore.h" #include "base/core/shared_ptr.h" -namespace stonedb { +namespace Tianmu { namespace base { /// \addtogroup io-module /// @{ @@ -227,6 +227,6 @@ class fair_queue { /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_FAIR_QUEUE_H_ +#endif // TIANMU_BASE_FAIR_QUEUE_H_ diff --git a/storage/stonedb/base/core/file.h b/storage/tianmu/base/core/file.h similarity index 99% rename from storage/stonedb/base/core/file.h rename to storage/tianmu/base/core/file.h index a26c4a2995..347df5a5a7 100644 --- a/storage/stonedb/base/core/file.h +++ b/storage/tianmu/base/core/file.h @@ -19,8 +19,8 @@ * Copyright 2015 Cloudius Systems * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_FILE_H_ -#define STONEDB_BASE_FILE_H_ +#ifndef TIANMU_BASE_FILE_H_ +#define TIANMU_BASE_FILE_H_ #pragma once #include @@ -38,7 +38,7 @@ #include "base/core/sstring.h" #include "base/core/stream.h" -namespace stonedb { +namespace Tianmu { namespace base { /// \addtogroup fileio-module @@ -525,6 +525,6 @@ struct file::read_state { /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_FILE_H_ +#endif // TIANMU_BASE_FILE_H_ diff --git a/storage/stonedb/base/core/file_impl.h b/storage/tianmu/base/core/file_impl.h similarity index 97% rename from storage/stonedb/base/core/file_impl.h rename to storage/tianmu/base/core/file_impl.h index a9781a479d..e30f848a5a 100644 --- a/storage/stonedb/base/core/file_impl.h +++ b/storage/tianmu/base/core/file_impl.h @@ -19,8 +19,8 @@ * Copyright 2016 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_FILE_IMPL_H_ -#define STONEDB_BASE_FILE_IMPL_H_ +#ifndef TIANMU_BASE_FILE_IMPL_H_ +#define TIANMU_BASE_FILE_IMPL_H_ #pragma once #include @@ -28,7 +28,7 @@ #include "base/core/file.h" -namespace stonedb { +namespace Tianmu { namespace base { class posix_file_handle_impl : public base::file_handle_impl { @@ -174,6 +174,6 @@ class blockdev_file_impl : public posix_file_impl { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_FILE_IMPL_H_ +#endif // TIANMU_BASE_FILE_IMPL_H_ diff --git a/storage/stonedb/base/core/fsqual.cpp b/storage/tianmu/base/core/fsqual.cpp similarity index 98% rename from storage/stonedb/base/core/fsqual.cpp rename to storage/tianmu/base/core/fsqual.cpp index e93993da2b..ffa3b21126 100644 --- a/storage/stonedb/base/core/fsqual.cpp +++ b/storage/tianmu/base/core/fsqual.cpp @@ -37,7 +37,7 @@ #include "base/core/posix.h" #include "base/util/defer.h" -namespace stonedb { +namespace Tianmu { namespace base { // Runs func(), and also adds the number of context switches @@ -105,4 +105,4 @@ bool filesystem_has_good_aio_support([[maybe_unused]] sstring directory, [[maybe } } // namespace base -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/core/fsqual.h b/storage/tianmu/base/core/fsqual.h similarity index 87% rename from storage/stonedb/base/core/fsqual.h rename to storage/tianmu/base/core/fsqual.h index eaf9a8d8e2..5c5b1563df 100644 --- a/storage/stonedb/base/core/fsqual.h +++ b/storage/tianmu/base/core/fsqual.h @@ -19,18 +19,18 @@ * specific language governing permissions and limitations * under the License. */ -#ifndef STONEDB_BASE_FSQUAL_H_ -#define STONEDB_BASE_FSQUAL_H_ +#ifndef TIANMU_BASE_FSQUAL_H_ +#define TIANMU_BASE_FSQUAL_H_ #pragma once #include "base/core/sstring.h" -namespace stonedb { +namespace Tianmu { namespace base { bool filesystem_has_good_aio_support(sstring directory, bool verbose = false); } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_FSQUAL_H_ +#endif // TIANMU_BASE_FSQUAL_H_ diff --git a/storage/stonedb/base/core/fstream.cpp b/storage/tianmu/base/core/fstream.cpp similarity index 99% rename from storage/stonedb/base/core/fstream.cpp rename to storage/tianmu/base/core/fstream.cpp index 53f79e6bfd..cc3289335e 100644 --- a/storage/stonedb/base/core/fstream.cpp +++ b/storage/tianmu/base/core/fstream.cpp @@ -33,7 +33,7 @@ #include "base/core/reactor.h" #include "base/core/semaphore.h" -namespace stonedb::base { +namespace Tianmu::base { class file_data_source_impl : public data_source_impl { struct issued_read { uint64_t _pos; @@ -438,4 +438,4 @@ output_stream make_file_output_stream(file f, size_t buffer_size) { output_stream make_file_output_stream(file f, file_output_stream_options options) { return output_stream(file_data_sink(std::move(f), options), options.buffer_size, true); } -} // namespace stonedb::base +} // namespace Tianmu::base diff --git a/storage/stonedb/base/core/fstream.h b/storage/tianmu/base/core/fstream.h similarity index 92% rename from storage/stonedb/base/core/fstream.h rename to storage/tianmu/base/core/fstream.h index 672fcb3e94..fd4bb46c04 100644 --- a/storage/stonedb/base/core/fstream.h +++ b/storage/tianmu/base/core/fstream.h @@ -19,8 +19,8 @@ * Copyright (C) 2015 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_FSTREAM_H_ -#define STONEDB_BASE_FSTREAM_H_ +#ifndef TIANMU_BASE_FSTREAM_H_ +#define TIANMU_BASE_FSTREAM_H_ #pragma once // Seastar files are block-based due to the reliance on DMA - you must read @@ -32,7 +32,7 @@ #include "base/core/iostream.h" #include "base/core/shared_ptr.h" -namespace stonedb { +namespace Tianmu { namespace base { class file_input_stream_history { @@ -52,7 +52,7 @@ class file_input_stream_history { struct file_input_stream_options { size_t buffer_size = 8192; ///< I/O buffer size unsigned read_ahead = 0; ///< Maximum number of extra read-ahead operations - stonedb::base::io_priority_class io_priority_class = default_priority_class(); + Tianmu::base::io_priority_class io_priority_class = default_priority_class(); lw_shared_ptr dynamic_adjustments = {}; ///< Input stream history, if null dynamic adjustments are disabled }; @@ -84,7 +84,7 @@ struct file_output_stream_options { unsigned buffer_size = 8192; unsigned preallocation_size = 1024 * 1024; // 1MB unsigned write_behind = 1; ///< Number of buffers to write in parallel - stonedb::base::io_priority_class io_priority_class = default_priority_class(); + Tianmu::base::io_priority_class io_priority_class = default_priority_class(); }; // Create an output_stream for writing starting at the position zero of a @@ -97,6 +97,6 @@ output_stream make_file_output_stream(file file, uint64_t buffer_size = 81 /// NOTE: flush() should be the last thing to be called on a file output stream. output_stream make_file_output_stream(file file, file_output_stream_options options); } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_FSTREAM_H_ +#endif // TIANMU_BASE_FSTREAM_H_ diff --git a/storage/stonedb/base/core/function_traits.h b/storage/tianmu/base/core/function_traits.h similarity index 92% rename from storage/stonedb/base/core/function_traits.h rename to storage/tianmu/base/core/function_traits.h index e2fa2a381d..cc220c8e60 100644 --- a/storage/stonedb/base/core/function_traits.h +++ b/storage/tianmu/base/core/function_traits.h @@ -19,13 +19,13 @@ * Copyright 2015 Cloudius Systems * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_FUNCTION_TRAITS_H_ -#define STONEDB_BASE_FUNCTION_TRAITS_H_ +#ifndef TIANMU_BASE_FUNCTION_TRAITS_H_ +#define TIANMU_BASE_FUNCTION_TRAITS_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace base { template @@ -62,6 +62,6 @@ template struct function_traits : public function_traits> {}; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_FUNCTION_TRAITS_H_ +#endif // TIANMU_BASE_FUNCTION_TRAITS_H_ diff --git a/storage/stonedb/base/core/future.h b/storage/tianmu/base/core/future.h similarity index 97% rename from storage/stonedb/base/core/future.h rename to storage/tianmu/base/core/future.h index 5bfb738dda..f3d730d393 100644 --- a/storage/stonedb/base/core/future.h +++ b/storage/tianmu/base/core/future.h @@ -19,8 +19,8 @@ * Copyright (C) 2015 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_FUTURE_H_ -#define STONEDB_BASE_FUTURE_H_ +#ifndef TIANMU_BASE_FUTURE_H_ +#define TIANMU_BASE_FUTURE_H_ #pragma once #include @@ -37,7 +37,7 @@ #include "base/core/thread_impl.h" #include "base/util/gcc6-concepts.h" -namespace stonedb { +namespace Tianmu { namespace base { /// \defgroup future-module Futures and Promises @@ -688,7 +688,7 @@ class future { template void schedule(Func &&func) { if (state()->available()) { - stonedb::base::schedule(std::make_unique>(std::move(func), std::move(*state()))); + Tianmu::base::schedule(std::make_unique>(std::move(func), std::move(*state()))); } else { assert(_promise); _promise->schedule(std::move(func)); @@ -830,7 +830,7 @@ class future { /// \return a \c future representing the return value of \c func, applied /// to the eventual value of this future. template >> - GCC6_CONCEPT(requires stonedb::base::CanApply) + GCC6_CONCEPT(requires Tianmu::base::CanApply) Result then(Func &&func) noexcept { using futurator = futurize>; if (available() && !need_preempt()) { @@ -875,7 +875,7 @@ class future { /// \return a \c future representing the return value of \c func, applied /// to the eventual value of this future. template >> - GCC6_CONCEPT(requires stonedb::base::CanApply) + GCC6_CONCEPT(requires Tianmu::base::CanApply) Result then_wrapped(Func &&func) noexcept { using futurator = futurize>; if (available() && !need_preempt()) { @@ -932,7 +932,7 @@ class future { * nested will be propagated. */ template - GCC6_CONCEPT(requires stonedb::base::CanApply) + GCC6_CONCEPT(requires Tianmu::base::CanApply) future finally(Func &&func) noexcept { return then_wrapped(finally_body>::value>(std::forward(func))); } @@ -1016,11 +1016,11 @@ class future { /// future<>, the handler function does not need to return anything. template /* Broken? - GCC6_CONCEPT( requires stonedb::base::ApplyReturns, + GCC6_CONCEPT( requires Tianmu::base::ApplyReturns, std::exception_ptr> - || (sizeof...(T) == 0 && stonedb::base::ApplyReturns) - || (sizeof...(T) == 1 && stonedb::base::ApplyReturns) ) */ future handle_exception(Func &&func) noexcept { @@ -1101,9 +1101,9 @@ inline void promise::make_ready() noexcept { if (_task) { _state = nullptr; if (Urgent == urgent::yes && !need_preempt()) { - stonedb::base::schedule_urgent(std::move(_task)); + Tianmu::base::schedule_urgent(std::move(_task)); } else { - stonedb::base::schedule(std::move(_task)); + Tianmu::base::schedule(std::move(_task)); } } } @@ -1156,7 +1156,7 @@ template template typename futurize::type futurize::apply(Func &&func, std::tuple &&args) noexcept { try { - return convert(stonedb::base::apply(std::forward(func), std::move(args))); + return convert(Tianmu::base::apply(std::forward(func), std::move(args))); } catch (...) { return make_exception_future(std::current_exception()); } @@ -1197,7 +1197,7 @@ template inline std::enable_if_t>::value, future<>> do_void_futurize_apply_tuple(Func &&func, std::tuple &&args) noexcept { try { - stonedb::base::apply(std::forward(func), std::move(args)); + Tianmu::base::apply(std::forward(func), std::move(args)); return make_ready_future<>(); } catch (...) { return make_exception_future(std::current_exception()); @@ -1208,7 +1208,7 @@ template inline std::enable_if_t>::value, future<>> do_void_futurize_apply_tuple(Func &&func, std::tuple &&args) noexcept { try { - return stonedb::base::apply(std::forward(func), std::move(args)); + return Tianmu::base::apply(std::forward(func), std::move(args)); } catch (...) { return make_exception_future(std::current_exception()); } @@ -1229,7 +1229,7 @@ template typename futurize>::type futurize>::apply(Func &&func, std::tuple &&args) noexcept { try { - return stonedb::base::apply(std::forward(func), std::move(args)); + return Tianmu::base::apply(std::forward(func), std::move(args)); } catch (...) { return make_exception_future(std::current_exception()); } @@ -1248,18 +1248,18 @@ typename futurize>::type futurize>::apply(Func & template template inline future futurize::make_exception_future(Arg &&arg) { - return stonedb::base::make_exception_future(std::forward(arg)); + return Tianmu::base::make_exception_future(std::forward(arg)); } template template inline future futurize>::make_exception_future(Arg &&arg) { - return stonedb::base::make_exception_future(std::forward(arg)); + return Tianmu::base::make_exception_future(std::forward(arg)); } template inline future<> futurize::make_exception_future(Arg &&arg) { - return stonedb::base::make_exception_future<>(std::forward(arg)); + return Tianmu::base::make_exception_future<>(std::forward(arg)); } template @@ -1285,6 +1285,6 @@ auto futurize_apply(Func &&func, Args &&...args) { /// \endcond } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_FUTURE_H_ +#endif // TIANMU_BASE_FUTURE_H_ diff --git a/storage/stonedb/base/core/future_util.h b/storage/tianmu/base/core/future_util.h similarity index 99% rename from storage/stonedb/base/core/future_util.h rename to storage/tianmu/base/core/future_util.h index 2069938bcd..b38f8b06ed 100644 --- a/storage/stonedb/base/core/future_util.h +++ b/storage/tianmu/base/core/future_util.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_FUTURE_UTIL_H_ -#define STONEDB_BASE_FUTURE_UTIL_H_ +#ifndef TIANMU_BASE_FUTURE_UTIL_H_ +#define TIANMU_BASE_FUTURE_UTIL_H_ #pragma once #include @@ -36,7 +36,7 @@ #include "base/util/bool_class.h" #include "base/util/tuple_utils.h" -namespace stonedb { +namespace Tianmu { namespace base { /// \cond internal @@ -985,6 +985,6 @@ inline auto when_all_succeed(FutureIterator begin, FutureIterator end) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_FUTURE_UTIL_H_ +#endif // TIANMU_BASE_FUTURE_UTIL_H_ diff --git a/storage/stonedb/base/core/gate.h b/storage/tianmu/base/core/gate.h similarity index 96% rename from storage/stonedb/base/core/gate.h rename to storage/tianmu/base/core/gate.h index b06f594522..bba19121f0 100644 --- a/storage/stonedb/base/core/gate.h +++ b/storage/tianmu/base/core/gate.h @@ -19,8 +19,8 @@ * Copyright 2014 Cloudius Systems * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_GATE_H_ -#define STONEDB_BASE_GATE_H_ +#ifndef TIANMU_BASE_GATE_H_ +#define TIANMU_BASE_GATE_H_ #pragma once #include @@ -28,7 +28,7 @@ #include "base/core/future.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace stdx = std::experimental; @@ -117,6 +117,6 @@ inline auto with_gate(gate &g, Func &&func) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_GATE_H_ +#endif // TIANMU_BASE_GATE_H_ diff --git a/storage/stonedb/base/core/iostream.h b/storage/tianmu/base/core/iostream.h similarity index 98% rename from storage/stonedb/base/core/iostream.h rename to storage/tianmu/base/core/iostream.h index 7c85c9fae7..05e2a3b99d 100644 --- a/storage/stonedb/base/core/iostream.h +++ b/storage/tianmu/base/core/iostream.h @@ -30,15 +30,15 @@ // it. // -#ifndef STONEDB_BASE_IOSTREAM_H_ -#define STONEDB_BASE_IOSTREAM_H_ +#ifndef TIANMU_BASE_IOSTREAM_H_ +#define TIANMU_BASE_IOSTREAM_H_ #pragma once #include "base/core/future.h" #include "base/core/scattered_message.h" #include "base/core/temporary_buffer.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace net { // internal namespace @@ -251,8 +251,8 @@ class output_stream final { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu #include "iostream_impl.h" -#endif // STONEDB_BASE_IOSTREAM_H_ +#endif // TIANMU_BASE_IOSTREAM_H_ diff --git a/storage/stonedb/base/core/iostream_impl.h b/storage/tianmu/base/core/iostream_impl.h similarity index 98% rename from storage/stonedb/base/core/iostream_impl.h rename to storage/tianmu/base/core/iostream_impl.h index 7e529c7e55..03736013b3 100644 --- a/storage/stonedb/base/core/iostream_impl.h +++ b/storage/tianmu/base/core/iostream_impl.h @@ -19,14 +19,14 @@ * Copyright (C) 2015 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_IOSTREAM_IMPL_H_ -#define STONEDB_BASE_IOSTREAM_IMPL_H_ +#ifndef TIANMU_BASE_IOSTREAM_IMPL_H_ +#define TIANMU_BASE_IOSTREAM_IMPL_H_ #pragma once #include "base/core/future_util.h" #include "base/net/packet.h" -namespace stonedb { +namespace Tianmu { namespace base { inline future> data_source_impl::skip(uint64_t n) { @@ -463,6 +463,6 @@ data_sink output_stream::detach() && { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_IOSTREAM_IMPL_H_ +#endif // TIANMU_BASE_IOSTREAM_IMPL_H_ diff --git a/storage/stonedb/base/core/lowres_clock.h b/storage/tianmu/base/core/lowres_clock.h similarity index 96% rename from storage/stonedb/base/core/lowres_clock.h rename to storage/tianmu/base/core/lowres_clock.h index ba3b0e52eb..3a8a1f9cc3 100644 --- a/storage/stonedb/base/core/lowres_clock.h +++ b/storage/tianmu/base/core/lowres_clock.h @@ -19,8 +19,8 @@ * Copyright (C) 2016 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_LOWRES_CLOCK_H_ -#define STONEDB_BASE_LOWRES_CLOCK_H_ +#ifndef TIANMU_BASE_LOWRES_CLOCK_H_ +#define TIANMU_BASE_LOWRES_CLOCK_H_ #pragma once #include @@ -30,7 +30,7 @@ #include "base/core/cacheline.h" #include "base/core/timer.h" -namespace stonedb { +namespace Tianmu { namespace base { class lowres_clock; @@ -151,6 +151,6 @@ class lowres_system_clock final { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_LOWRES_CLOCK_H_ +#endif // TIANMU_BASE_LOWRES_CLOCK_H_ diff --git a/storage/stonedb/base/core/manual_clock.h b/storage/tianmu/base/core/manual_clock.h similarity index 89% rename from storage/stonedb/base/core/manual_clock.h rename to storage/tianmu/base/core/manual_clock.h index dfc523a01d..7344a6948d 100644 --- a/storage/stonedb/base/core/manual_clock.h +++ b/storage/tianmu/base/core/manual_clock.h @@ -19,13 +19,13 @@ * Copyright (C) 2016 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_MANUAL_CLOCK_H_ -#define STONEDB_BASE_MANUAL_CLOCK_H_ +#ifndef TIANMU_BASE_MANUAL_CLOCK_H_ +#define TIANMU_BASE_MANUAL_CLOCK_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace base { class manual_clock { @@ -46,6 +46,6 @@ class manual_clock { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_MANUAL_CLOCK_H_ +#endif // TIANMU_BASE_MANUAL_CLOCK_H_ diff --git a/storage/stonedb/base/core/metrics.cpp b/storage/tianmu/base/core/metrics.cpp similarity index 99% rename from storage/stonedb/base/core/metrics.cpp rename to storage/tianmu/base/core/metrics.cpp index e973941144..d27a118af5 100644 --- a/storage/stonedb/base/core/metrics.cpp +++ b/storage/tianmu/base/core/metrics.cpp @@ -28,7 +28,7 @@ #include "base/core/metrics_api.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace metrics { @@ -335,4 +335,4 @@ histogram histogram::operator+(histogram &&c) const { } // namespace metrics } // namespace base -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/core/metrics.h b/storage/tianmu/base/core/metrics.h similarity index 99% rename from storage/stonedb/base/core/metrics.h rename to storage/tianmu/base/core/metrics.h index 993350050d..f381682ec2 100644 --- a/storage/stonedb/base/core/metrics.h +++ b/storage/tianmu/base/core/metrics.h @@ -19,8 +19,8 @@ * Copyright (C) 2016 ScyllaDB. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_METRICS_H_ -#define STONEDB_BASE_METRICS_H_ +#ifndef TIANMU_BASE_METRICS_H_ +#define TIANMU_BASE_METRICS_H_ #pragma once #include @@ -44,10 +44,10 @@ * */ -namespace stonedb { +namespace Tianmu { namespace base { /*! - * \namespace stonedb::base::metrics + * \namespace Tianmu::base::metrics * \brief metrics creation and registration * * the metrics namespace holds the relevant method and classes to generate @@ -577,6 +577,6 @@ impl::metric_definition_impl make_total_operations(metric_name_type name, T &&va } // namespace metrics } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_METRICS_H_ +#endif // TIANMU_BASE_METRICS_H_ diff --git a/storage/stonedb/base/core/metrics_api.h b/storage/tianmu/base/core/metrics_api.h similarity index 92% rename from storage/stonedb/base/core/metrics_api.h rename to storage/tianmu/base/core/metrics_api.h index d133d5d18e..842bceadfe 100644 --- a/storage/stonedb/base/core/metrics_api.h +++ b/storage/tianmu/base/core/metrics_api.h @@ -19,8 +19,8 @@ * Copyright (C) 2016 ScyllaDB. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_METRICS_API_H_ -#define STONEDB_BASE_METRICS_API_H_ +#ifndef TIANMU_BASE_METRICS_API_H_ +#define TIANMU_BASE_METRICS_API_H_ #pragma once #include @@ -33,7 +33,7 @@ * \brief header file for metric API layer (like promehteus or collectd) */ -namespace stonedb { +namespace Tianmu { namespace base { namespace metrics { // internal namespace @@ -42,24 +42,24 @@ using labels_type = std::map; } } // namespace metrics } // namespace base -} // namespace stonedb +} // namespace Tianmu namespace std { template <> -struct hash { - using argument_type = stonedb::base::metrics::impl::labels_type; +struct hash { + using argument_type = Tianmu::base::metrics::impl::labels_type; using result_type = ::std::size_t; result_type operator()(argument_type const &s) const { result_type h = 0; for (auto &&i : s) { - boost::hash_combine(h, std::hash{}(i.second)); + boost::hash_combine(h, std::hash{}(i.second)); } return h; } }; } // namespace std -namespace stonedb { +namespace Tianmu { namespace base { namespace metrics { namespace impl { @@ -108,22 +108,22 @@ class metric_id { } // namespace impl } // namespace metrics } // namespace base -} // namespace stonedb +} // namespace Tianmu namespace std { template <> -struct hash { - using argument_type = stonedb::base::metrics::impl::metric_id; +struct hash { + using argument_type = Tianmu::base::metrics::impl::metric_id; using result_type = ::std::size_t; result_type operator()(argument_type const &s) const { - result_type const h1(std::hash{}(s.group_name())); - result_type const h2(std::hash{}(s.instance_id())); + result_type const h1(std::hash{}(s.group_name())); + result_type const h2(std::hash{}(s.instance_id())); return h1 ^ (h2 << 1); // or use boost::hash_combine } }; } // namespace std -namespace stonedb { +namespace Tianmu { namespace base { namespace metrics { namespace impl { @@ -321,6 +321,6 @@ future<> configure(const metric_settings &opts = create_default_metric_settings( } // namespace metrics } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_METRICS_API_H_ +#endif // TIANMU_BASE_METRICS_API_H_ diff --git a/storage/stonedb/base/core/metrics_registration.h b/storage/tianmu/base/core/metrics_registration.h similarity index 96% rename from storage/stonedb/base/core/metrics_registration.h rename to storage/tianmu/base/core/metrics_registration.h index 1e6f080f75..91d861cd21 100644 --- a/storage/stonedb/base/core/metrics_registration.h +++ b/storage/tianmu/base/core/metrics_registration.h @@ -19,8 +19,8 @@ * Copyright (C) 2016 ScyllaDB. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_METRICS_REGISTRATION_H_ -#define STONEDB_BASE_METRICS_REGISTRATION_H_ +#ifndef TIANMU_BASE_METRICS_REGISTRATION_H_ +#define TIANMU_BASE_METRICS_REGISTRATION_H_ #pragma once #include "base/core/sstring.h" @@ -46,7 +46,7 @@ * @see metrics.hh for the definition for adding a metric. */ -namespace stonedb { +namespace Tianmu { namespace base { namespace metrics { @@ -150,6 +150,6 @@ class metric_group : public metric_groups { } // namespace metrics } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_METRICS_REGISTRATION_H_ +#endif // TIANMU_BASE_METRICS_REGISTRATION_H_ diff --git a/storage/stonedb/base/core/metrics_types.h b/storage/tianmu/base/core/metrics_types.h similarity index 93% rename from storage/stonedb/base/core/metrics_types.h rename to storage/tianmu/base/core/metrics_types.h index 1d3cea91dc..fa1aa226cd 100644 --- a/storage/stonedb/base/core/metrics_types.h +++ b/storage/tianmu/base/core/metrics_types.h @@ -19,12 +19,12 @@ * Copyright (C) 2016 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_METRICS_TYPES_H_ -#define STONEDB_BASE_METRICS_TYPES_H_ +#ifndef TIANMU_BASE_METRICS_TYPES_H_ +#define TIANMU_BASE_METRICS_TYPES_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace base { namespace metrics { @@ -81,6 +81,6 @@ struct histogram { } // namespace metrics } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_METRICS_TYPES_H_ +#endif // TIANMU_BASE_METRICS_TYPES_H_ diff --git a/storage/stonedb/base/core/pipe.h b/storage/tianmu/base/core/pipe.h similarity index 98% rename from storage/stonedb/base/core/pipe.h rename to storage/tianmu/base/core/pipe.h index b4f51e7add..89172e8e17 100644 --- a/storage/stonedb/base/core/pipe.h +++ b/storage/tianmu/base/core/pipe.h @@ -19,8 +19,8 @@ * Copyright (C) 2015 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_PIPE_H_ -#define STONEDB_BASE_PIPE_H_ +#ifndef TIANMU_BASE_PIPE_H_ +#define TIANMU_BASE_PIPE_H_ #pragma once #include @@ -61,7 +61,7 @@ /// /// Seastar API namespace -namespace stonedb { +namespace Tianmu { namespace base { /// \addtogroup fiber-module @@ -252,6 +252,6 @@ class pipe { /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_PIPE_H_ +#endif // TIANMU_BASE_PIPE_H_ diff --git a/storage/stonedb/base/core/posix.cpp b/storage/tianmu/base/core/posix.cpp similarity index 98% rename from storage/stonedb/base/core/posix.cpp rename to storage/tianmu/base/core/posix.cpp index 9b995689ba..07e100174a 100644 --- a/storage/stonedb/base/core/posix.cpp +++ b/storage/tianmu/base/core/posix.cpp @@ -29,7 +29,7 @@ #define MADV_HUGEPAGE MADV_NORMAL #endif -namespace stonedb { +namespace Tianmu { namespace base { file_desc file_desc::temporary(sstring directory) { @@ -101,4 +101,4 @@ void posix_thread::join() { } } // namespace base -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/core/posix.h b/storage/tianmu/base/core/posix.h similarity index 98% rename from storage/stonedb/base/core/posix.h rename to storage/tianmu/base/core/posix.h index ffd5af4e1e..3367a0cc68 100644 --- a/storage/stonedb/base/core/posix.h +++ b/storage/tianmu/base/core/posix.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_POSIX_H_ -#define STONEDB_BASE_POSIX_H_ +#ifndef TIANMU_BASE_POSIX_H_ +#define TIANMU_BASE_POSIX_H_ #pragma once #include @@ -47,7 +47,7 @@ #include "base/core/sstring.h" #include "base/net/socket_defs.h" -namespace stonedb { +namespace Tianmu { namespace base { /// \file @@ -455,6 +455,6 @@ inline void pin_this_thread(unsigned cpu_id) { /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_POSIX_H_ +#endif // TIANMU_BASE_POSIX_H_ diff --git a/storage/stonedb/base/core/preempt.h b/storage/tianmu/base/core/preempt.h similarity index 88% rename from storage/stonedb/base/core/preempt.h rename to storage/tianmu/base/core/preempt.h index 2b1a55c25b..55d7ab15e3 100644 --- a/storage/stonedb/base/core/preempt.h +++ b/storage/tianmu/base/core/preempt.h @@ -19,12 +19,12 @@ * Copyright (C) 2016 ScyllaDB. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_PREEMPT_H_ -#define STONEDB_BASE_PREEMPT_H_ +#ifndef TIANMU_BASE_PREEMPT_H_ +#define TIANMU_BASE_PREEMPT_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace base { extern __thread bool g_need_preempt; @@ -40,6 +40,6 @@ inline bool need_preempt() { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_PREEMPT_H_ +#endif // TIANMU_BASE_PREEMPT_H_ diff --git a/storage/stonedb/base/core/prefetch.h b/storage/tianmu/base/core/prefetch.h similarity index 96% rename from storage/stonedb/base/core/prefetch.h rename to storage/tianmu/base/core/prefetch.h index aef45fe0ae..53d35a4ff0 100644 --- a/storage/stonedb/base/core/prefetch.h +++ b/storage/tianmu/base/core/prefetch.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_PREFETCH_H_ -#define STONEDB_BASE_PREFETCH_H_ +#ifndef TIANMU_BASE_PREFETCH_H_ +#define TIANMU_BASE_PREFETCH_H_ #pragma once #include @@ -30,7 +30,7 @@ #include "base/core/align.h" #include "base/core/cacheline.h" -namespace stonedb { +namespace Tianmu { namespace base { template @@ -119,6 +119,6 @@ void prefetchw_n(T **pptr) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_PREFETCH_H_ +#endif // TIANMU_BASE_PREFETCH_H_ diff --git a/storage/stonedb/base/core/print.h b/storage/tianmu/base/core/print.h similarity index 89% rename from storage/stonedb/base/core/print.h rename to storage/tianmu/base/core/print.h index da01355ca5..88b1845ad3 100644 --- a/storage/stonedb/base/core/print.h +++ b/storage/tianmu/base/core/print.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_PRINT_H_ -#define STONEDB_BASE_PRINT_H_ +#ifndef TIANMU_BASE_PRINT_H_ +#define TIANMU_BASE_PRINT_H_ #pragma once #include @@ -36,31 +36,31 @@ inline std::ostream &operator<<(std::ostream &&os, const void *ptr) { return os << ptr; // selects non-rvalue version } -namespace stonedb { +namespace Tianmu { namespace base { template std::ostream &fprint(std::ostream &os, const char *fmt, A &&...a) { - stonedb::fmt::fprintf(os, fmt, std::forward(a)...); + Tianmu::fmt::fprintf(os, fmt, std::forward(a)...); return os; } template void print(const char *fmt, A &&...a) { - stonedb::fmt::printf(fmt, std::forward(a)...); + Tianmu::fmt::printf(fmt, std::forward(a)...); } template std::string sprint(const char *fmt, A &&...a) { std::ostringstream os; - stonedb::fmt::fprintf(os, fmt, std::forward(a)...); + Tianmu::fmt::fprintf(os, fmt, std::forward(a)...); return os.str(); } template std::string sprint(const sstring &fmt, A &&...a) { std::ostringstream os; - stonedb::fmt::fprintf(os, fmt.c_str(), std::forward(a)...); + Tianmu::fmt::fprintf(os, fmt.c_str(), std::forward(a)...); return os.str(); } @@ -120,6 +120,6 @@ sstring format(const char *fmt, A &&...a) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_PRINT_H_ +#endif // TIANMU_BASE_PRINT_H_ diff --git a/storage/stonedb/base/core/queue.h b/storage/tianmu/base/core/queue.h similarity index 97% rename from storage/stonedb/base/core/queue.h rename to storage/tianmu/base/core/queue.h index f9331ba323..b522ddede1 100644 --- a/storage/stonedb/base/core/queue.h +++ b/storage/tianmu/base/core/queue.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_QUEUE_H_ -#define STONEDB_BASE_QUEUE_H_ +#ifndef TIANMU_BASE_QUEUE_H_ +#define TIANMU_BASE_QUEUE_H_ #pragma once #include @@ -29,7 +29,7 @@ #include "core/circular_buffer.h" #include "core/future.h" -namespace stonedb { +namespace Tianmu { namespace base { template @@ -229,6 +229,6 @@ inline future<> queue::not_full() { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_QUEUE_H_ +#endif // TIANMU_BASE_QUEUE_H_ diff --git a/storage/stonedb/base/core/reactor.cpp b/storage/tianmu/base/core/reactor.cpp similarity index 99% rename from storage/stonedb/base/core/reactor.cpp rename to storage/tianmu/base/core/reactor.cpp index 791399c310..6d899d4004 100644 --- a/storage/stonedb/base/core/reactor.cpp +++ b/storage/tianmu/base/core/reactor.cpp @@ -86,7 +86,7 @@ #include "base/core/metrics.h" #include "base/util/defer.h" -namespace stonedb { +namespace Tianmu { namespace base { using namespace std::chrono_literals; @@ -954,7 +954,7 @@ void reactor::register_metrics() { }); } - using namespace stonedb::base::metrics; + using namespace Tianmu::base::metrics; _metric_groups.add_group( "reactor", { make_counter("fstream_reads", _io_stats.fstream_reads, @@ -1858,13 +1858,13 @@ void schedule(std::unique_ptr t) { engine().add_task(std::move(t)); } void schedule_urgent(std::unique_ptr t) { engine().add_urgent_task(std::move(t)); } } // namespace base -} // namespace stonedb +} // namespace Tianmu bool operator==(const ::sockaddr_in a, const ::sockaddr_in b) { return (a.sin_addr.s_addr == b.sin_addr.s_addr) && (a.sin_port == b.sin_port); } -namespace stonedb { +namespace Tianmu { namespace base { void network_stack_registry::register_stack(sstring name, @@ -2301,7 +2301,7 @@ network_stack_registrator nsr_posix{ #ifndef NO_EXCEPTION_INTERCEPT //} -// namespace stonedb::base { +// namespace Tianmu::base { #endif reactor::sched_clock::duration reactor::total_idle_time() { return _total_idle; } @@ -2328,4 +2328,4 @@ future create_scheduling_group(sstring name, float shares) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/core/reactor.h b/storage/tianmu/base/core/reactor.h similarity index 99% rename from storage/stonedb/base/core/reactor.h rename to storage/tianmu/base/core/reactor.h index 78f00926e0..a059bb4947 100644 --- a/storage/stonedb/base/core/reactor.h +++ b/storage/tianmu/base/core/reactor.h @@ -19,8 +19,8 @@ * Copyright 2014 Cloudius Systems * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_REACTOR_H_ -#define STONEDB_BASE_REACTOR_H_ +#ifndef TIANMU_BASE_REACTOR_H_ +#define TIANMU_BASE_REACTOR_H_ #pragma once #include @@ -85,7 +85,7 @@ #include "base/net/api.h" #include "base/util/log.h" -namespace stonedb { +namespace Tianmu { namespace base { using shard_id = unsigned; @@ -162,7 +162,7 @@ class pollable_fd { std::unique_ptr _s; }; } // namespace base -} // namespace stonedb +} // namespace Tianmu namespace std { template <> @@ -173,7 +173,7 @@ struct hash<::sockaddr_in> { bool operator==(const ::sockaddr_in a, const ::sockaddr_in b); -namespace stonedb { +namespace Tianmu { namespace base { class network_stack_registrator { @@ -1372,6 +1372,6 @@ inline typename timer::time_point timer::get_timeout() { extern logger seastar_logger; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_REACTOR_H_ +#endif // TIANMU_BASE_REACTOR_H_ diff --git a/storage/stonedb/base/core/report_exception.h b/storage/tianmu/base/core/report_exception.h similarity index 85% rename from storage/stonedb/base/core/report_exception.h rename to storage/tianmu/base/core/report_exception.h index 7e1d074b55..5c1049191d 100644 --- a/storage/stonedb/base/core/report_exception.h +++ b/storage/tianmu/base/core/report_exception.h @@ -19,17 +19,17 @@ * Copyright 2014 Cloudius Systems * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_REPORT_EXCEPTION_H_ -#define STONEDB_BASE_REPORT_EXCEPTION_H_ +#ifndef TIANMU_BASE_REPORT_EXCEPTION_H_ +#define TIANMU_BASE_REPORT_EXCEPTION_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace base { void report_exception(std::experimental::string_view message, std::exception_ptr) noexcept; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_REPORT_EXCEPTION_H_ +#endif // TIANMU_BASE_REPORT_EXCEPTION_H_ diff --git a/storage/stonedb/base/core/resource.cpp b/storage/tianmu/base/core/resource.cpp similarity index 98% rename from storage/stonedb/base/core/resource.cpp rename to storage/tianmu/base/core/resource.cpp index e12387f2cb..80b37794fc 100644 --- a/storage/stonedb/base/core/resource.cpp +++ b/storage/tianmu/base/core/resource.cpp @@ -27,7 +27,7 @@ #include "base/core/align.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace resource { @@ -51,7 +51,7 @@ size_t calculate_memory(configuration c, size_t available_memory, float panic_fa } // namespace resource } // namespace base -} // namespace stonedb +} // namespace Tianmu #ifdef HAVE_HWLOC @@ -61,7 +61,7 @@ size_t calculate_memory(configuration c, size_t available_memory, float panic_fa #include "base/ecore/print.h" #include "base/util/defer.h" -namespace stonedb { +namespace Tianmu { namespace base { cpu_set_t cpuid_to_cpuset(unsigned cpuid) { @@ -302,14 +302,14 @@ unsigned nr_processing_units() { } // namespace resource } // namespace base -} // namespace stonedb +} // namespace Tianmu #else // HAVE_HWLOC #include #include "base/core/resource.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace resource { @@ -352,6 +352,6 @@ unsigned nr_processing_units() { return ::sysconf(_SC_NPROCESSORS_ONLN); } } // namespace resource } // namespace base -} // namespace stonedb +} // namespace Tianmu #endif // HAVE_HWLOC diff --git a/storage/stonedb/base/core/resource.h b/storage/tianmu/base/core/resource.h similarity index 93% rename from storage/stonedb/base/core/resource.h rename to storage/tianmu/base/core/resource.h index 9d7a4dfe90..0c5a98451c 100644 --- a/storage/stonedb/base/core/resource.h +++ b/storage/tianmu/base/core/resource.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_RESOURCE_H_ -#define STONEDB_BASE_RESOURCE_H_ +#ifndef TIANMU_BASE_RESOURCE_H_ +#define TIANMU_BASE_RESOURCE_H_ #pragma once #include @@ -31,7 +31,7 @@ #include #include -namespace stonedb { +namespace Tianmu { namespace base { cpu_set_t cpuid_to_cpuset(unsigned cpuid); @@ -83,6 +83,6 @@ unsigned nr_processing_units(); } // namespace resource } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_RESOURCE_H_ +#endif // TIANMU_BASE_RESOURCE_H_ diff --git a/storage/stonedb/base/core/rwlock.h b/storage/tianmu/base/core/rwlock.h similarity index 96% rename from storage/stonedb/base/core/rwlock.h rename to storage/tianmu/base/core/rwlock.h index 5359741653..1266d38e6e 100644 --- a/storage/stonedb/base/core/rwlock.h +++ b/storage/tianmu/base/core/rwlock.h @@ -19,13 +19,13 @@ * Copyright (C) 2015 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_RWLOCK_H_ -#define STONEDB_BASE_RWLOCK_H_ +#ifndef TIANMU_BASE_RWLOCK_H_ +#define TIANMU_BASE_RWLOCK_H_ #pragma once #include "base/core/semaphore.h" -namespace stonedb { +namespace Tianmu { namespace base { /// \cond internal @@ -126,6 +126,6 @@ inline void rwlock_for_write::unlock() { static_cast(this)->write_unlo /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_RWLOCK_H_ +#endif // TIANMU_BASE_RWLOCK_H_ diff --git a/storage/stonedb/base/core/scattered_message.h b/storage/tianmu/base/core/scattered_message.h similarity index 94% rename from storage/stonedb/base/core/scattered_message.h rename to storage/tianmu/base/core/scattered_message.h index 3432e3dc58..33fc44b0fc 100644 --- a/storage/stonedb/base/core/scattered_message.h +++ b/storage/tianmu/base/core/scattered_message.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SCATTERED_MESSAGE_H_ -#define STONEDB_BASE_SCATTERED_MESSAGE_H_ +#ifndef TIANMU_BASE_SCATTERED_MESSAGE_H_ +#define TIANMU_BASE_SCATTERED_MESSAGE_H_ #pragma once #include @@ -32,7 +32,7 @@ #include "base/core/temporary_buffer.h" #include "base/net/packet.h" -namespace stonedb { +namespace Tianmu { namespace base { template @@ -97,6 +97,6 @@ class scattered_message { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SCATTERED_MESSAGE_H_ +#endif // TIANMU_BASE_SCATTERED_MESSAGE_H_ diff --git a/storage/stonedb/base/core/scheduling.h b/storage/tianmu/base/core/scheduling.h similarity index 95% rename from storage/stonedb/base/core/scheduling.h rename to storage/tianmu/base/core/scheduling.h index 67e25f43ba..3e421a2cec 100644 --- a/storage/stonedb/base/core/scheduling.h +++ b/storage/tianmu/base/core/scheduling.h @@ -19,13 +19,13 @@ * Copyright (C) 2016 Scylla DB Ltd * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SCHEDULING_H_ -#define STONEDB_BASE_SCHEDULING_H_ +#ifndef TIANMU_BASE_SCHEDULING_H_ +#define TIANMU_BASE_SCHEDULING_H_ #pragma once #include "base/core/sstring.h" -namespace stonedb { +namespace Tianmu { namespace base { template @@ -98,6 +98,6 @@ inline scheduling_group default_scheduling_group() { return scheduling_group(); inline bool scheduling_group::active() const { return *this == current_scheduling_group(); } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SCHEDULING_H_ +#endif // TIANMU_BASE_SCHEDULING_H_ diff --git a/storage/stonedb/base/core/scollectd.cpp b/storage/tianmu/base/core/scollectd.cpp similarity index 99% rename from storage/stonedb/base/core/scollectd.cpp rename to storage/tianmu/base/core/scollectd.cpp index 78bf74058d..2e67d60786 100644 --- a/storage/stonedb/base/core/scollectd.cpp +++ b/storage/tianmu/base/core/scollectd.cpp @@ -34,7 +34,7 @@ #include "base/core/scollectd_api.h" #include "base/core/scollectd_impl.h" -namespace stonedb { +namespace Tianmu { namespace base { bool scollectd::type_instance_id::operator<(const scollectd::type_instance_id &id2) const { @@ -882,4 +882,4 @@ metrics::impl::value_map get_value_map() { return metrics::impl::get_value_map() } // namespace scollectd } // namespace base -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/core/scollectd.h b/storage/tianmu/base/core/scollectd.h similarity index 99% rename from storage/stonedb/base/core/scollectd.h rename to storage/tianmu/base/core/scollectd.h index dbe22719f5..10f4dc78bd 100644 --- a/storage/stonedb/base/core/scollectd.h +++ b/storage/tianmu/base/core/scollectd.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SCOLLECTD_H_ -#define STONEDB_BASE_SCOLLECTD_H_ +#ifndef TIANMU_BASE_SCOLLECTD_H_ +#define TIANMU_BASE_SCOLLECTD_H_ #pragma once #include @@ -43,7 +43,7 @@ #include "base/core/metrics_api.h" -namespace stonedb { +namespace Tianmu { namespace base { /** @@ -794,6 +794,6 @@ future<> send_notification(const type_instance_id &id, const sstring &msg); }; // namespace scollectd } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SCOLLECTD_H_ +#endif // TIANMU_BASE_SCOLLECTD_H_ diff --git a/storage/stonedb/base/core/scollectd_api.h b/storage/tianmu/base/core/scollectd_api.h similarity index 84% rename from storage/stonedb/base/core/scollectd_api.h rename to storage/tianmu/base/core/scollectd_api.h index 99a53d2a83..2d03dc51f1 100644 --- a/storage/stonedb/base/core/scollectd_api.h +++ b/storage/tianmu/base/core/scollectd_api.h @@ -2,14 +2,14 @@ * Copyright 2015 Cloudius Systems * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SCOLLECTD_API_H_ -#define STONEDB_BASE_SCOLLECTD_API_H_ +#ifndef TIANMU_BASE_SCOLLECTD_API_H_ +#define TIANMU_BASE_SCOLLECTD_API_H_ #pragma once #include "base/core/metrics_api.h" #include "base/core/scollectd.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace scollectd { @@ -33,6 +33,6 @@ metrics::impl::value_map get_value_map(); } // namespace scollectd } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SCOLLECTD_API_H_ +#endif // TIANMU_BASE_SCOLLECTD_API_H_ diff --git a/storage/stonedb/base/core/scollectd_impl.h b/storage/tianmu/base/core/scollectd_impl.h similarity index 94% rename from storage/stonedb/base/core/scollectd_impl.h rename to storage/tianmu/base/core/scollectd_impl.h index efc9f5b3dc..9c7bbd7d56 100644 --- a/storage/stonedb/base/core/scollectd_impl.h +++ b/storage/tianmu/base/core/scollectd_impl.h @@ -20,15 +20,15 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SCOLLECTD_IMPL_H_ -#define STONEDB_BASE_SCOLLECTD_IMPL_H_ +#ifndef TIANMU_BASE_SCOLLECTD_IMPL_H_ +#define TIANMU_BASE_SCOLLECTD_IMPL_H_ #pragma once #include "core/metrics_api.h" #include "core/reactor.h" #include "core/scollectd.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace scollectd { @@ -84,6 +84,6 @@ impl &get_impl(); } // namespace scollectd } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SCOLLECTD_IMPL_H_ +#endif // TIANMU_BASE_SCOLLECTD_IMPL_H_ diff --git a/storage/stonedb/base/core/seastar.h b/storage/tianmu/base/core/seastar.h similarity index 98% rename from storage/stonedb/base/core/seastar.h rename to storage/tianmu/base/core/seastar.h index 62b59217b6..034352af9a 100644 --- a/storage/stonedb/base/core/seastar.h +++ b/storage/tianmu/base/core/seastar.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SEASTAR_H_ -#define STONEDB_BASE_SEASTAR_H_ +#ifndef TIANMU_BASE_SEASTAR_H_ +#define TIANMU_BASE_SEASTAR_H_ #pragma once /// Seastar is a high performance C++ application framework for high @@ -44,7 +44,7 @@ #include "base/core/future.h" #include "base/core/sstring.h" -namespace stonedb { +namespace Tianmu { namespace base { template @@ -285,6 +285,6 @@ future file_system_at(sstring name); /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SEASTAR_H_ +#endif // TIANMU_BASE_SEASTAR_H_ diff --git a/storage/stonedb/base/core/semaphore.h b/storage/tianmu/base/core/semaphore.h similarity index 99% rename from storage/stonedb/base/core/semaphore.h rename to storage/tianmu/base/core/semaphore.h index 039f614b4f..b9eb69c278 100644 --- a/storage/stonedb/base/core/semaphore.h +++ b/storage/tianmu/base/core/semaphore.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SEMAPHORE_H_ -#define STONEDB_BASE_SEMAPHORE_H_ +#ifndef TIANMU_BASE_SEMAPHORE_H_ +#define TIANMU_BASE_SEMAPHORE_H_ #pragma once #include @@ -32,7 +32,7 @@ #include "base/core/future.h" #include "base/core/timer.h" -namespace stonedb { +namespace Tianmu { namespace base { /// \addtogroup fiber-module @@ -457,6 +457,6 @@ using semaphore = basic_semaphore; /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SEMAPHORE_H_ +#endif // TIANMU_BASE_SEMAPHORE_H_ diff --git a/storage/stonedb/base/core/sharded.h b/storage/tianmu/base/core/sharded.h similarity index 99% rename from storage/stonedb/base/core/sharded.h rename to storage/tianmu/base/core/sharded.h index aea2ba6dd1..9df6a3f237 100644 --- a/storage/stonedb/base/core/sharded.h +++ b/storage/tianmu/base/core/sharded.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SHARDED_H_ -#define STONEDB_BASE_SHARDED_H_ +#ifndef TIANMU_BASE_SHARDED_H_ +#define TIANMU_BASE_SHARDED_H_ #pragma once #include @@ -31,7 +31,7 @@ #include "base/core/reactor.h" #include "base/util/is_smart_ptr.h" -namespace stonedb { +namespace Tianmu { namespace base { template @@ -593,6 +593,6 @@ template struct is_smart_ptr> : std::true_type {}; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SHARDED_H_ +#endif // TIANMU_BASE_SHARDED_H_ diff --git a/storage/stonedb/base/core/shared_future.h b/storage/tianmu/base/core/shared_future.h similarity index 98% rename from storage/stonedb/base/core/shared_future.h rename to storage/tianmu/base/core/shared_future.h index 61bc27d666..4744e40079 100644 --- a/storage/stonedb/base/core/shared_future.h +++ b/storage/tianmu/base/core/shared_future.h @@ -21,8 +21,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SHARED_FUTURE_H_ -#define STONEDB_BASE_SHARED_FUTURE_H_ +#ifndef TIANMU_BASE_SHARED_FUTURE_H_ +#define TIANMU_BASE_SHARED_FUTURE_H_ #pragma once #include "base/core/expiring_fifo.h" @@ -31,7 +31,7 @@ /// \addtogroup future-module /// @{ -namespace stonedb { +namespace Tianmu { namespace base { /// Changes the clock used by shared_future<> and shared_promise<> when passed @@ -278,6 +278,6 @@ class shared_promise { /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SHARED_FUTURE_H_ +#endif // TIANMU_BASE_SHARED_FUTURE_H_ diff --git a/storage/stonedb/base/core/shared_mutex.h b/storage/tianmu/base/core/shared_mutex.h similarity index 97% rename from storage/stonedb/base/core/shared_mutex.h rename to storage/tianmu/base/core/shared_mutex.h index 7c24127f6b..abd43974f6 100644 --- a/storage/stonedb/base/core/shared_mutex.h +++ b/storage/tianmu/base/core/shared_mutex.h @@ -20,14 +20,14 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SHARED_MUTEX_H_ -#define STONEDB_BASE_SHARED_MUTEX_H_ +#ifndef TIANMU_BASE_SHARED_MUTEX_H_ +#define TIANMU_BASE_SHARED_MUTEX_H_ #pragma once #include "core/circular_buffer.h" #include "core/future.h" -namespace stonedb { +namespace Tianmu { namespace base { /// \addtogroup fiber-module @@ -157,6 +157,6 @@ inline futurize_t> with_lock(shared_mutex &sm, Func &&f /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SHARED_MUTEX_H_ +#endif // TIANMU_BASE_SHARED_MUTEX_H_ diff --git a/storage/stonedb/base/core/shared_ptr.h b/storage/tianmu/base/core/shared_ptr.h similarity index 97% rename from storage/stonedb/base/core/shared_ptr.h rename to storage/tianmu/base/core/shared_ptr.h index ce108af1d7..a8a442ebca 100644 --- a/storage/stonedb/base/core/shared_ptr.h +++ b/storage/tianmu/base/core/shared_ptr.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SHARED_PTR_H_ -#define STONEDB_BASE_SHARED_PTR_H_ +#ifndef TIANMU_BASE_SHARED_PTR_H_ +#define TIANMU_BASE_SHARED_PTR_H_ #pragma once #include @@ -32,7 +32,7 @@ #include "base/util/indirect.h" #include "base/util/is_smart_ptr.h" -namespace stonedb { +namespace Tianmu { namespace base { // This header defines two shared pointer facilities, lw_shared_ptr<> and @@ -687,21 +687,21 @@ template using shared_ptr_value_hash = indirect_hash>; } // namespace base -} // namespace stonedb +} // namespace Tianmu namespace std { template -struct hash> : private hash { - size_t operator()(const stonedb::base::lw_shared_ptr &p) const { return hash::operator()(p.get()); } +struct hash> : private hash { + size_t operator()(const Tianmu::base::lw_shared_ptr &p) const { return hash::operator()(p.get()); } }; template -struct hash> : private hash { - size_t operator()(const stonedb::base::shared_ptr &p) const { return hash::operator()(p.get()); } +struct hash> : private hash { + size_t operator()(const Tianmu::base::shared_ptr &p) const { return hash::operator()(p.get()); } }; } // namespace std -namespace stonedb { +namespace Tianmu { namespace base { template @@ -711,6 +711,6 @@ template struct is_smart_ptr> : std::true_type {}; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SHARED_PTR_H_ +#endif // TIANMU_BASE_SHARED_PTR_H_ diff --git a/storage/stonedb/base/core/shared_ptr_debug_helper.h b/storage/tianmu/base/core/shared_ptr_debug_helper.h similarity index 90% rename from storage/stonedb/base/core/shared_ptr_debug_helper.h rename to storage/tianmu/base/core/shared_ptr_debug_helper.h index 0bb27c7282..81bc866a95 100644 --- a/storage/stonedb/base/core/shared_ptr_debug_helper.h +++ b/storage/tianmu/base/core/shared_ptr_debug_helper.h @@ -19,8 +19,8 @@ * Copyright (C) 2015 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SHARED_PTR_DEBUG_HELPER_H_ -#define STONEDB_BASE_SHARED_PTR_DEBUG_HELPER_H_ +#ifndef TIANMU_BASE_SHARED_PTR_DEBUG_HELPER_H_ +#define TIANMU_BASE_SHARED_PTR_DEBUG_HELPER_H_ #ifdef DEBUG_SHARED_PTR #pragma once @@ -28,7 +28,7 @@ #include #include -namespace stonedb { +namespace Tianmu { namespace base { // A counter that is only comfortable being incremented on the cpu @@ -68,7 +68,7 @@ class debug_shared_ptr_counter_type { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu #endif // DEBUG_SHARED_PTR -#endif // STONEDB_BASE_SHARED_PTR_DEBUG_HELPER_H_ +#endif // TIANMU_BASE_SHARED_PTR_DEBUG_HELPER_H_ diff --git a/storage/stonedb/base/core/shared_ptr_incomplete.h b/storage/tianmu/base/core/shared_ptr_incomplete.h similarity index 88% rename from storage/stonedb/base/core/shared_ptr_incomplete.h rename to storage/tianmu/base/core/shared_ptr_incomplete.h index b36d94dde8..341a48e916 100644 --- a/storage/stonedb/base/core/shared_ptr_incomplete.h +++ b/storage/tianmu/base/core/shared_ptr_incomplete.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SHARED_PTR_INCOMPLETE_H_ -#define STONEDB_BASE_SHARED_PTR_INCOMPLETE_H_ +#ifndef TIANMU_BASE_SHARED_PTR_INCOMPLETE_H_ +#define TIANMU_BASE_SHARED_PTR_INCOMPLETE_H_ #pragma once #include "base/core/shared_ptr.h" @@ -30,7 +30,7 @@ /// lw_shared_ptr, at the point where \c /// some_incomplete_type is defined. -namespace stonedb { +namespace Tianmu { namespace base { namespace internal { @@ -43,6 +43,6 @@ T *lw_shared_ptr_accessors{})>>::to_ } // namespace internal } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SHARED_PTR_INCOMPLETE_H_ +#endif // TIANMU_BASE_SHARED_PTR_INCOMPLETE_H_ diff --git a/storage/stonedb/base/core/simple_stream.h b/storage/tianmu/base/core/simple_stream.h similarity index 99% rename from storage/stonedb/base/core/simple_stream.h rename to storage/tianmu/base/core/simple_stream.h index b1f4c0bc4a..b0c3208ca8 100644 --- a/storage/stonedb/base/core/simple_stream.h +++ b/storage/tianmu/base/core/simple_stream.h @@ -20,13 +20,13 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SIMPLE_STREAM_H_ -#define STONEDB_BASE_SIMPLE_STREAM_H_ +#ifndef TIANMU_BASE_SIMPLE_STREAM_H_ +#define TIANMU_BASE_SIMPLE_STREAM_H_ #pragma once #include "base/core/sstring.h" -namespace stonedb { +namespace Tianmu { namespace base { class measuring_output_stream { @@ -497,6 +497,6 @@ using simple_input_stream = memory_input_stream::simple; using simple_output_stream = memory_output_stream::simple; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SIMPLE_STREAM_H_ +#endif // TIANMU_BASE_SIMPLE_STREAM_H_ diff --git a/storage/stonedb/base/core/sleep.h b/storage/tianmu/base/core/sleep.h similarity index 95% rename from storage/stonedb/base/core/sleep.h rename to storage/tianmu/base/core/sleep.h index 5306051051..3695a12b10 100644 --- a/storage/stonedb/base/core/sleep.h +++ b/storage/tianmu/base/core/sleep.h @@ -21,8 +21,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SLEEP_H_ -#define STONEDB_BASE_SLEEP_H_ +#ifndef TIANMU_BASE_SLEEP_H_ +#define TIANMU_BASE_SLEEP_H_ #pragma once #include @@ -32,7 +32,7 @@ #include "base/core/reactor.h" #include "base/core/shared_ptr.h" -namespace stonedb { +namespace Tianmu { namespace base { /// Returns a future which completes after a specified time has elapsed. @@ -76,6 +76,6 @@ future<> sleep_abortable(std::chrono::duration dur) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SLEEP_H_ +#endif // TIANMU_BASE_SLEEP_H_ diff --git a/storage/stonedb/base/core/sstring.h b/storage/tianmu/base/core/sstring.h similarity index 98% rename from storage/stonedb/base/core/sstring.h rename to storage/tianmu/base/core/sstring.h index b46d7997e4..78e5a9b62f 100644 --- a/storage/stonedb/base/core/sstring.h +++ b/storage/tianmu/base/core/sstring.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SSTRING_H_ -#define STONEDB_BASE_SSTRING_H_ +#ifndef TIANMU_BASE_SSTRING_H_ +#define TIANMU_BASE_SSTRING_H_ #pragma once #include @@ -39,7 +39,7 @@ #include #include "base/core/temporary_buffer.h" -namespace stonedb { +namespace Tianmu { namespace base { template @@ -625,18 +625,18 @@ inline std::basic_istream &operator>>(std::basic_istream } } // namespace base -} // namespace stonedb +} // namespace Tianmu namespace std { template -struct hash> { - size_t operator()(const stonedb::base::basic_sstring &s) const { +struct hash> { + size_t operator()(const Tianmu::base::basic_sstring &s) const { return std::hash>()(s); } }; } // namespace std -namespace stonedb { +namespace Tianmu { namespace base { static inline char *copy_str_to(char *dst) { return dst; } @@ -659,7 +659,7 @@ inline string_type to_sstring(T value) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu namespace std { template @@ -696,4 +696,4 @@ std::ostream &operator<<(std::ostream &os, const std::unordered_map @@ -29,7 +29,7 @@ #include #include "base/core/future.h" -namespace stonedb { +namespace Tianmu { namespace base { // A stream/subscription pair is similar to a promise/future pair, @@ -223,6 +223,6 @@ inline future<> subscription::done() { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_STREAM_H_ +#endif // TIANMU_BASE_STREAM_H_ diff --git a/storage/stonedb/base/core/systemwide_memory_barrier.cpp b/storage/tianmu/base/core/systemwide_memory_barrier.cpp similarity index 97% rename from storage/stonedb/base/core/systemwide_memory_barrier.cpp rename to storage/tianmu/base/core/systemwide_memory_barrier.cpp index 1ff39b81ab..840c1023f4 100644 --- a/storage/stonedb/base/core/systemwide_memory_barrier.cpp +++ b/storage/tianmu/base/core/systemwide_memory_barrier.cpp @@ -26,7 +26,7 @@ #include #include -namespace stonedb { +namespace Tianmu { namespace base { // cause all threads to invoke a full memory barrier @@ -50,4 +50,4 @@ void systemwide_memory_barrier() { } } // namespace base -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/core/systemwide_memory_barrier.h b/storage/tianmu/base/core/systemwide_memory_barrier.h similarity index 83% rename from storage/stonedb/base/core/systemwide_memory_barrier.h rename to storage/tianmu/base/core/systemwide_memory_barrier.h index 0f22b6302c..062f71eae6 100644 --- a/storage/stonedb/base/core/systemwide_memory_barrier.h +++ b/storage/tianmu/base/core/systemwide_memory_barrier.h @@ -20,17 +20,17 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SYSTEMWIDE_MEMORY_BARRIER_H_ -#define STONEDB_BASE_SYSTEMWIDE_MEMORY_BARRIER_H_ +#ifndef TIANMU_BASE_SYSTEMWIDE_MEMORY_BARRIER_H_ +#define TIANMU_BASE_SYSTEMWIDE_MEMORY_BARRIER_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace base { // cause all threads to invoke a full memory barrier void systemwide_memory_barrier(); } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SYSTEMWIDE_MEMORY_BARRIER_H_ +#endif // TIANMU_BASE_SYSTEMWIDE_MEMORY_BARRIER_H_ diff --git a/storage/stonedb/base/core/task.h b/storage/tianmu/base/core/task.h similarity index 93% rename from storage/stonedb/base/core/task.h rename to storage/tianmu/base/core/task.h index 3bb70d5e33..9f38214085 100644 --- a/storage/stonedb/base/core/task.h +++ b/storage/tianmu/base/core/task.h @@ -19,15 +19,15 @@ * Copyright (C) 2015 Cloudius Systems, Ltd. */ -#ifndef STONEDB_BASE_TASK_H_ -#define STONEDB_BASE_TASK_H_ +#ifndef TIANMU_BASE_TASK_H_ +#define TIANMU_BASE_TASK_H_ #pragma once #include #include "base/core/scheduling.h" -namespace stonedb { +namespace Tianmu { namespace base { class task { @@ -64,6 +64,6 @@ inline std::unique_ptr make_task(scheduling_group sg, Func &&func) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_TASK_H_ +#endif // TIANMU_BASE_TASK_H_ diff --git a/storage/stonedb/base/core/temporary_buffer.h b/storage/tianmu/base/core/temporary_buffer.h similarity index 98% rename from storage/stonedb/base/core/temporary_buffer.h rename to storage/tianmu/base/core/temporary_buffer.h index eb8e69add2..e337bc00de 100644 --- a/storage/stonedb/base/core/temporary_buffer.h +++ b/storage/tianmu/base/core/temporary_buffer.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. */ -#ifndef STONEDB_BASE_TEMPORARY_BUFFER_H_ -#define STONEDB_BASE_TEMPORARY_BUFFER_H_ +#ifndef TIANMU_BASE_TEMPORARY_BUFFER_H_ +#define TIANMU_BASE_TEMPORARY_BUFFER_H_ #pragma once #include @@ -28,7 +28,7 @@ #include "base/core/deleter.h" -namespace stonedb { +namespace Tianmu { namespace base { /// Temporary, self-managed byte buffer. @@ -216,6 +216,6 @@ class temporary_buffer { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_TEMPORARY_BUFFER_H_ +#endif // TIANMU_BASE_TEMPORARY_BUFFER_H_ diff --git a/storage/stonedb/base/core/thread.cpp b/storage/tianmu/base/core/thread.cpp similarity index 99% rename from storage/stonedb/base/core/thread.cpp rename to storage/tianmu/base/core/thread.cpp index bc91d093da..27dd92d8c2 100644 --- a/storage/stonedb/base/core/thread.cpp +++ b/storage/tianmu/base/core/thread.cpp @@ -28,7 +28,7 @@ #include "base/core/posix.h" -namespace stonedb { +namespace Tianmu { namespace base { thread_local jmp_buf_link g_unthreaded_context; @@ -334,4 +334,4 @@ stdx::optional thread_scheduling_group::next_schedulin } } // namespace base -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/core/thread.h b/storage/tianmu/base/core/thread.h similarity index 98% rename from storage/stonedb/base/core/thread.h rename to storage/tianmu/base/core/thread.h index 1f523407b4..7a0f0367e4 100644 --- a/storage/stonedb/base/core/thread.h +++ b/storage/tianmu/base/core/thread.h @@ -21,8 +21,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_THREAD_H_ -#define STONEDB_BASE_THREAD_H_ +#ifndef TIANMU_BASE_THREAD_H_ +#define TIANMU_BASE_THREAD_H_ #pragma once #include @@ -71,7 +71,7 @@ /// The result is returned as a future, so that non-threaded code can wait for /// the thread to terminate and yield a result. -namespace stonedb { +namespace Tianmu { namespace base { namespace stdx = std::experimental; @@ -336,6 +336,6 @@ inline futurize_t(std::decay_t...)>> a } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_THREAD_H_ +#endif // TIANMU_BASE_THREAD_H_ diff --git a/storage/stonedb/base/core/thread_impl.h b/storage/tianmu/base/core/thread_impl.h similarity index 93% rename from storage/stonedb/base/core/thread_impl.h rename to storage/tianmu/base/core/thread_impl.h index c3cbea6d87..2057bfb539 100644 --- a/storage/stonedb/base/core/thread_impl.h +++ b/storage/tianmu/base/core/thread_impl.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_THREAD_IMPL_H_ -#define STONEDB_BASE_THREAD_IMPL_H_ +#ifndef TIANMU_BASE_THREAD_IMPL_H_ +#define TIANMU_BASE_THREAD_IMPL_H_ #pragma once #include @@ -31,7 +31,7 @@ #include "base/core/preempt.h" -namespace stonedb { +namespace Tianmu { namespace base { /// Clock used for scheduling threads @@ -86,6 +86,6 @@ void init(); } // namespace thread_impl } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_THREAD_IMPL_H_ +#endif // TIANMU_BASE_THREAD_IMPL_H_ diff --git a/storage/stonedb/base/core/timer.h b/storage/tianmu/base/core/timer.h similarity index 94% rename from storage/stonedb/base/core/timer.h rename to storage/tianmu/base/core/timer.h index 56c4160648..76f63d483a 100644 --- a/storage/stonedb/base/core/timer.h +++ b/storage/tianmu/base/core/timer.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_TIMER_H_ -#define STONEDB_BASE_TIMER_H_ +#ifndef TIANMU_BASE_TIMER_H_ +#define TIANMU_BASE_TIMER_H_ #pragma once #include @@ -32,7 +32,7 @@ #include "base/core/future.h" #include "base/core/timer_set.h" -namespace stonedb { +namespace Tianmu { namespace base { using steady_clock_type = std::chrono::steady_clock; @@ -85,6 +85,6 @@ class timer { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_TIMER_H_ +#endif // TIANMU_BASE_TIMER_H_ diff --git a/storage/stonedb/base/core/timer_set.h b/storage/tianmu/base/core/timer_set.h similarity index 97% rename from storage/stonedb/base/core/timer_set.h rename to storage/tianmu/base/core/timer_set.h index edd3a104ba..f420fa0477 100644 --- a/storage/stonedb/base/core/timer_set.h +++ b/storage/tianmu/base/core/timer_set.h @@ -11,8 +11,8 @@ * BSD license as described in the LICENSE file in the top-level directory. */ -#ifndef STONEDB_BASE_TIMER_SET_H_ -#define STONEDB_BASE_TIMER_SET_H_ +#ifndef TIANMU_BASE_TIMER_SET_H_ +#define TIANMU_BASE_TIMER_SET_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "base/core/bitset_iter.h" -namespace stonedb { +namespace Tianmu { namespace base { /** @@ -232,6 +232,6 @@ class timer_set { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_TIMER_SET_H_ +#endif // TIANMU_BASE_TIMER_SET_H_ diff --git a/storage/stonedb/base/core/transfer.h b/storage/tianmu/base/core/transfer.h similarity index 94% rename from storage/stonedb/base/core/transfer.h rename to storage/tianmu/base/core/transfer.h index b3f15b7891..dcc38b6aa1 100644 --- a/storage/stonedb/base/core/transfer.h +++ b/storage/tianmu/base/core/transfer.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_TRANSFER_H_ -#define STONEDB_BASE_TRANSFER_H_ +#ifndef TIANMU_BASE_TRANSFER_H_ +#define TIANMU_BASE_TRANSFER_H_ #pragma once // Helper functions for copying or moving multiple objects in an exception @@ -40,7 +40,7 @@ #include #include -namespace stonedb { +namespace Tianmu { namespace base { template @@ -67,6 +67,6 @@ inline void transfer_pass2(Alloc &a, T *from, T *to, } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_TRANSFER_H_ +#endif // TIANMU_BASE_TRANSFER_H_ diff --git a/storage/stonedb/base/core/unaligned.h b/storage/tianmu/base/core/unaligned.h similarity index 95% rename from storage/stonedb/base/core/unaligned.h rename to storage/tianmu/base/core/unaligned.h index 4b08475aaf..5b312a4923 100644 --- a/storage/stonedb/base/core/unaligned.h +++ b/storage/tianmu/base/core/unaligned.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_UNALIGNED_H_ -#define STONEDB_BASE_UNALIGNED_H_ +#ifndef TIANMU_BASE_UNALIGNED_H_ +#define TIANMU_BASE_UNALIGNED_H_ #pragma once // The following unaligned_cast(p) is a portable replacement for @@ -49,7 +49,7 @@ // cause the sanitizer not to generate runtime alignment checks for this // access. -namespace stonedb { +namespace Tianmu { namespace base { template @@ -77,6 +77,6 @@ inline auto unaligned_cast(const F *p) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_UNALIGINED_H_ +#endif // TIANMU_BASE_UNALIGINED_H_ diff --git a/storage/stonedb/base/core/vector_data_sink.h b/storage/tianmu/base/core/vector_data_sink.h similarity index 88% rename from storage/stonedb/base/core/vector_data_sink.h rename to storage/tianmu/base/core/vector_data_sink.h index f267897b59..43b2518bbc 100644 --- a/storage/stonedb/base/core/vector_data_sink.h +++ b/storage/tianmu/base/core/vector_data_sink.h @@ -20,13 +20,13 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_VECTOR_DATA_SINK_H_ -#define STONEDB_BASE_VECTOR_DATA_SINK_H_ +#ifndef TIANMU_BASE_VECTOR_DATA_SINK_H_ +#define TIANMU_BASE_VECTOR_DATA_SINK_H_ #pragma once #include "base/core/reactor.h" -namespace stonedb { +namespace Tianmu { namespace base { class vector_data_sink final : public data_sink_impl { @@ -51,6 +51,6 @@ class vector_data_sink final : public data_sink_impl { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_VECTOR_DATA_SINK_H_ +#endif // TIANMU_BASE_VECTOR_DATA_SINK_H_ diff --git a/storage/stonedb/base/core/vla.h b/storage/tianmu/base/core/vla.h similarity index 93% rename from storage/stonedb/base/core/vla.h rename to storage/tianmu/base/core/vla.h index b010c9c214..1285118f68 100644 --- a/storage/stonedb/base/core/vla.h +++ b/storage/tianmu/base/core/vla.h @@ -20,8 +20,8 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_VLA_H_ -#define STONEDB_BASE_VLA_H_ +#ifndef TIANMU_BASE_VLA_H_ +#define TIANMU_BASE_VLA_H_ #pragma once #include @@ -31,7 +31,7 @@ #include "base/core/reactor.h" -namespace stonedb { +namespace Tianmu { namespace base { // Some C APIs have a structure with a variable length array at the end. @@ -60,6 +60,6 @@ inline std::unique_ptr make_struct_with_vla(E S::*last, size_t } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_VLA_H_ +#endif // TIANMU_BASE_VLA_H_ diff --git a/storage/stonedb/base/core/weak_ptr.h b/storage/tianmu/base/core/weak_ptr.h similarity index 95% rename from storage/stonedb/base/core/weak_ptr.h rename to storage/tianmu/base/core/weak_ptr.h index fbc0683294..c1d6d2b2eb 100644 --- a/storage/stonedb/base/core/weak_ptr.h +++ b/storage/tianmu/base/core/weak_ptr.h @@ -20,13 +20,13 @@ * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_WEAK_PTR_H_ -#define STONEDB_BASE_WEAK_PTR_H_ +#ifndef TIANMU_BASE_WEAK_PTR_H_ +#define TIANMU_BASE_WEAK_PTR_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace base { template @@ -104,6 +104,6 @@ class weakly_referencable { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_WEAK_PTR_H_ +#endif // TIANMU_BASE_WEAK_PTR_H_ diff --git a/storage/stonedb/base/fmt/container.h b/storage/tianmu/base/fmt/container.h similarity index 92% rename from storage/stonedb/base/fmt/container.h rename to storage/tianmu/base/fmt/container.h index c582a645a3..90ca4b3820 100644 --- a/storage/stonedb/base/fmt/container.h +++ b/storage/tianmu/base/fmt/container.h @@ -8,13 +8,13 @@ Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_CONTAINER_H_ -#define STONEDB_BASE_CONTAINER_H_ +#ifndef TIANMU_BASE_CONTAINER_H_ +#define TIANMU_BASE_CONTAINER_H_ #pragma once #include "fmt/format.h" -namespace stonedb { +namespace Tianmu { namespace fmt { namespace internal { @@ -77,6 +77,6 @@ class BasicContainerWriter : public BasicWriter }; } // namespace fmt -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_CONTAINER_H_ +#endif // TIANMU_BASE_CONTAINER_H_ diff --git a/storage/stonedb/base/fmt/format.cpp b/storage/tianmu/base/fmt/format.cpp similarity index 98% rename from storage/stonedb/base/fmt/format.cpp rename to storage/tianmu/base/fmt/format.cpp index 9ce1602f0b..320b65700d 100644 --- a/storage/stonedb/base/fmt/format.cpp +++ b/storage/tianmu/base/fmt/format.cpp @@ -73,12 +73,12 @@ // Dummy implementations of strerror_r and strerror_s called if corresponding // system functions are not available. -static inline stonedb::fmt::internal::Null<> strerror_r(int, char *, ...) { return stonedb::fmt::internal::Null<>(); } -static inline stonedb::fmt::internal::Null<> strerror_s(char *, std::size_t, ...) { - return stonedb::fmt::internal::Null<>(); +static inline Tianmu::fmt::internal::Null<> strerror_r(int, char *, ...) { return Tianmu::fmt::internal::Null<>(); } +static inline Tianmu::fmt::internal::Null<> strerror_s(char *, std::size_t, ...) { + return Tianmu::fmt::internal::Null<>(); } -namespace stonedb { +namespace Tianmu { namespace fmt { FMT_FUNC internal::RuntimeError::~RuntimeError() FMT_DTOR_NOEXCEPT {} @@ -484,7 +484,7 @@ template FMT_API int internal::CharTraits::format_float(wchar_t *buffer #endif // FMT_HEADER_ONLY } // namespace fmt -} // namespace stonedb +} // namespace Tianmu #ifdef _MSC_VER #pragma warning(pop) diff --git a/storage/stonedb/base/fmt/format.h b/storage/tianmu/base/fmt/format.h similarity index 99% rename from storage/stonedb/base/fmt/format.h rename to storage/tianmu/base/fmt/format.h index 51fa3c5f58..3bfc739d5a 100644 --- a/storage/stonedb/base/fmt/format.h +++ b/storage/tianmu/base/fmt/format.h @@ -26,8 +26,8 @@ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STONEDB_BASE_FORMAT_H_ -#define STONEDB_BASE_FORMAT_H_ +#ifndef TIANMU_BASE_FORMAT_H_ +#define TIANMU_BASE_FORMAT_H_ #pragma once #include @@ -302,7 +302,7 @@ using intmax_t = __int64; // if the clz and clzll builtins are not available. #if FMT_MSC_VER && !defined(FMT_BUILTIN_CLZLL) && !defined(_MANAGED) #include // _BitScanReverse, _BitScanReverse64 -namespace stonedb { +namespace Tianmu { namespace fmt { namespace internal { @@ -347,10 +347,10 @@ inline uint32_t clzll(uint64_t x) { } // namespace internal } // namespace fmt -} // namespace stonedb +} // namespace Tianmu #endif // FMT_MSC_VER && !defined(FMT_BUILTIN_CLZLL) && !defined(_MANAGED) -namespace stonedb { +namespace Tianmu { namespace fmt { namespace internal { @@ -378,7 +378,7 @@ inline T const_check(T value) { } // namespace internal } // namespace fmt -} // namespace stonedb +} // namespace Tianmu namespace std { // Standard permits specialization of std::numeric_limits. This specialization @@ -386,14 +386,14 @@ namespace std { // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48891 // and the same for isnan and signbit. template <> -class numeric_limits : public std::numeric_limits { +class numeric_limits : public std::numeric_limits { public: // Portable version of isinf. template static bool isinfinity(T x) { - using namespace stonedb::fmt::internal; + using namespace Tianmu::fmt::internal; // The resolution "priority" is: - // isinf macro > std::isinf > ::isinf > stonedb::fmt::internal::isinf + // isinf macro > std::isinf > ::isinf > Tianmu::fmt::internal::isinf if (const_check(sizeof(isinf(x)) == sizeof(bool) || sizeof(isinf(x)) == sizeof(int))) { return isinf(x) != 0; } @@ -403,7 +403,7 @@ class numeric_limits : public std::numeric_lim // Portable version of isnan. template static bool isnotanumber(T x) { - using namespace stonedb::fmt::internal; + using namespace Tianmu::fmt::internal; if (const_check(sizeof(isnan(x)) == sizeof(bool) || sizeof(isnan(x)) == sizeof(int))) { return isnan(x) != 0; } @@ -412,7 +412,7 @@ class numeric_limits : public std::numeric_lim // Portable version of signbit. static bool isnegative(double x) { - using namespace stonedb::fmt::internal; + using namespace Tianmu::fmt::internal; if (const_check(sizeof(signbit(x)) == sizeof(bool) || sizeof(signbit(x)) == sizeof(int))) { return signbit(x) != 0; } @@ -426,7 +426,7 @@ class numeric_limits : public std::numeric_lim }; } // namespace std -namespace stonedb { +namespace Tianmu { namespace fmt { // Fix the warning about long long on older versions of GCC @@ -3328,7 +3328,7 @@ template void arg(WStringRef, const internal::NamedArg &) FMT_DELETED_OR_UNDEFINED; } // namespace fmt -} // namespace stonedb +} // namespace Tianmu #if FMT_GCC_VERSION // Use the system_header pragma to suppress warnings about variadic macros @@ -3448,7 +3448,7 @@ void arg(WStringRef, const internal::NamedArg &) FMT_DELETED_OR_UNDEFINED; #define FMT_CAPTURE_W(...) FMT_FOR_EACH(FMT_CAPTURE_ARG_W_, __VA_ARGS__) -namespace stonedb { +namespace Tianmu { namespace fmt { FMT_VARIADIC(std::string, format, CStringRef) @@ -3763,10 +3763,10 @@ void format_arg(fmt::BasicFormatter &f, const Char *&format_ format_str = end + 1; } } // namespace fmt -} // namespace stonedb +} // namespace Tianmu #if FMT_USE_USER_DEFINED_LITERALS -namespace stonedb { +namespace Tianmu { namespace fmt { namespace internal { @@ -3821,7 +3821,7 @@ inline internal::UdlArg operator"" _a(const wchar_t *s, std::size_t) { } // namespace literals } // namespace fmt -} // namespace stonedb +} // namespace Tianmu #endif // FMT_USE_USER_DEFINED_LITERALS // Restore warnings. @@ -3840,4 +3840,4 @@ inline internal::UdlArg operator"" _a(const wchar_t *s, std::size_t) { #define FMT_FUNC #endif -#endif // STONEDB_BASE_FORMAT_H_ +#endif // TIANMU_BASE_FORMAT_H_ diff --git a/storage/stonedb/base/fmt/ostream.cpp b/storage/tianmu/base/fmt/ostream.cpp similarity index 95% rename from storage/stonedb/base/fmt/ostream.cpp rename to storage/tianmu/base/fmt/ostream.cpp index 616057da3b..21ecda33fc 100644 --- a/storage/stonedb/base/fmt/ostream.cpp +++ b/storage/tianmu/base/fmt/ostream.cpp @@ -11,7 +11,7 @@ #include "ostream.h" -namespace stonedb { +namespace Tianmu { namespace fmt { namespace internal { @@ -36,4 +36,4 @@ FMT_FUNC void print(std::ostream &os, CStringRef format_str, ArgList args) { } } // namespace fmt -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/fmt/ostream.h b/storage/tianmu/base/fmt/ostream.h similarity index 95% rename from storage/stonedb/base/fmt/ostream.h rename to storage/tianmu/base/fmt/ostream.h index 4a7c7b9b0a..841af2ac94 100644 --- a/storage/stonedb/base/fmt/ostream.h +++ b/storage/tianmu/base/fmt/ostream.h @@ -8,15 +8,15 @@ For the license information refer to format.h. */ -#ifndef STONEDB_BASE_OSTREAM_H_ -#define STONEDB_BASE_OSTREAM_H_ +#ifndef TIANMU_BASE_OSTREAM_H_ +#define TIANMU_BASE_OSTREAM_H_ #pragma once #include "base/fmt/format.h" #include -namespace stonedb { +namespace Tianmu { namespace fmt { namespace internal { @@ -96,10 +96,10 @@ void format_arg(BasicFormatter &f, const Char *&format_str, FMT_API void print(std::ostream &os, CStringRef format_str, ArgList args); FMT_VARIADIC(void, print, std::ostream &, CStringRef) } // namespace fmt -} // namespace stonedb +} // namespace Tianmu #ifdef FMT_HEADER_ONLY #include "ostream.cc" #endif -#endif // STONEDB_BASE_OSTREAM_H_ +#endif // TIANMU_BASE_OSTREAM_H_ diff --git a/storage/stonedb/base/fmt/posix.cpp b/storage/tianmu/base/fmt/posix.cpp similarity index 99% rename from storage/stonedb/base/fmt/posix.cpp rename to storage/tianmu/base/fmt/posix.cpp index bb56440712..c48d5789d2 100644 --- a/storage/stonedb/base/fmt/posix.cpp +++ b/storage/tianmu/base/fmt/posix.cpp @@ -51,7 +51,7 @@ #undef fileno #endif -namespace stonedb { +namespace Tianmu { namespace fmt { namespace { // unnamed @@ -227,4 +227,4 @@ long getpagesize() { } } // namespace fmt -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/fmt/posix.h b/storage/tianmu/base/fmt/posix.h similarity index 98% rename from storage/stonedb/base/fmt/posix.h rename to storage/tianmu/base/fmt/posix.h index b9cbfcfa2f..8d76dc5c45 100644 --- a/storage/stonedb/base/fmt/posix.h +++ b/storage/tianmu/base/fmt/posix.h @@ -8,8 +8,8 @@ For the license information refer to format.h. */ -#ifndef STONEDB_BASE_POSIX_H_ -#define STONEDB_BASE_POSIX_H_ +#ifndef TIANMU_BASE_POSIX_H_ +#define TIANMU_BASE_POSIX_H_ #pragma once #if defined(__MINGW32__) || defined(__CYGWIN__) @@ -66,7 +66,7 @@ #define FMT_RETRY(result, expression) FMT_RETRY_VAL(result, expression, -1) -namespace stonedb { +namespace Tianmu { namespace fmt { class ErrorCode { @@ -342,7 +342,7 @@ class Locale { #endif // FMT_LOCALE } // namespace fmt -} // namespace stonedb +} // namespace Tianmu #if !FMT_USE_RVALUE_REFERENCES namespace std { @@ -352,4 +352,4 @@ inline fmt::File &move(fmt::File &f) { return f; } } // namespace std #endif -#endif // STONEDB_BASE_POSIX_H_ +#endif // TIANMU_BASE_POSIX_H_ diff --git a/storage/stonedb/base/fmt/printf.cpp b/storage/tianmu/base/fmt/printf.cpp similarity index 94% rename from storage/stonedb/base/fmt/printf.cpp rename to storage/tianmu/base/fmt/printf.cpp index 0361337d2c..f64a2799a7 100644 --- a/storage/stonedb/base/fmt/printf.cpp +++ b/storage/tianmu/base/fmt/printf.cpp @@ -13,7 +13,7 @@ #include "base/fmt/format.h" -namespace stonedb { +namespace Tianmu { namespace fmt { template @@ -34,4 +34,4 @@ template void PrintfFormatter::format(WCStringRef format); #endif // FMT_HEADER_ONLY } // namespace fmt -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/fmt/printf.h b/storage/tianmu/base/fmt/printf.h similarity index 99% rename from storage/stonedb/base/fmt/printf.h rename to storage/tianmu/base/fmt/printf.h index bf090bfd79..da161e9532 100644 --- a/storage/stonedb/base/fmt/printf.h +++ b/storage/tianmu/base/fmt/printf.h @@ -8,8 +8,8 @@ For the license information refer to format.h. */ -#ifndef STONEDB_BASE_PRINTF_H_ -#define STONEDB_BASE_PRINTF_H_ +#ifndef TIANMU_BASE_PRINTF_H_ +#define TIANMU_BASE_PRINTF_H_ #pragma once #include // std::fill_n @@ -17,7 +17,7 @@ #include "base/fmt/ostream.h" -namespace stonedb { +namespace Tianmu { namespace fmt { namespace internal { @@ -572,10 +572,10 @@ inline int fprintf(std::ostream &os, CStringRef format_str, ArgList args) { FMT_VARIADIC(int, fprintf, std::ostream &, CStringRef) } // namespace fmt -} // namespace stonedb +} // namespace Tianmu #ifdef FMT_HEADER_ONLY #include "printf.cc" #endif -#endif // STONEDB_BASE_PRINTF_H_ +#endif // TIANMU_BASE_PRINTF_H_ diff --git a/storage/stonedb/base/fmt/string.h b/storage/tianmu/base/fmt/string.h similarity index 95% rename from storage/stonedb/base/fmt/string.h rename to storage/tianmu/base/fmt/string.h index 0c690571a8..e1a3906b13 100644 --- a/storage/stonedb/base/fmt/string.h +++ b/storage/tianmu/base/fmt/string.h @@ -8,13 +8,13 @@ For the license information refer to format.h. */ -#ifndef STONEDB_BASE_STRING_H_ -#define STONEDB_BASE_STRING_H_ +#ifndef TIANMU_BASE_STRING_H_ +#define TIANMU_BASE_STRING_H_ #pragma once #include "base/fmt/format.h" -namespace stonedb { +namespace Tianmu { namespace fmt { namespace internal { @@ -122,6 +122,6 @@ std::string to_string(const T &value) { } } // namespace fmt -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_STRING_H_ +#endif // TIANMU_BASE_STRING_H_ diff --git a/storage/stonedb/base/fmt/time.h b/storage/tianmu/base/fmt/time.h similarity index 96% rename from storage/stonedb/base/fmt/time.h rename to storage/tianmu/base/fmt/time.h index c5b0b8b7aa..35cce5e231 100644 --- a/storage/stonedb/base/fmt/time.h +++ b/storage/tianmu/base/fmt/time.h @@ -8,15 +8,15 @@ For the license information refer to format.h. */ -#ifndef STONEDB_BASE_TIME_H_ -#define STONEDB_BASE_TIME_H_ +#ifndef TIANMU_BASE_TIME_H_ +#define TIANMU_BASE_TIME_H_ #pragma once #include #include "base/fmt/format.h" -namespace stonedb { +namespace Tianmu { namespace fmt { template @@ -129,6 +129,6 @@ inline std::tm gmtime(std::time_t time) { } } // namespace fmt -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_TIME_H_ +#endif // TIANMU_BASE_TIME_H_ diff --git a/storage/stonedb/base/net/api.h b/storage/tianmu/base/net/api.h similarity index 98% rename from storage/stonedb/base/net/api.h rename to storage/tianmu/base/net/api.h index e0853897be..e731f412ab 100644 --- a/storage/stonedb/base/net/api.h +++ b/storage/tianmu/base/net/api.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_API_H_ -#define STONEDB_BASE_API_H_ +#ifndef TIANMU_BASE_API_H_ +#define TIANMU_BASE_API_H_ #pragma once #include @@ -37,7 +37,7 @@ #include "base/net/packet.h" #include "base/net/socket_defs.h" -namespace stonedb { +namespace Tianmu { namespace base { static inline bool is_ip_unspecified(ipv4_addr &addr) { return addr.ip == 0; } @@ -285,6 +285,6 @@ class network_stack { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_API_H_ +#endif // TIANMU_BASE_API_H_ diff --git a/storage/stonedb/base/net/byteorder.h b/storage/tianmu/base/net/byteorder.h similarity index 95% rename from storage/stonedb/base/net/byteorder.h rename to storage/tianmu/base/net/byteorder.h index 1bc2129308..2afa79efcb 100644 --- a/storage/stonedb/base/net/byteorder.h +++ b/storage/tianmu/base/net/byteorder.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_NET_BYTEORDER_H_ -#define STONEDB_BASE_NET_BYTEORDER_H_ +#ifndef TIANMU_BASE_NET_BYTEORDER_H_ +#define TIANMU_BASE_NET_BYTEORDER_H_ #pragma once #include // for ntohs() and friends @@ -29,7 +29,7 @@ #include "base/core/unaligned.h" -namespace stonedb { +namespace Tianmu { namespace base { inline uint64_t ntohq(uint64_t v) { @@ -124,6 +124,6 @@ inline T hton(const T &x) { } // namespace net } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_NET_BYTEORDER_H_ +#endif // TIANMU_BASE_NET_BYTEORDER_H_ diff --git a/storage/stonedb/base/net/const.h b/storage/tianmu/base/net/const.h similarity index 90% rename from storage/stonedb/base/net/const.h rename to storage/tianmu/base/net/const.h index 383bb817e8..3d16f9139f 100644 --- a/storage/stonedb/base/net/const.h +++ b/storage/tianmu/base/net/const.h @@ -18,11 +18,11 @@ /* * Copyright (C) 2014 Cloudius Systems, Ltd. */ -#ifndef STONEDB_BASE_CONST_H_ -#define STONEDB_BASE_CONST_H_ +#ifndef TIANMU_BASE_CONST_H_ +#define TIANMU_BASE_CONST_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace base { namespace net { @@ -38,6 +38,6 @@ const uint16_t ip_packet_len_max = 65535; } // namespace net } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_CONST_H_ +#endif // TIANMU_BASE_CONST_H_ diff --git a/storage/stonedb/base/net/native_stack_impl.h b/storage/tianmu/base/net/native_stack_impl.h similarity index 97% rename from storage/stonedb/base/net/native_stack_impl.h rename to storage/tianmu/base/net/native_stack_impl.h index b8d2f4cf7b..120ae50079 100644 --- a/storage/stonedb/base/net/native_stack_impl.h +++ b/storage/tianmu/base/net/native_stack_impl.h @@ -19,18 +19,18 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_NATIVE_STACK_IMPL_H_ -#define STONEDB_BASE_NATIVE_STACK_IMPL_H_ +#ifndef TIANMU_BASE_NATIVE_STACK_IMPL_H_ +#define TIANMU_BASE_NATIVE_STACK_IMPL_H_ #pragma once #include "base/core/reactor.h" #include "base/net/stack.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace net { -using namespace stonedb::base; +using namespace Tianmu::base; template class native_server_socket_impl; @@ -223,6 +223,6 @@ keepalive_params native_connected_socket_impl::get_keepalive_parameter } // namespace net } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_NATIVE_STACK_IMPL_H_ +#endif // TIANMU_BASE_NATIVE_STACK_IMPL_H_ diff --git a/storage/stonedb/base/net/packet.cpp b/storage/tianmu/base/net/packet.cpp similarity index 98% rename from storage/stonedb/base/net/packet.cpp rename to storage/tianmu/base/net/packet.cpp index 8d3f073ccf..69108325ef 100644 --- a/storage/stonedb/base/net/packet.cpp +++ b/storage/tianmu/base/net/packet.cpp @@ -27,7 +27,7 @@ #include #include "base/core/reactor.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace net { @@ -122,4 +122,4 @@ std::ostream &operator<<(std::ostream &os, const packet &p) { } // namespace net } // namespace base -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/net/packet.h b/storage/tianmu/base/net/packet.h similarity index 99% rename from storage/stonedb/base/net/packet.h rename to storage/tianmu/base/net/packet.h index 91e4d5dbbd..80fa4f8b4c 100644 --- a/storage/stonedb/base/net/packet.h +++ b/storage/tianmu/base/net/packet.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_PACKET_H_ -#define STONEDB_BASE_PACKET_H_ +#ifndef TIANMU_BASE_PACKET_H_ +#define TIANMU_BASE_PACKET_H_ #pragma once #include @@ -34,7 +34,7 @@ #include "base/core/temporary_buffer.h" #include "base/net/const.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace net { @@ -546,6 +546,6 @@ inline packet packet::share(size_t offset, size_t len) { } // namespace net } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_PACKET_H_ +#endif // TIANMU_BASE_PACKET_H_ diff --git a/storage/stonedb/base/net/packet_data_source.h b/storage/tianmu/base/net/packet_data_source.h similarity index 90% rename from storage/stonedb/base/net/packet_data_source.h rename to storage/tianmu/base/net/packet_data_source.h index e1d37f256f..30d277c5ad 100644 --- a/storage/stonedb/base/net/packet_data_source.h +++ b/storage/tianmu/base/net/packet_data_source.h @@ -15,14 +15,14 @@ * specific language governing permissions and limitations * under the License. */ -#ifndef STONEDB_BASE_PACKET_DATA_SOURCE_H_ -#define STONEDB_BASE_PACKET_DATA_SOURCE_H_ +#ifndef TIANMU_BASE_PACKET_DATA_SOURCE_H_ +#define TIANMU_BASE_PACKET_DATA_SOURCE_H_ #pragma once #include "base/core/reactor.h" #include "base/net/packet.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace net { @@ -49,6 +49,6 @@ static inline input_stream as_input_stream(packet &&p) { } // namespace net } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_PACKET_DATA_SOURCE_H_ +#endif // TIANMU_BASE_PACKET_DATA_SOURCE_H_ diff --git a/storage/stonedb/base/net/packet_util.h b/storage/tianmu/base/net/packet_util.h similarity index 96% rename from storage/stonedb/base/net/packet_util.h rename to storage/tianmu/base/net/packet_util.h index a0f6110cb4..18c4f0d5e0 100644 --- a/storage/stonedb/base/net/packet_util.h +++ b/storage/tianmu/base/net/packet_util.h @@ -19,8 +19,8 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_PACKET_UTIL_H_ -#define STONEDB_BASE_PACKET_UTIL_H_ +#ifndef TIANMU_BASE_PACKET_UTIL_H_ +#define TIANMU_BASE_PACKET_UTIL_H_ #pragma once #include @@ -28,7 +28,7 @@ #include "base/net/packet.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace net { @@ -157,6 +157,6 @@ class packet_merger { } // namespace net } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_PACKET_UTIL_H_ +#endif // TIANMU_BASE_PACKET_UTIL_H_ diff --git a/storage/stonedb/base/net/posix_stack.cpp b/storage/tianmu/base/net/posix_stack.cpp similarity index 99% rename from storage/stonedb/base/net/posix_stack.cpp rename to storage/tianmu/base/net/posix_stack.cpp index 4228688bde..d43a5be428 100644 --- a/storage/stonedb/base/net/posix_stack.cpp +++ b/storage/tianmu/base/net/posix_stack.cpp @@ -29,11 +29,11 @@ #include "common/compile_opts.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace net { -using namespace stonedb::base; +using namespace Tianmu::base; template class posix_connected_socket_operations; @@ -443,7 +443,7 @@ class posix_udp_channel : public udp_channel_impl { future<> posix_udp_channel::send(ipv4_addr dst, const char *message) { auto len = strlen(message); - return _fd->sendto(make_ipv4_address(dst), message, len).then([len](size_t size STONEDB_UNUSED) { + return _fd->sendto(make_ipv4_address(dst), message, len).then([len](size_t size TIANMU_UNUSED) { assert(size == len); }); } @@ -492,4 +492,4 @@ future posix_udp_channel::receive() { } // namespace net } // namespace base -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/net/posix_stack.h b/storage/tianmu/base/net/posix_stack.h similarity index 96% rename from storage/stonedb/base/net/posix_stack.h rename to storage/tianmu/base/net/posix_stack.h index fd30b039bb..d18414d2a6 100644 --- a/storage/stonedb/base/net/posix_stack.h +++ b/storage/tianmu/base/net/posix_stack.h @@ -18,19 +18,19 @@ /* * Copyright (C) 2014 Cloudius Systems, Ltd. */ -#ifndef STONEDB_BASE_POSIX_STACK_H_ -#define STONEDB_BASE_POSIX_STACK_H_ +#ifndef TIANMU_BASE_POSIX_STACK_H_ +#define TIANMU_BASE_POSIX_STACK_H_ #pragma once #include "base/core/reactor.h" #include "base/core/sharded.h" #include "base/net/stack.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace net { -using namespace stonedb::base; +using namespace Tianmu::base; // We can't keep this in any of the socket servers as instance members, because // a connection can outlive the socket server. To avoid having the whole @@ -171,7 +171,7 @@ class posix_network_stack : public network_stack { public: posix_network_stack() : _reuseport(engine().posix_reuseport_available()) {} virtual server_socket listen(socket_address sa, listen_options opts) override; - virtual stonedb::base::socket socket() override; + virtual Tianmu::base::socket socket() override; virtual net::udp_channel make_udp_channel(ipv4_addr addr) override; static future> create() { return make_ready_future>(std::unique_ptr(new posix_network_stack())); @@ -194,6 +194,6 @@ class posix_ap_network_stack : public posix_network_stack { } // namespace net } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_POSIX_STACK_H_ +#endif // TIANMU_BASE_POSIX_STACK_H_ diff --git a/storage/stonedb/base/net/socket_defs.h b/storage/tianmu/base/net/socket_defs.h similarity index 94% rename from storage/stonedb/base/net/socket_defs.h rename to storage/tianmu/base/net/socket_defs.h index c7920b1e16..6cf1cf8576 100644 --- a/storage/stonedb/base/net/socket_defs.h +++ b/storage/tianmu/base/net/socket_defs.h @@ -19,8 +19,8 @@ * Copyright (C) 2016 ScyllaDB. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_SOCKET_DEFS_H_ -#define STONEDB_BASE_SOCKET_DEFS_H_ +#ifndef TIANMU_BASE_SOCKET_DEFS_H_ +#define TIANMU_BASE_SOCKET_DEFS_H_ #pragma once #include @@ -32,7 +32,7 @@ #include "base/net/byteorder.h" -namespace stonedb { +namespace Tianmu { namespace base { struct ipv4_addr; @@ -106,6 +106,6 @@ struct ipv4_addr { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SOCKET_DEFS_H_ +#endif // TIANMU_BASE_SOCKET_DEFS_H_ diff --git a/storage/stonedb/base/net/stack.cpp b/storage/tianmu/base/net/stack.cpp similarity index 99% rename from storage/stonedb/base/net/stack.cpp rename to storage/tianmu/base/net/stack.cpp index e8c3bf0ca6..264813963e 100644 --- a/storage/stonedb/base/net/stack.cpp +++ b/storage/tianmu/base/net/stack.cpp @@ -24,7 +24,7 @@ #include "base/core/reactor.h" -namespace stonedb { +namespace Tianmu { namespace base { net::udp_channel::udp_channel() {} @@ -117,4 +117,4 @@ bool socket_address::operator==(const socket_address &a) const { } } // namespace base -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/net/stack.h b/storage/tianmu/base/net/stack.h similarity index 94% rename from storage/stonedb/base/net/stack.h rename to storage/tianmu/base/net/stack.h index 156f81c5e7..b5f7037ab0 100644 --- a/storage/stonedb/base/net/stack.h +++ b/storage/tianmu/base/net/stack.h @@ -18,8 +18,8 @@ /* * Copyright 2015 Cloudius Systems */ -#ifndef STONEDB_BASE_STACK_H_ -#define STONEDB_BASE_STACK_H_ +#ifndef TIANMU_BASE_STACK_H_ +#define TIANMU_BASE_STACK_H_ #pragma once #include @@ -30,7 +30,7 @@ #define SO_REUSEPORT 0x0200 #endif -namespace stonedb { +namespace Tianmu { namespace base { namespace net { @@ -76,6 +76,6 @@ class udp_channel_impl { } // namespace net } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_STACK_H_ +#endif // TIANMU_BASE_STACK_H_ diff --git a/storage/stonedb/base/util/bool_class.h b/storage/tianmu/base/util/bool_class.h similarity index 95% rename from storage/stonedb/base/util/bool_class.h rename to storage/tianmu/base/util/bool_class.h index 7664b18b01..d67d3a9b4b 100644 --- a/storage/stonedb/base/util/bool_class.h +++ b/storage/tianmu/base/util/bool_class.h @@ -19,13 +19,13 @@ * Copyright (C) 2016 ScyllaDB. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_BOOL_CLASS_H_ -#define STONEDB_BASE_BOOL_CLASS_H_ +#ifndef TIANMU_BASE_BOOL_CLASS_H_ +#define TIANMU_BASE_BOOL_CLASS_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace base { /// \addtogroup utilities @@ -99,6 +99,6 @@ const bool_class bool_class::no{false}; /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_BOOL_CLASS_H_ +#endif // TIANMU_BASE_BOOL_CLASS_H_ diff --git a/storage/stonedb/base/util/conversions.cpp b/storage/tianmu/base/util/conversions.cpp similarity index 97% rename from storage/stonedb/base/util/conversions.cpp rename to storage/tianmu/base/util/conversions.cpp index 61dc532989..186daeab8e 100644 --- a/storage/stonedb/base/util/conversions.cpp +++ b/storage/tianmu/base/util/conversions.cpp @@ -29,7 +29,7 @@ #include "base/core/print.h" -namespace stonedb { +namespace Tianmu { namespace base { size_t parse_memory_size(std::string s) { @@ -48,6 +48,6 @@ size_t parse_memory_size(std::string s) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu #endif /* CONVERSIONS_CC_ */ diff --git a/storage/stonedb/base/util/conversions.h b/storage/tianmu/base/util/conversions.h similarity index 90% rename from storage/stonedb/base/util/conversions.h rename to storage/tianmu/base/util/conversions.h index 6522e3a7a8..d0f4e01e26 100644 --- a/storage/stonedb/base/util/conversions.h +++ b/storage/tianmu/base/util/conversions.h @@ -19,15 +19,15 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_CONVERSIONS_H_ -#define STONEDB_BASE_CONVERSIONS_H_ +#ifndef TIANMU_BASE_CONVERSIONS_H_ +#define TIANMU_BASE_CONVERSIONS_H_ #pragma once #include #include #include -namespace stonedb { +namespace Tianmu { namespace base { // Convert a string to a memory size, allowing binary SI @@ -49,6 +49,6 @@ static inline std::vector string2vector(std::string str) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_CONVERSIONS_H_ +#endif // TIANMU_BASE_CONVERSIONS_H_ diff --git a/storage/stonedb/base/util/defer.h b/storage/tianmu/base/util/defer.h similarity index 92% rename from storage/stonedb/base/util/defer.h rename to storage/tianmu/base/util/defer.h index 2120fe8859..2c05b6261f 100644 --- a/storage/stonedb/base/util/defer.h +++ b/storage/tianmu/base/util/defer.h @@ -19,11 +19,11 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_DEFER_H_ -#define STONEDB_BASE_DEFER_H_ +#ifndef TIANMU_BASE_DEFER_H_ +#define TIANMU_BASE_DEFER_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace base { template @@ -59,6 +59,6 @@ inline deferred_action defer(Func &&func) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_DEFER_H_ +#endif // TIANMU_BASE_DEFER_H_ diff --git a/storage/stonedb/base/util/function_input_iterator.h b/storage/tianmu/base/util/function_input_iterator.h similarity index 92% rename from storage/stonedb/base/util/function_input_iterator.h rename to storage/tianmu/base/util/function_input_iterator.h index 04a8859424..8291f5d67c 100644 --- a/storage/stonedb/base/util/function_input_iterator.h +++ b/storage/tianmu/base/util/function_input_iterator.h @@ -19,11 +19,11 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_FUNCTION_INPUT_ITERATOR_H_ -#define STONEDB_BASE_FUNCTION_INPUT_ITERATOR_H_ +#ifndef TIANMU_BASE_FUNCTION_INPUT_ITERATOR_H_ +#define TIANMU_BASE_FUNCTION_INPUT_ITERATOR_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace base { template @@ -62,6 +62,6 @@ inline function_input_iterator make_function_input_iterator(Fun } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_FUNCTION_INPUT_ITERATOR_H_ +#endif // TIANMU_BASE_FUNCTION_INPUT_ITERATOR_H_ diff --git a/storage/stonedb/base/util/gcc6-concepts.h b/storage/tianmu/base/util/gcc6-concepts.h similarity index 89% rename from storage/stonedb/base/util/gcc6-concepts.h rename to storage/tianmu/base/util/gcc6-concepts.h index a6f4aa3ab4..abe4ec0618 100644 --- a/storage/stonedb/base/util/gcc6-concepts.h +++ b/storage/tianmu/base/util/gcc6-concepts.h @@ -19,8 +19,8 @@ * Copyright (C) 2016 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_GCC6_CONCEPTS_H_ -#define STONEDB_BASE_GCC6_CONCEPTS_H_ +#ifndef TIANMU_BASE_GCC6_CONCEPTS_H_ +#define TIANMU_BASE_GCC6_CONCEPTS_H_ #pragma once #ifndef HAVE_GCC6_CONCEPTS @@ -35,4 +35,4 @@ #endif -#endif // STONEDB_BASE_GCC6_CONCEPTS_H_ +#endif // TIANMU_BASE_GCC6_CONCEPTS_H_ diff --git a/storage/stonedb/base/util/indirect.h b/storage/tianmu/base/util/indirect.h similarity index 94% rename from storage/stonedb/base/util/indirect.h rename to storage/tianmu/base/util/indirect.h index 71a9238d7e..2d1901f867 100644 --- a/storage/stonedb/base/util/indirect.h +++ b/storage/tianmu/base/util/indirect.h @@ -19,13 +19,13 @@ * Copyright (C) 2016 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_INDIRECT_H_ -#define STONEDB_BASE_INDIRECT_H_ +#ifndef TIANMU_BASE_INDIRECT_H_ +#define TIANMU_BASE_INDIRECT_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace base { // This header defines functors for comparing and hashing pointers by pointed-to @@ -78,6 +78,6 @@ struct indirect_hash { }; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_INDIRECT_H_ +#endif // TIANMU_BASE_INDIRECT_H_ diff --git a/storage/stonedb/base/util/is_smart_ptr.h b/storage/tianmu/base/util/is_smart_ptr.h similarity index 86% rename from storage/stonedb/base/util/is_smart_ptr.h rename to storage/tianmu/base/util/is_smart_ptr.h index 74630c6a60..b54c1ad224 100644 --- a/storage/stonedb/base/util/is_smart_ptr.h +++ b/storage/tianmu/base/util/is_smart_ptr.h @@ -18,13 +18,13 @@ /* * Copyright (C) 2015 Cloudius Systems, Ltd. */ -#ifndef STONEDB_BASE_IS_SMART_PTR_H_ -#define STONEDB_BASE_IS_SMART_PTR_H_ +#ifndef TIANMU_BASE_IS_SMART_PTR_H_ +#define TIANMU_BASE_IS_SMART_PTR_H_ #pragma once #include // for std::unique_ptr -namespace stonedb { +namespace Tianmu { namespace base { template @@ -34,6 +34,6 @@ template struct is_smart_ptr> : std::true_type {}; } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_IS_SMART_PTR_H_ +#endif // TIANMU_BASE_IS_SMART_PTR_H_ diff --git a/storage/stonedb/base/util/lazy.h b/storage/tianmu/base/util/lazy.h similarity index 96% rename from storage/stonedb/base/util/lazy.h rename to storage/tianmu/base/util/lazy.h index bb15847e17..b14566f042 100644 --- a/storage/stonedb/base/util/lazy.h +++ b/storage/tianmu/base/util/lazy.h @@ -18,8 +18,8 @@ /* * Copyright (C) 2016 Cloudius Systems, Ltd. */ -#ifndef STONEDB_BASE_LAZY_H_ -#define STONEDB_BASE_LAZY_H_ +#ifndef TIANMU_BASE_LAZY_H_ +#define TIANMU_BASE_LAZY_H_ #pragma once #include @@ -27,7 +27,7 @@ /// \addtogroup logging /// @{ -namespace stonedb { +namespace Tianmu { namespace base { /// \brief This class is a wrapper for a lazy evaluation of a value. @@ -106,7 +106,7 @@ lazy_deref_wrapper lazy_deref(const T &p) { } } // namespace base -} // namespace stonedb +} // namespace Tianmu namespace std { @@ -154,4 +154,4 @@ ostream &operator<<(ostream &os, base::lazy_deref_wrapper ld) { } // namespace std /// @} -#endif // STONEDB_BASE_LAZY_H_ +#endif // TIANMU_BASE_LAZY_H_ diff --git a/storage/stonedb/base/util/log.cpp b/storage/tianmu/base/util/log.cpp similarity index 96% rename from storage/stonedb/base/util/log.cpp rename to storage/tianmu/base/util/log.cpp index 74f6307428..85c32283e9 100644 --- a/storage/stonedb/base/util/log.cpp +++ b/storage/tianmu/base/util/log.cpp @@ -44,7 +44,7 @@ using namespace std::chrono_literals; -namespace stonedb { +namespace Tianmu { namespace base { thread_local uint64_t logging_failures = 0; @@ -335,13 +335,13 @@ logging_settings create_default_logging_settings() { } // namespace log_cli } // namespace base -} // namespace stonedb +} // namespace Tianmu namespace boost { template <> -stonedb::base::log_level lexical_cast(const std::string &source) { +Tianmu::base::log_level lexical_cast(const std::string &source) { std::istringstream in(source); - stonedb::base::log_level level; + Tianmu::base::log_level level; if (!(in >> level)) { throw boost::bad_lexical_cast(); } @@ -360,7 +360,7 @@ std::ostream &operator<<(std::ostream &out, const std::exception_ptr &eptr) { } catch (...) { auto tp = abi::__cxa_current_exception_type(); if (tp) { - out << stonedb::base::pretty_type_name(*tp); + out << Tianmu::base::pretty_type_name(*tp); } else { // This case shouldn't happen... out << ""; @@ -380,11 +380,11 @@ std::ostream &operator<<(std::ostream &out, const std::exception_ptr &eptr) { } std::ostream &operator<<(std::ostream &out, const std::exception &e) { - return out << stonedb::base::pretty_type_name(typeid(e)) << " (" << e.what() << ")"; + return out << Tianmu::base::pretty_type_name(typeid(e)) << " (" << e.what() << ")"; } std::ostream &operator<<(std::ostream &out, const std::system_error &e) { - return out << stonedb::base::pretty_type_name(typeid(e)) << " (error " << e.code() << ", " << e.code().message() + return out << Tianmu::base::pretty_type_name(typeid(e)) << " (error " << e.code() << ", " << e.code().message() << ")"; } diff --git a/storage/stonedb/base/util/log.h b/storage/tianmu/base/util/log.h similarity index 97% rename from storage/stonedb/base/util/log.h rename to storage/tianmu/base/util/log.h index d365e38530..03c506ac02 100644 --- a/storage/stonedb/base/util/log.h +++ b/storage/tianmu/base/util/log.h @@ -19,8 +19,8 @@ * Copyright (C) 2015 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_LOG_H_ -#define STONEDB_BASE_LOG_H_ +#ifndef TIANMU_BASE_LOG_H_ +#define TIANMU_BASE_LOG_H_ #pragma once #include @@ -35,7 +35,7 @@ /// \addtogroup logging /// @{ -namespace stonedb { +namespace Tianmu { namespace base { /// \brief log level used with \see {logger} @@ -55,17 +55,17 @@ std::ostream &operator<<(std::ostream &out, log_level level); std::istream &operator>>(std::istream &in, log_level &level); } // namespace base -} // namespace stonedb +} // namespace Tianmu // Boost doesn't auto-deduce the existence of the streaming operators for some // reason namespace boost { template <> -stonedb::base::log_level lexical_cast(const std::string &source); +Tianmu::base::log_level lexical_cast(const std::string &source); } // namespace boost -namespace stonedb { +namespace Tianmu { namespace base { class logger; @@ -314,7 +314,7 @@ void logger::do_log(log_level level, const char *fmt, Args &&...args) { /// \endcond } // namespace base -} // namespace stonedb +} // namespace Tianmu // Pretty-printer for exceptions to be logged, e.g., std::current_exception(). namespace std { @@ -323,4 +323,4 @@ std::ostream &operator<<(std::ostream &, const std::exception &); std::ostream &operator<<(std::ostream &, const std::system_error &); } // namespace std -#endif // STONEDB_BASE_LOG_H_ +#endif // TIANMU_BASE_LOG_H_ diff --git a/storage/stonedb/base/util/log_cli.h b/storage/tianmu/base/util/log_cli.h similarity index 93% rename from storage/stonedb/base/util/log_cli.h rename to storage/tianmu/base/util/log_cli.h index 1a1447f5bf..5dd4a1ca47 100644 --- a/storage/stonedb/base/util/log_cli.h +++ b/storage/tianmu/base/util/log_cli.h @@ -19,8 +19,8 @@ * Copyright (C) 2017 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_LOG_CLI_H_ -#define STONEDB_BASE_LOG_CLI_H_ +#ifndef TIANMU_BASE_LOG_CLI_H_ +#define TIANMU_BASE_LOG_CLI_H_ #pragma once #include @@ -34,7 +34,7 @@ /// \addtogroup logging /// @{ -namespace stonedb { +namespace Tianmu { namespace base { /// \brief Configure application logging at run-time with program options. @@ -60,7 +60,7 @@ logging_settings create_default_logging_settings(); } // namespace log_cli } // namespace base -} // namespace stonedb +} // namespace Tianmu /// @} -#endif // STONEDB_BASE_LOG_CLI_H_ +#endif // TIANMU_BASE_LOG_CLI_H_ diff --git a/storage/stonedb/base/util/noncopyable_function.h b/storage/tianmu/base/util/noncopyable_function.h similarity index 97% rename from storage/stonedb/base/util/noncopyable_function.h rename to storage/tianmu/base/util/noncopyable_function.h index 7643305824..2ce39f618e 100644 --- a/storage/stonedb/base/util/noncopyable_function.h +++ b/storage/tianmu/base/util/noncopyable_function.h @@ -19,15 +19,15 @@ * Copyright (C) 2017 ScyllaDB Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_NONCOPYABLE_FUNCTION_H_ -#define STONEDB_BASE_NONCOPYABLE_FUNCTION_H_ +#ifndef TIANMU_BASE_NONCOPYABLE_FUNCTION_H_ +#define TIANMU_BASE_NONCOPYABLE_FUNCTION_H_ #pragma once #include #include #include -namespace stonedb { +namespace Tianmu { namespace base { template @@ -161,6 +161,6 @@ const typename noncopyable_function::vtable noncopyable_function::indirect_vtable_for::make_vtable(); } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_NONCOPYABLE_FUNCTION_H_ +#endif // TIANMU_BASE_NONCOPYABLE_FUNCTION_H_ diff --git a/storage/stonedb/base/util/print_safe.h b/storage/tianmu/base/util/print_safe.h similarity index 95% rename from storage/stonedb/base/util/print_safe.h rename to storage/tianmu/base/util/print_safe.h index 337cdeabce..a359351456 100644 --- a/storage/stonedb/base/util/print_safe.h +++ b/storage/tianmu/base/util/print_safe.h @@ -19,13 +19,13 @@ * Copyright 2016 ScyllaDB * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_PRINT_SAFE_H_ -#define STONEDB_BASE_PRINT_SAFE_H_ +#ifndef TIANMU_BASE_PRINT_SAFE_H_ +#define TIANMU_BASE_PRINT_SAFE_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace base { // @@ -111,6 +111,6 @@ void print_decimal_safe(Integral n) noexcept { } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_PRINT_SAFE_H_ +#endif // TIANMU_BASE_PRINT_SAFE_H_ diff --git a/storage/stonedb/base/util/program_options.cpp b/storage/tianmu/base/util/program_options.cpp similarity index 98% rename from storage/stonedb/base/util/program_options.cpp rename to storage/tianmu/base/util/program_options.cpp index 0c6810cf69..23b6370e93 100644 --- a/storage/stonedb/base/util/program_options.cpp +++ b/storage/tianmu/base/util/program_options.cpp @@ -27,7 +27,7 @@ merged. #include -namespace stonedb { +namespace Tianmu { namespace base { namespace program_options { @@ -84,4 +84,4 @@ std::istream &operator>>(std::istream &is, string_map &ss) { } // namespace program_options } // namespace base -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/base/util/program_options.h b/storage/tianmu/base/util/program_options.h similarity index 94% rename from storage/stonedb/base/util/program_options.h rename to storage/tianmu/base/util/program_options.h index 431701c074..16a65c2cac 100644 --- a/storage/stonedb/base/util/program_options.h +++ b/storage/tianmu/base/util/program_options.h @@ -18,8 +18,8 @@ /* * Copyright (C) 2017 ScyllaDB */ -#ifndef STONEDB_BASE_PROGRAM_OPTIONS_H_ -#define STONEDB_BASE_PROGRAM_OPTIONS_H_ +#ifndef TIANMU_BASE_PROGRAM_OPTIONS_H_ +#define TIANMU_BASE_PROGRAM_OPTIONS_H_ #pragma once #include @@ -30,7 +30,7 @@ #include "base/core/sstring.h" -namespace stonedb { +namespace Tianmu { namespace base { namespace program_options { @@ -93,6 +93,6 @@ std::ostream &operator<<(std::ostream &os, const string_map &); } // namespace program_options } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_PROGRAM_OPTIONS_H_ +#endif // TIANMU_BASE_PROGRAM_OPTIONS_H_ diff --git a/storage/stonedb/base/util/reference_wrapper.h b/storage/tianmu/base/util/reference_wrapper.h similarity index 93% rename from storage/stonedb/base/util/reference_wrapper.h rename to storage/tianmu/base/util/reference_wrapper.h index 97ad253208..af8f109fed 100644 --- a/storage/stonedb/base/util/reference_wrapper.h +++ b/storage/tianmu/base/util/reference_wrapper.h @@ -19,11 +19,11 @@ * Copyright (C) 2017 ScyllaDB Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_REFERENCE_WRAPPER_H_ -#define STONEDB_BASE_REFERENCE_WRAPPER_H_ +#ifndef TIANMU_BASE_REFERENCE_WRAPPER_H_ +#define TIANMU_BASE_REFERENCE_WRAPPER_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace base { /// \addtogroup utilities @@ -74,6 +74,6 @@ inline reference_wrapper cref(const T &object) noexcept { /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_REFERENCE_WRAPPER_H_ +#endif // TIANMU_BASE_REFERENCE_WRAPPER_H_ diff --git a/storage/stonedb/base/util/spinlock.h b/storage/tianmu/base/util/spinlock.h similarity index 91% rename from storage/stonedb/base/util/spinlock.h rename to storage/tianmu/base/util/spinlock.h index 4214628483..2b77f78cc7 100644 --- a/storage/stonedb/base/util/spinlock.h +++ b/storage/tianmu/base/util/spinlock.h @@ -18,8 +18,8 @@ /* * Copyright 2016 ScyllaDB */ -#ifndef STONEDB_BASE_SPINLOCK_H_ -#define STONEDB_BASE_SPINLOCK_H_ +#ifndef TIANMU_BASE_SPINLOCK_H_ +#define TIANMU_BASE_SPINLOCK_H_ #pragma once #include @@ -29,7 +29,7 @@ #include #endif -namespace stonedb { +namespace Tianmu { namespace base { namespace util { @@ -61,6 +61,6 @@ class spinlock { } // namespace util } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_SPINLOCK_H_ +#endif // TIANMU_BASE_SPINLOCK_H_ diff --git a/storage/stonedb/base/util/transform_iterator.h b/storage/tianmu/base/util/transform_iterator.h similarity index 90% rename from storage/stonedb/base/util/transform_iterator.h rename to storage/tianmu/base/util/transform_iterator.h index 573e67d692..15dce72be9 100644 --- a/storage/stonedb/base/util/transform_iterator.h +++ b/storage/tianmu/base/util/transform_iterator.h @@ -19,11 +19,11 @@ * Copyright (C) 2014 Cloudius Systems, Ltd. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_TRANSFORM_ITERATOR_H_ -#define STONEDB_BASE_TRANSFORM_ITERATOR_H_ +#ifndef TIANMU_BASE_TRANSFORM_ITERATOR_H_ +#define TIANMU_BASE_TRANSFORM_ITERATOR_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace base { template @@ -53,6 +53,6 @@ inline transform_iterator make_transform_iterator(Iterator i, Fu } } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_TRANSFORM_ITERATOR_H_ +#endif // TIANMU_BASE_TRANSFORM_ITERATOR_H_ diff --git a/storage/stonedb/base/util/tuple_utils.h b/storage/tianmu/base/util/tuple_utils.h similarity index 97% rename from storage/stonedb/base/util/tuple_utils.h rename to storage/tianmu/base/util/tuple_utils.h index b2542f92cd..1a92a61c36 100644 --- a/storage/stonedb/base/util/tuple_utils.h +++ b/storage/tianmu/base/util/tuple_utils.h @@ -19,14 +19,14 @@ * Copyright (C) 2017 ScyllaDB. * Copyright (c) 2022 StoneAtom, Inc. All rights reserved. */ -#ifndef STONEDB_BASE_TUPLE_UTILS_H_ -#define STONEDB_BASE_TUPLE_UTILS_H_ +#ifndef TIANMU_BASE_TUPLE_UTILS_H_ +#define TIANMU_BASE_TUPLE_UTILS_H_ #pragma once #include #include -namespace stonedb { +namespace Tianmu { namespace base { namespace internal { @@ -168,6 +168,6 @@ void tuple_for_each(std::tuple &&t, Function &&f) { /// @} } // namespace base -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_BASE_TUPLE_UTILS_H_ +#endif // TIANMU_BASE_TUPLE_UTILS_H_ diff --git a/storage/stonedb/common/assert.h b/storage/tianmu/common/assert.h similarity index 90% rename from storage/stonedb/common/assert.h rename to storage/tianmu/common/assert.h index 7aba245a0d..146464e7ba 100644 --- a/storage/stonedb/common/assert.h +++ b/storage/tianmu/common/assert.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMMON_ASSERT_H_ -#define STONEDB_COMMON_ASSERT_H_ +#ifndef TIANMU_COMMON_ASSERT_H_ +#define TIANMU_COMMON_ASSERT_H_ #pragma once #include #include "common/exception.h" -namespace stonedb { +namespace Tianmu { #define ASSERT_1(condition) \ do { \ @@ -40,7 +40,7 @@ namespace stonedb { #define GET_MACRO(_1, _2, NAME, ...) NAME #define ASSERT(...) GET_MACRO(__VA_ARGS__, ASSERT_2, ASSERT_1)(__VA_ARGS__) -#define STONEDB_ERROR(message) ASSERT(false, message) +#define TIANMU_ERROR(message) ASSERT(false, message) #ifdef DBUG_OFF #define DEBUG_ASSERT(condition) \ @@ -50,5 +50,5 @@ namespace stonedb { #define DEBUG_ASSERT(...) assert(__VA_ARGS__) #endif -} // namespace stonedb -#endif // STONEDB_COMMON_ASSERT_H_ +} // namespace Tianmu +#endif // TIANMU_COMMON_ASSERT_H_ diff --git a/storage/stonedb/common/common_definitions.cpp b/storage/tianmu/common/common_definitions.cpp similarity index 96% rename from storage/stonedb/common/common_definitions.cpp rename to storage/tianmu/common/common_definitions.cpp index 4057ee0591..fbdd1f713f 100644 --- a/storage/stonedb/common/common_definitions.cpp +++ b/storage/tianmu/common/common_definitions.cpp @@ -22,7 +22,7 @@ #include #include -namespace stonedb { +namespace Tianmu { namespace common { void PushWarning(THD *thd, Sql_condition::enum_severity_level level, uint code, const char *msg) { @@ -39,4 +39,4 @@ std::string TX_ID::ToString() const { } } // namespace common -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/common/common_definitions.h b/storage/tianmu/common/common_definitions.h similarity index 92% rename from storage/stonedb/common/common_definitions.h rename to storage/tianmu/common/common_definitions.h index 5745f10b05..ab3c3a095d 100644 --- a/storage/stonedb/common/common_definitions.h +++ b/storage/tianmu/common/common_definitions.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMMON_COMMON_DEFINITIONS_H_ -#define STONEDB_COMMON_COMMON_DEFINITIONS_H_ +#ifndef TIANMU_COMMON_COMMON_DEFINITIONS_H_ +#define TIANMU_COMMON_COMMON_DEFINITIONS_H_ #pragma once #include @@ -27,7 +27,7 @@ #include "common/defs.h" -namespace stonedb { +namespace Tianmu { constexpr size_t operator""_KB(unsigned long long v) { return 1024u * v; } @@ -86,17 +86,17 @@ constexpr char NULL_VALUE_C = -128; constexpr uint32_t NULL_VALUE_U = 0xFFFFFFFC; constexpr int64_t MAX_ROW_NUMBER = 0x00007FFFFFFFFFFFULL; // 2^47 - 1 -constexpr int64_t SDB_BIGINT_MAX = PLUS_INF_64; -constexpr int64_t SDB_BIGINT_MIN = NULL_VALUE_64; +constexpr int64_t TIANMU_BIGINT_MAX = PLUS_INF_64; +constexpr int64_t TIANMU_BIGINT_MIN = NULL_VALUE_64; #define NULL_VALUE_D (*(double *)("\x01\x00\x00\x00\x00\x00\x00\x80")) -#define SDB_INT_MIN (-2147483647) -#define SDB_MEDIUMINT_MAX ((1 << 23) - 1) -#define SDB_MEDIUMINT_MIN (-((1 << 23))) -#define SDB_TINYINT_MAX 127 -#define SDB_TINYINT_MIN (-128) -#define SDB_SMALLINT_MAX ((1 << 15) - 1) -#define SDB_SMALLINT_MIN (-(1 << 15)) +#define TIANMU_INT_MIN (-2147483647) +#define TIANMU_MEDIUMINT_MAX ((1 << 23) - 1) +#define TIANMU_MEDIUMINT_MIN (-((1 << 23))) +#define TIANMU_TINYINT_MAX 127 +#define TIANMU_TINYINT_MIN (-128) +#define TIANMU_SMALLINT_MAX ((1 << 15) - 1) +#define TIANMU_SMALLINT_MIN (-(1 << 15)) #define PACK_INVALID 0 #define FIELD_MAXLENGTH 65535 @@ -273,6 +273,6 @@ struct TX_ID final { const TX_ID MAX_XID = std::numeric_limits::max(); } // namespace common -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMMON_COMMON_DEFINITIONS_H_ +#endif // TIANMU_COMMON_COMMON_DEFINITIONS_H_ diff --git a/storage/stonedb/common/compile_opts.h b/storage/tianmu/common/compile_opts.h similarity index 84% rename from storage/stonedb/common/compile_opts.h rename to storage/tianmu/common/compile_opts.h index dfff1ba585..3b76dd4c34 100644 --- a/storage/stonedb/common/compile_opts.h +++ b/storage/tianmu/common/compile_opts.h @@ -15,10 +15,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMMON_COMPILE_OPTS_H_ +#ifndef TIANMU_COMMON_COMPILE_OPTS_H_ #pragma once -namespace stonedb { +namespace Tianmu { #ifdef __clang__ // in clang @@ -33,12 +33,12 @@ namespace stonedb { // C++0x features are only enabled when -std=c++0x or -std=gnu++0x are // passed on the command line, which in turn defines // __GXX_EXPERIMENTAL_CXX0X__. -#define STONEDB_UNUSED [[gnu::unused]] +#define TIANMU_UNUSED [[gnu::unused]] #elif __GNUC__ > 7 // support in c++17 -#define STONEDB__UNUSED [[maybe_unused]] +#define TIANMU__UNUSED [[maybe_unused]] #else -#define STONEDB_UNUSED __attribute__((unused)) +#define TIANMU_UNUSED __attribute__((unused)) #endif #elif _MSC_VER /*usually has the version number in _MSC_VER*/ @@ -47,6 +47,6 @@ namespace stonedb { #elif __MINGW32__ #endif -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMMON_COMPILE_OPTS_H_ +#endif // TIANMU_COMMON_COMPILE_OPTS_H_ diff --git a/storage/stonedb/common/data_format.cpp b/storage/tianmu/common/data_format.cpp similarity index 97% rename from storage/stonedb/common/data_format.cpp rename to storage/tianmu/common/data_format.cpp index c6fec4d641..a53fbdf8f1 100644 --- a/storage/stonedb/common/data_format.cpp +++ b/storage/tianmu/common/data_format.cpp @@ -24,7 +24,7 @@ #include "txt_data_format.h" -namespace stonedb { +namespace Tianmu { namespace common { int DataFormat::no_formats = 0; @@ -50,4 +50,4 @@ DataFormatPtr DataFormat::GetDataFormatbyEDF(EDF edf) { } } // namespace common -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/common/data_format.h b/storage/tianmu/common/data_format.h similarity index 92% rename from storage/stonedb/common/data_format.h rename to storage/tianmu/common/data_format.h index 000cad1bbc..8397914dc0 100644 --- a/storage/stonedb/common/data_format.h +++ b/storage/tianmu/common/data_format.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMMON_DATA_FORMAT_H_ -#define STONEDB_COMMON_DATA_FORMAT_H_ +#ifndef TIANMU_COMMON_DATA_FORMAT_H_ +#define TIANMU_COMMON_DATA_FORMAT_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "common/common_definitions.h" -namespace stonedb { +namespace Tianmu { namespace system { class IOParameters; @@ -73,6 +73,6 @@ class DataFormat { }; } // namespace common -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMMON_DATA_FORMAT_H_ +#endif // TIANMU_COMMON_DATA_FORMAT_H_ diff --git a/storage/stonedb/common/defs.h b/storage/tianmu/common/defs.h similarity index 89% rename from storage/stonedb/common/defs.h rename to storage/tianmu/common/defs.h index 7ba1520a09..bd3a9a6179 100644 --- a/storage/stonedb/common/defs.h +++ b/storage/tianmu/common/defs.h @@ -14,17 +14,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMMON_DEFS_H_ -#define STONEDB_COMMON_DEFS_H_ +#ifndef TIANMU_COMMON_DEFS_H_ +#define TIANMU_COMMON_DEFS_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace common { -constexpr uint32_t FILE_MAGIC = 0x42545348; // "STONEDBTB" -constexpr const char *STONEDB_EXT = ".stonedb"; +constexpr uint64_t FILE_MAGIC = 0x4254756d6e616954; // "TianmuTB" +constexpr const char *TIANMU_EXT = ".tianmu"; constexpr uint32_t TABLE_DATA_VERSION = 3; constexpr const char *TABLE_DESC_FILE = "TABLE_DESC"; @@ -56,6 +56,6 @@ using PACK_INDEX = uint32_t; constexpr PACK_INDEX INVALID_PACK_INDEX = -1; } // namespace common -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMMON_DEFS_H_ +#endif // TIANMU_COMMON_DEFS_H_ diff --git a/storage/stonedb/common/exception.cpp b/storage/tianmu/common/exception.cpp similarity index 92% rename from storage/stonedb/common/exception.cpp rename to storage/tianmu/common/exception.cpp index 49c97edb41..3e0d59f828 100644 --- a/storage/stonedb/common/exception.cpp +++ b/storage/tianmu/common/exception.cpp @@ -23,7 +23,7 @@ #include "util/log_ctl.h" #include "util/stack_trace.h" -namespace stonedb { +namespace Tianmu { namespace common { Exception::Exception(std::string const &msg) : std::runtime_error(msg) { @@ -38,7 +38,7 @@ Exception::Exception(std::string const &msg) : std::runtime_error(msg) { stack_trace += "\n"; } stack_trace += "STACK TRACE END\n"; - STONEDB_LOG(LogCtl_Level::WARN, "Exception: %s.\n%s", msg.c_str(), stack_trace.c_str()); + TIANMU_LOG(LogCtl_Level::WARN, "Exception: %s.\n%s", msg.c_str(), stack_trace.c_str()); } AssertException::AssertException(const char *cond, const char *file, int line, const std::string &msg) @@ -46,4 +46,4 @@ AssertException::AssertException(const char *cond, const char *file, int line, c std::to_string(line) + ", msg: [" + msg + "]") {} } // namespace common -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/common/exception.h b/storage/tianmu/common/exception.h similarity index 80% rename from storage/stonedb/common/exception.h rename to storage/tianmu/common/exception.h index 36f0de7e74..07be580aac 100644 --- a/storage/stonedb/common/exception.h +++ b/storage/tianmu/common/exception.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMMON_EXCEPTION_H_ -#define STONEDB_COMMON_EXCEPTION_H_ +#ifndef TIANMU_COMMON_EXCEPTION_H_ +#define TIANMU_COMMON_EXCEPTION_H_ #pragma once #include #include "common/common_definitions.h" -namespace stonedb { +namespace Tianmu { namespace common { enum class ErrorCode { @@ -57,19 +57,19 @@ static std::string error_messages[] = { "Killed.", }; -inline bool IsError(ErrorCode sdbrc) { return sdbrc == ErrorCode::FAILED; } -inline bool IsWarning(ErrorCode sdbrc) { - return sdbrc == ErrorCode::OUT_OF_RANGE || sdbrc == ErrorCode::VALUE_TRUNCATED; +inline bool IsError(ErrorCode tianmu_rc) { return tianmu_rc == ErrorCode::FAILED; } +inline bool IsWarning(ErrorCode tianmu_rc) { + return tianmu_rc == ErrorCode::OUT_OF_RANGE || tianmu_rc == ErrorCode::VALUE_TRUNCATED; } -class SDBError { +class TIANMUError { public: - SDBError(ErrorCode sdb_error_code = ErrorCode::SUCCESS) : ec(sdb_error_code) {} - SDBError(ErrorCode sdb_error_code, std::string message) : ec(sdb_error_code), message(message) {} - SDBError(const SDBError &sdbe) : ec(sdbe.ec), message(sdbe.message) {} + TIANMUError(ErrorCode tianmu_error_code = ErrorCode::SUCCESS) : ec(tianmu_error_code) {} + TIANMUError(ErrorCode tianmu_error_code, std::string message) : ec(tianmu_error_code), message(message) {} + TIANMUError(const TIANMUError &tianmu_e) : ec(tianmu_e.ec), message(tianmu_e.message) {} operator ErrorCode() { return ec; } ErrorCode GetErrorCode() { return ec; } - bool operator==(ErrorCode sdbec) { return sdbec == ec; } + bool operator==(ErrorCode tianmu_ec) { return tianmu_ec == ec; } const std::string &Message() { if (!message.empty()) return message; return error_messages[static_cast(ec)]; @@ -94,7 +94,7 @@ class Exception : public std::runtime_error { class InternalException : public Exception { public: InternalException(std::string const &msg) : Exception(msg) {} - InternalException(SDBError sdberror) : Exception(sdberror.Message()) {} + InternalException(TIANMUError tianmu_error) : Exception(tianmu_error.Message()) {} }; // the system lacks memory or cannot use disk cache @@ -154,7 +154,7 @@ class NotImplementedException : public Exception { class FileException : public Exception { public: FileException(std::string const &msg) : Exception(msg) {} - FileException(SDBError sdberror) : Exception(sdberror.Message()) {} + FileException(TIANMUError tianmu_error) : Exception(tianmu_error.Message()) {} }; // wrong format of import file @@ -177,21 +177,21 @@ class DataTypeConversionException : public Exception { DataTypeConversionException(std::string const &msg, int64_t val = NULL_VALUE_64, CT t = CT::UNK) : Exception(msg), value(val), type(t) {} - DataTypeConversionException(SDBError sdberror = ErrorCode::DATACONVERSION, int64_t val = NULL_VALUE_64, + DataTypeConversionException(TIANMUError tianmu_error = ErrorCode::DATACONVERSION, int64_t val = NULL_VALUE_64, CT t = CT::UNK) - : Exception(sdberror.Message()), value(val), type(t) {} + : Exception(tianmu_error.Message()), value(val), type(t) {} }; class UnsupportedDataTypeException : public Exception { public: UnsupportedDataTypeException(std::string const &msg) : Exception(msg) {} - UnsupportedDataTypeException(SDBError sdberror = ErrorCode::UNSUPPORTED_DATATYPE) : Exception(sdberror.Message()) {} + UnsupportedDataTypeException(TIANMUError tianmu_error = ErrorCode::UNSUPPORTED_DATATYPE) : Exception(tianmu_error.Message()) {} }; class NetStreamException : public Exception { public: NetStreamException(std::string const &msg) : Exception(msg) {} - NetStreamException(SDBError sdberror) : Exception(sdberror.Message()) {} + NetStreamException(TIANMUError tianmu_error) : Exception(tianmu_error.Message()) {} }; class AssertException : public Exception { @@ -212,6 +212,6 @@ class AutoIncException : public Exception { }; } // namespace common -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMMON_EXCEPTION_H_ +#endif // TIANMU_COMMON_EXCEPTION_H_ diff --git a/storage/stonedb/common/mysql_gate.cpp b/storage/tianmu/common/mysql_gate.cpp similarity index 97% rename from storage/stonedb/common/mysql_gate.cpp rename to storage/tianmu/common/mysql_gate.cpp index f0fb7a9b7c..a1b304b162 100644 --- a/storage/stonedb/common/mysql_gate.cpp +++ b/storage/tianmu/common/mysql_gate.cpp @@ -19,7 +19,7 @@ #include -namespace stonedb { +namespace Tianmu { namespace common { bool IsTimeStampZero(MYSQL_TIME &t) { @@ -51,4 +51,4 @@ void SetMySQLTHD(THD *thd) { } } // namespace common -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/common/mysql_gate.h b/storage/tianmu/common/mysql_gate.h similarity index 90% rename from storage/stonedb/common/mysql_gate.h rename to storage/tianmu/common/mysql_gate.h index 0b519d9357..54defd81e7 100644 --- a/storage/stonedb/common/mysql_gate.h +++ b/storage/tianmu/common/mysql_gate.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMMON_MYSQL_GATE_H_ -#define STONEDB_COMMON_MYSQL_GATE_H_ +#ifndef TIANMU_COMMON_MYSQL_GATE_H_ +#define TIANMU_COMMON_MYSQL_GATE_H_ #pragma once #include @@ -77,9 +77,9 @@ // TODO() using fields_t = std::vector; -my_time_t stonedb_sec_since_epoch(int year, int mon, int mday, int hour, int min, int sec); +my_time_t tianmu_sec_since_epoch(int year, int mon, int mday, int hour, int min, int sec); -namespace stonedb { +namespace Tianmu { namespace common { bool IsTimeStampZero(MYSQL_TIME &t); void GMTSec2GMTTime(MYSQL_TIME *tmp, my_time_t t); @@ -90,6 +90,6 @@ size_t strnxfrm(const DTCollation &collation, uchar *src, size_t src_len, const void SetMySQLTHD(THD *thd); } // namespace common -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMMON_MYSQL_GATE_H_ +#endif // TIANMU_COMMON_MYSQL_GATE_H_ diff --git a/storage/stonedb/common/sequence_generator.h b/storage/tianmu/common/sequence_generator.h similarity index 88% rename from storage/stonedb/common/sequence_generator.h rename to storage/tianmu/common/sequence_generator.h index 551bfc81e1..b2f070d810 100644 --- a/storage/stonedb/common/sequence_generator.h +++ b/storage/tianmu/common/sequence_generator.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMMON_SEQUENCE_GENERATOR_H_ -#define STONEDB_COMMON_SEQUENCE_GENERATOR_H_ +#ifndef TIANMU_COMMON_SEQUENCE_GENERATOR_H_ +#define TIANMU_COMMON_SEQUENCE_GENERATOR_H_ #pragma once #include #include -namespace stonedb { +namespace Tianmu { namespace common { class SequenceGenerator { @@ -42,6 +42,6 @@ class SequenceGenerator { }; } // namespace common -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMMON_SEQUENCE_GENERATOR_H_ +#endif // TIANMU_COMMON_SEQUENCE_GENERATOR_H_ diff --git a/storage/stonedb/common/txt_data_format.cpp b/storage/tianmu/common/txt_data_format.cpp similarity index 98% rename from storage/stonedb/common/txt_data_format.cpp rename to storage/tianmu/common/txt_data_format.cpp index 9c2d7188b0..e2cd231e43 100644 --- a/storage/stonedb/common/txt_data_format.cpp +++ b/storage/tianmu/common/txt_data_format.cpp @@ -22,7 +22,7 @@ #include "loader/parsing_strategy.h" #include "types/value_parser4txt.h" -namespace stonedb { +namespace Tianmu { namespace common { TxtDataFormat::TxtDataFormat() : DataFormat("EDF::TRI_UNKNOWN", EDF::TRI_UNKNOWN) {} @@ -82,4 +82,4 @@ uint TxtDataFormat::StaticExtrnalSize(CT attrt, uint precision, int scale, const } } // namespace common -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/common/txt_data_format.h b/storage/tianmu/common/txt_data_format.h similarity index 87% rename from storage/stonedb/common/txt_data_format.h rename to storage/tianmu/common/txt_data_format.h index 8daac46704..c32946f4c4 100644 --- a/storage/stonedb/common/txt_data_format.h +++ b/storage/tianmu/common/txt_data_format.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMMON_TXT_DATA_FORMAT_H_ -#define STONEDB_COMMON_TXT_DATA_FORMAT_H_ +#ifndef TIANMU_COMMON_TXT_DATA_FORMAT_H_ +#define TIANMU_COMMON_TXT_DATA_FORMAT_H_ #pragma once #include "common/data_format.h" -namespace stonedb { +namespace Tianmu { namespace common { class TxtDataFormat final : public DataFormat { @@ -34,6 +34,6 @@ class TxtDataFormat final : public DataFormat { }; } // namespace common -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMMON_TXT_DATA_FORMAT_H_ +#endif // TIANMU_COMMON_TXT_DATA_FORMAT_H_ diff --git a/storage/stonedb/compress/arith_coder.cpp b/storage/tianmu/compress/arith_coder.cpp similarity index 99% rename from storage/stonedb/compress/arith_coder.cpp rename to storage/tianmu/compress/arith_coder.cpp index 04c6c2d049..2fca691e6c 100644 --- a/storage/stonedb/compress/arith_coder.cpp +++ b/storage/tianmu/compress/arith_coder.cpp @@ -19,7 +19,7 @@ #include "common/assert.h" -namespace stonedb { +namespace Tianmu { namespace compress { void ArithCoder::InitCompress() { @@ -286,4 +286,4 @@ template CprsErr ArithCoder::EncodeUniform(BitStream *, short, short, uin template CprsErr ArithCoder::DecodeUniform(BitStream *, short &, short, uint); } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/arith_coder.h b/storage/tianmu/compress/arith_coder.h similarity index 95% rename from storage/stonedb/compress/arith_coder.h rename to storage/tianmu/compress/arith_coder.h index 0cd1e14739..aa07752754 100644 --- a/storage/stonedb/compress/arith_coder.h +++ b/storage/tianmu/compress/arith_coder.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_ARITH_CODER_H_ -#define STONEDB_COMPRESS_ARITH_CODER_H_ +#ifndef TIANMU_COMPRESS_ARITH_CODER_H_ +#define TIANMU_COMPRESS_ARITH_CODER_H_ #pragma once #include "compress/data_stream.h" #include "compress/defs.h" -namespace stonedb { +namespace Tianmu { namespace compress { // The functions in ArithCoder throw ErrBufOverrun() or return CprsErr::CPRS_ERR_BUF, @@ -103,6 +103,6 @@ class ArithCoder { }; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_ARITH_CODER_H_ +#endif // TIANMU_COMPRESS_ARITH_CODER_H_ diff --git a/storage/stonedb/compress/basic_data_filt.cpp b/storage/tianmu/compress/basic_data_filt.cpp similarity index 99% rename from storage/stonedb/compress/basic_data_filt.cpp rename to storage/tianmu/compress/basic_data_filt.cpp index 90cc426325..920863d561 100644 --- a/storage/stonedb/compress/basic_data_filt.cpp +++ b/storage/tianmu/compress/basic_data_filt.cpp @@ -21,7 +21,7 @@ #include "common/assert.h" -namespace stonedb { +namespace Tianmu { namespace compress { template @@ -374,4 +374,4 @@ TEMPLATE_CLS(DataFilt_Diff) TEMPLATE_CLS(DataFilt_Uniform) } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/basic_data_filt.h b/storage/tianmu/compress/basic_data_filt.h similarity index 95% rename from storage/stonedb/compress/basic_data_filt.h rename to storage/tianmu/compress/basic_data_filt.h index 593150671b..fa2515cb08 100644 --- a/storage/stonedb/compress/basic_data_filt.h +++ b/storage/tianmu/compress/basic_data_filt.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_BASIC_DATA_FILT_H_ -#define STONEDB_COMPRESS_BASIC_DATA_FILT_H_ +#ifndef TIANMU_COMPRESS_BASIC_DATA_FILT_H_ +#define TIANMU_COMPRESS_BASIC_DATA_FILT_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "core/bin_tools.h" #include "core/quick_math.h" -namespace stonedb { +namespace Tianmu { namespace compress { // Maximum no. of records allowed in compression routines @@ -117,6 +117,6 @@ class DataFilt_Uniform : public DataFilt { }; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_BASIC_DATA_FILT_H_ +#endif // TIANMU_COMPRESS_BASIC_DATA_FILT_H_ diff --git a/storage/stonedb/compress/bit_stream_compressor.cpp b/storage/tianmu/compress/bit_stream_compressor.cpp similarity index 99% rename from storage/stonedb/compress/bit_stream_compressor.cpp rename to storage/tianmu/compress/bit_stream_compressor.cpp index 4857b7fac0..d54d5e118d 100644 --- a/storage/stonedb/compress/bit_stream_compressor.cpp +++ b/storage/tianmu/compress/bit_stream_compressor.cpp @@ -20,7 +20,7 @@ #include "common/assert.h" #include "system/fet.h" -namespace stonedb { +namespace Tianmu { namespace compress { const double log_of_2 = log(2.0); @@ -228,4 +228,4 @@ CprsErr BitstreamCompressor::Decompress(char *dest, uint len, char *src, uint nu } } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/bit_stream_compressor.h b/storage/tianmu/compress/bit_stream_compressor.h similarity index 95% rename from storage/stonedb/compress/bit_stream_compressor.h rename to storage/tianmu/compress/bit_stream_compressor.h index 10eecfc2e8..9b42acc7e2 100644 --- a/storage/stonedb/compress/bit_stream_compressor.h +++ b/storage/tianmu/compress/bit_stream_compressor.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_BIT_STREAM_COMPRESSOR_H_ -#define STONEDB_COMPRESS_BIT_STREAM_COMPRESSOR_H_ +#ifndef TIANMU_COMPRESS_BIT_STREAM_COMPRESSOR_H_ +#define TIANMU_COMPRESS_BIT_STREAM_COMPRESSOR_H_ #pragma once #include "compress/arith_coder.h" -namespace stonedb { +namespace Tianmu { namespace compress { ////////////////////////////////////////////////////////////////////// @@ -94,6 +94,6 @@ class BitstreamCompressor { }; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_BIT_STREAM_COMPRESSOR_H_ +#endif // TIANMU_COMPRESS_BIT_STREAM_COMPRESSOR_H_ diff --git a/storage/stonedb/compress/code_stream.h b/storage/tianmu/compress/code_stream.h similarity index 94% rename from storage/stonedb/compress/code_stream.h rename to storage/tianmu/compress/code_stream.h index 4e3d22c96e..89597f3226 100644 --- a/storage/stonedb/compress/code_stream.h +++ b/storage/tianmu/compress/code_stream.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_CODE_STREAM_H_ -#define STONEDB_COMPRESS_CODE_STREAM_H_ +#ifndef TIANMU_COMPRESS_CODE_STREAM_H_ +#define TIANMU_COMPRESS_CODE_STREAM_H_ #pragma once #include "compress/arith_coder.h" #include "compress/defs.h" -namespace stonedb { +namespace Tianmu { namespace compress { // All the methods may throw exceptions of type CprsErr or ErrBufOverrun @@ -86,6 +86,6 @@ class CoderStream : protected ArithCoder { }; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_CODE_STREAM_H_ +#endif // TIANMU_COMPRESS_CODE_STREAM_H_ diff --git a/storage/stonedb/compress/data_filt.h b/storage/tianmu/compress/data_filt.h similarity index 94% rename from storage/stonedb/compress/data_filt.h rename to storage/tianmu/compress/data_filt.h index 2b10e4e950..48b74735e3 100644 --- a/storage/stonedb/compress/data_filt.h +++ b/storage/tianmu/compress/data_filt.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_DATA_FILT_H_ -#define STONEDB_COMPRESS_DATA_FILT_H_ +#ifndef TIANMU_COMPRESS_DATA_FILT_H_ +#define TIANMU_COMPRESS_DATA_FILT_H_ #pragma once #include "compress/range_code.h" #include "core/quick_math.h" -namespace stonedb { +namespace Tianmu { namespace compress { template @@ -76,6 +76,6 @@ class DataFilt : public DataFiltNoTemp { template class cls; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_DATA_FILT_H_ +#endif // TIANMU_COMPRESS_DATA_FILT_H_ diff --git a/storage/stonedb/compress/data_stream.cpp b/storage/tianmu/compress/data_stream.cpp similarity index 97% rename from storage/stonedb/compress/data_stream.cpp rename to storage/tianmu/compress/data_stream.cpp index d3d8c6b372..ceb4120cdb 100644 --- a/storage/stonedb/compress/data_stream.cpp +++ b/storage/tianmu/compress/data_stream.cpp @@ -17,7 +17,7 @@ #include "compress/data_stream.h" -namespace stonedb { +namespace Tianmu { namespace compress { void BitStream::ZeroBits(uint beg, uint end) { @@ -48,4 +48,4 @@ void BitStream::ClearBits() { } } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/data_stream.h b/storage/tianmu/compress/data_stream.h similarity index 97% rename from storage/stonedb/compress/data_stream.h rename to storage/tianmu/compress/data_stream.h index 52ce170741..afe600994d 100644 --- a/storage/stonedb/compress/data_stream.h +++ b/storage/tianmu/compress/data_stream.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_DATA_STREAM_H_ -#define STONEDB_COMPRESS_DATA_STREAM_H_ +#ifndef TIANMU_COMPRESS_DATA_STREAM_H_ +#define TIANMU_COMPRESS_DATA_STREAM_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "common/assert.h" #include "compress/defs.h" -namespace stonedb { +namespace Tianmu { class ErrBufOverrun {}; namespace compress { @@ -238,6 +238,6 @@ inline void BitStream::FastGetBlock(char *data, uint n) { } } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_DATA_STREAM_H_ +#endif // TIANMU_COMPRESS_DATA_STREAM_H_ diff --git a/storage/stonedb/compress/defs.h b/storage/tianmu/compress/defs.h similarity index 94% rename from storage/stonedb/compress/defs.h rename to storage/tianmu/compress/defs.h index b56e9c337a..cc311d394b 100644 --- a/storage/stonedb/compress/defs.h +++ b/storage/tianmu/compress/defs.h @@ -16,8 +16,8 @@ */ /* Definitions for compression methods */ -#ifndef STONEDB_COMPRESS_DEFS_H_ -#define STONEDB_COMPRESS_DEFS_H_ +#ifndef TIANMU_COMPRESS_DEFS_H_ +#define TIANMU_COMPRESS_DEFS_H_ #pragma once // Compression and decompression errors @@ -48,7 +48,7 @@ enum class CprsAttrType /*Enum*/ { #include -namespace stonedb { +namespace Tianmu { namespace compress { class _SHIFT_CHECK_ { @@ -103,6 +103,6 @@ inline T &operator<<=(T &a, _SHIFT_CHECK_ b) { #endif } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_DEFS_H_ +#endif // TIANMU_COMPRESS_DEFS_H_ diff --git a/storage/stonedb/compress/dictionary.cpp b/storage/tianmu/compress/dictionary.cpp similarity index 97% rename from storage/stonedb/compress/dictionary.cpp rename to storage/tianmu/compress/dictionary.cpp index cdbdc73095..32ddfd6e8c 100644 --- a/storage/stonedb/compress/dictionary.cpp +++ b/storage/tianmu/compress/dictionary.cpp @@ -22,7 +22,7 @@ #include "core/bin_tools.h" #include "util/qsort.h" -namespace stonedb { +namespace Tianmu { namespace compress { template @@ -50,7 +50,7 @@ void Dictionary::SetLows() { sumcnt += keys[i].count; DEBUG_ASSERT(keys[i].count > 0); } - qsort_sdb(order, nkeys, sizeof(*order), compare); + qsort_tianmu(order, nkeys, sizeof(*order), compare); ASSERT(sumcnt <= MAXTOTAL, "should be 'sumcnt <= MAXTOTAL'"); // set short counts @@ -146,4 +146,4 @@ template class Dictionary; template class Dictionary; } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/dictionary.h b/storage/tianmu/compress/dictionary.h similarity index 96% rename from storage/stonedb/compress/dictionary.h rename to storage/tianmu/compress/dictionary.h index 1d4d24d170..67a17371e5 100644 --- a/storage/stonedb/compress/dictionary.h +++ b/storage/tianmu/compress/dictionary.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_DICTIONARY_H_ -#define STONEDB_COMPRESS_DICTIONARY_H_ +#ifndef TIANMU_COMPRESS_DICTIONARY_H_ +#define TIANMU_COMPRESS_DICTIONARY_H_ #pragma once #include "common/assert.h" #include "compress/defs.h" #include "compress/range_code.h" -namespace stonedb { +namespace Tianmu { namespace compress { template @@ -147,6 +147,6 @@ inline uint Dictionary::hash(uchar key) { } } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_DICTIONARY_H_ +#endif // TIANMU_COMPRESS_DICTIONARY_H_ diff --git a/storage/stonedb/compress/inc_alloc.cpp b/storage/tianmu/compress/inc_alloc.cpp similarity index 98% rename from storage/stonedb/compress/inc_alloc.cpp rename to storage/tianmu/compress/inc_alloc.cpp index 1d16ffc6d3..fe5b759f72 100644 --- a/storage/stonedb/compress/inc_alloc.cpp +++ b/storage/tianmu/compress/inc_alloc.cpp @@ -17,7 +17,7 @@ #include "inc_alloc.h" -namespace stonedb { +namespace Tianmu { namespace compress { IncAlloc::IncAlloc(uint fsize) { @@ -100,4 +100,4 @@ void IncAlloc::PrintMemUsg(std::ostream &str) { } } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/inc_alloc.h b/storage/tianmu/compress/inc_alloc.h similarity index 95% rename from storage/stonedb/compress/inc_alloc.h rename to storage/tianmu/compress/inc_alloc.h index a1156484bb..0f67d2970c 100644 --- a/storage/stonedb/compress/inc_alloc.h +++ b/storage/tianmu/compress/inc_alloc.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_INC_ALLOC_H_ -#define STONEDB_COMPRESS_INC_ALLOC_H_ +#ifndef TIANMU_COMPRESS_INC_ALLOC_H_ +#define TIANMU_COMPRESS_INC_ALLOC_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "common/assert.h" #include "compress/defs.h" -namespace stonedb { +namespace Tianmu { namespace compress { // Incremental memory allocator. @@ -107,6 +107,6 @@ class IncAlloc { }; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_INC_ALLOC_H_ +#endif // TIANMU_COMPRESS_INC_ALLOC_H_ diff --git a/storage/stonedb/compress/inc_wgraph.cpp b/storage/tianmu/compress/inc_wgraph.cpp similarity index 99% rename from storage/stonedb/compress/inc_wgraph.cpp rename to storage/tianmu/compress/inc_wgraph.cpp index 8dddbfd8d6..9af22361fc 100644 --- a/storage/stonedb/compress/inc_wgraph.cpp +++ b/storage/tianmu/compress/inc_wgraph.cpp @@ -19,7 +19,7 @@ #include -namespace stonedb { +namespace Tianmu { namespace compress { // #define MAKESTAT @@ -712,4 +712,4 @@ void IncWGraph::PrintLbl(std::ostream &str, Edge *e) { } } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/inc_wgraph.h b/storage/tianmu/compress/inc_wgraph.h similarity index 97% rename from storage/stonedb/compress/inc_wgraph.h rename to storage/tianmu/compress/inc_wgraph.h index c2cc19e902..731799c607 100644 --- a/storage/stonedb/compress/inc_wgraph.h +++ b/storage/tianmu/compress/inc_wgraph.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_INC_WGRAPH_H_ -#define STONEDB_COMPRESS_INC_WGRAPH_H_ +#ifndef TIANMU_COMPRESS_INC_WGRAPH_H_ +#define TIANMU_COMPRESS_INC_WGRAPH_H_ #pragma once #include @@ -26,7 +26,7 @@ #include "compress/ppm_defs.h" #include "compress/range_code.h" -namespace stonedb { +namespace Tianmu { namespace compress { class IncWGraph { @@ -180,6 +180,6 @@ class IncWGraph { }; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_INC_WGRAPH_H_ +#endif // TIANMU_COMPRESS_INC_WGRAPH_H_ diff --git a/storage/stonedb/compress/lz4.cpp b/storage/tianmu/compress/lz4.cpp similarity index 99% rename from storage/stonedb/compress/lz4.cpp rename to storage/tianmu/compress/lz4.cpp index be6bc8fe65..07c8383b73 100644 --- a/storage/stonedb/compress/lz4.cpp +++ b/storage/tianmu/compress/lz4.cpp @@ -78,7 +78,7 @@ #define MEM_INIT memset #if defined (__cplusplus) -namespace stonedb{ +namespace Tianmu{ namespace compress{ #endif // defined (__cplusplus) @@ -1550,5 +1550,5 @@ int LZ4_decompress_fast_withPrefix64k(const char* source, char* dest, int origin #if defined (__cplusplus) } //namespace compress -} //namespace stonedb +} //namespace Tianmu #endif // defined (__cplusplus) diff --git a/storage/stonedb/compress/lz4.h b/storage/tianmu/compress/lz4.h similarity index 99% rename from storage/stonedb/compress/lz4.h rename to storage/tianmu/compress/lz4.h index 13a339c60d..2f264a6781 100644 --- a/storage/stonedb/compress/lz4.h +++ b/storage/tianmu/compress/lz4.h @@ -33,12 +33,12 @@ - LZ4 source repository : https://github.com/Cyan4973/lz4 - LZ4 public forum : https://groups.google.com/forum/#!forum/lz4c */ -#ifndef STONEDB_COMPRESS_LZ4_H_ -#define STONEDB_COMPRESS_LZ4_H_ +#ifndef TIANMU_COMPRESS_LZ4_H_ +#define TIANMU_COMPRESS_LZ4_H_ #pragma once #if defined (__cplusplus) -namespace stonedb{ +namespace Tianmu{ namespace compress{ extern "C" { @@ -365,7 +365,7 @@ LZ4_DEPRECATED("use LZ4_decompress_fast_usingDict() instead") int LZ4_decompress } //extern "C" } //namespace compress -} //namespace stonedb +} //namespace Tianmu #endif //defined (__cplusplus) -#endif // STONEDB_COMPRESS_LZ4_H_ +#endif // TIANMU_COMPRESS_LZ4_H_ diff --git a/storage/stonedb/compress/num_compressor.h b/storage/tianmu/compress/num_compressor.h similarity index 95% rename from storage/stonedb/compress/num_compressor.h rename to storage/tianmu/compress/num_compressor.h index 8cf21bb2d4..53beb59c52 100644 --- a/storage/stonedb/compress/num_compressor.h +++ b/storage/tianmu/compress/num_compressor.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_NUM_COMPRESSOR_H_ -#define STONEDB_COMPRESS_NUM_COMPRESSOR_H_ +#ifndef TIANMU_COMPRESS_NUM_COMPRESSOR_H_ +#define TIANMU_COMPRESS_NUM_COMPRESSOR_H_ #pragma once #include "common/assert.h" @@ -28,7 +28,7 @@ #include "core/tools.h" #include "system/fet.h" -namespace stonedb { +namespace Tianmu { namespace compress { // NOTE: if possible, REUSE the same NumCompressor object instead of destroying @@ -76,21 +76,21 @@ class NumCompressorBase { virtual CprsErr Compress([[maybe_unused]] char *dest, [[maybe_unused]] uint &len, [[maybe_unused]] const uchar *src, [[maybe_unused]] uint nrec, [[maybe_unused]] uchar maxval, [[maybe_unused]] CprsAttrType cat = CprsAttrType::CAT_OTHER) { - STONEDB_ERROR("method should not be invoked"); + TIANMU_ERROR("method should not be invoked"); return CprsErr::CPRS_ERR_OTH; } virtual CprsErr Compress([[maybe_unused]] char *dest, [[maybe_unused]] uint &len, [[maybe_unused]] const ushort *src, [[maybe_unused]] uint nrec, [[maybe_unused]] ushort maxval, [[maybe_unused]] CprsAttrType cat = CprsAttrType::CAT_OTHER) { - STONEDB_ERROR("method should not be invoked"); + TIANMU_ERROR("method should not be invoked"); return CprsErr::CPRS_ERR_OTH; } virtual CprsErr Compress([[maybe_unused]] char *dest, [[maybe_unused]] uint &len, [[maybe_unused]] const uint *src, [[maybe_unused]] uint nrec, [[maybe_unused]] uint maxval, [[maybe_unused]] CprsAttrType cat = CprsAttrType::CAT_OTHER) { - STONEDB_ERROR("method should not be invoked"); + TIANMU_ERROR("method should not be invoked"); return CprsErr::CPRS_ERR_OTH; } @@ -98,35 +98,35 @@ class NumCompressorBase { [[maybe_unused]] const uint64_t *src, [[maybe_unused]] uint nrec, [[maybe_unused]] uint64_t maxval, [[maybe_unused]] CprsAttrType cat = CprsAttrType::CAT_OTHER) { - STONEDB_ERROR("method should not be invoked"); + TIANMU_ERROR("method should not be invoked"); return CprsErr::CPRS_ERR_OTH; } virtual CprsErr Decompress([[maybe_unused]] uchar *dest, [[maybe_unused]] char *src, [[maybe_unused]] uint len, [[maybe_unused]] uint nrec, [[maybe_unused]] uchar maxval, [[maybe_unused]] CprsAttrType cat = CprsAttrType::CAT_OTHER) { - STONEDB_ERROR("method should not be invoked"); + TIANMU_ERROR("method should not be invoked"); return CprsErr::CPRS_ERR_OTH; } virtual CprsErr Decompress([[maybe_unused]] ushort *dest, [[maybe_unused]] char *src, [[maybe_unused]] uint len, [[maybe_unused]] uint nrec, [[maybe_unused]] ushort maxval, [[maybe_unused]] CprsAttrType cat = CprsAttrType::CAT_OTHER) { - STONEDB_ERROR("method should not be invoked"); + TIANMU_ERROR("method should not be invoked"); return CprsErr::CPRS_ERR_OTH; } virtual CprsErr Decompress([[maybe_unused]] uint *dest, [[maybe_unused]] char *src, [[maybe_unused]] uint len, [[maybe_unused]] uint nrec, [[maybe_unused]] uint maxval, [[maybe_unused]] CprsAttrType cat = CprsAttrType::CAT_OTHER) { - STONEDB_ERROR("method should not be invoked"); + TIANMU_ERROR("method should not be invoked"); return CprsErr::CPRS_ERR_OTH; } virtual CprsErr Decompress([[maybe_unused]] uint64_t *dest, [[maybe_unused]] char *src, [[maybe_unused]] uint len, [[maybe_unused]] uint nrec, [[maybe_unused]] uint64_t maxval, [[maybe_unused]] CprsAttrType cat = CprsAttrType::CAT_OTHER) { - STONEDB_ERROR("method should not be invoked"); + TIANMU_ERROR("method should not be invoked"); return CprsErr::CPRS_ERR_OTH; } @@ -358,6 +358,6 @@ CprsErr NumCompressor::DecompressT(T *dest, char *src, uint len, uint nrec, T } } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_NUM_COMPRESSOR_H_ +#endif // TIANMU_COMPRESS_NUM_COMPRESSOR_H_ diff --git a/storage/stonedb/compress/part_dict.cpp b/storage/tianmu/compress/part_dict.cpp similarity index 98% rename from storage/stonedb/compress/part_dict.cpp rename to storage/tianmu/compress/part_dict.cpp index 8095ae5684..fc6487fdfe 100644 --- a/storage/stonedb/compress/part_dict.cpp +++ b/storage/tianmu/compress/part_dict.cpp @@ -22,7 +22,7 @@ #include "core/quick_math.h" #include "util/qsort.h" -namespace stonedb { +namespace Tianmu { namespace compress { // The smallest no. of bits of x which must be shifted right to make x <= limit @@ -48,7 +48,7 @@ void PartDict::Create(DataSet *dataset) { if (hash.keys[k].count >= MINOCCUR) freqkey[nfreq++] = &hash.keys[k]; // sort the array of pointers to frequent values in descending order - if (nfreq > 0) qsort_sdb(freqkey, nfreq, sizeof(*freqkey), compare); + if (nfreq > 0) qsort_tianmu(freqkey, nfreq, sizeof(*freqkey), compare); if (nfreq > MAXTOTAL / 2) nfreq = MAXTOTAL / 2; // there is no sense to hold big dictionary with all @@ -250,4 +250,4 @@ void PartDict::Merge(DataSet *dataset) { TEMPLATE_CLS(PartDict) } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/part_dict.h b/storage/tianmu/compress/part_dict.h similarity index 97% rename from storage/stonedb/compress/part_dict.h rename to storage/tianmu/compress/part_dict.h index 3aabeee7e6..1e17af9db5 100644 --- a/storage/stonedb/compress/part_dict.h +++ b/storage/tianmu/compress/part_dict.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_PART_DICT_H_ -#define STONEDB_COMPRESS_PART_DICT_H_ +#ifndef TIANMU_COMPRESS_PART_DICT_H_ +#define TIANMU_COMPRESS_PART_DICT_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "compress/defs.h" #include "compress/range_code.h" -namespace stonedb { +namespace Tianmu { namespace compress { template @@ -208,6 +208,6 @@ inline unsigned int PartDict::HashTab::fun(unsigned char key) { } } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_PART_DICT_H_ +#endif // TIANMU_COMPRESS_PART_DICT_H_ diff --git a/storage/stonedb/compress/ppm.cpp b/storage/tianmu/compress/ppm.cpp similarity index 99% rename from storage/stonedb/compress/ppm.cpp rename to storage/tianmu/compress/ppm.cpp index cbc1a3537f..4373999280 100644 --- a/storage/stonedb/compress/ppm.cpp +++ b/storage/tianmu/compress/ppm.cpp @@ -23,7 +23,7 @@ #include "compress/suffix_tree.h" #include "compress/word_graph.h" -namespace stonedb { +namespace Tianmu { namespace compress { FILE *PPM::dump = NULL; @@ -40,7 +40,7 @@ PPM::PPM(const Symb *data, int dlen, ModelType mt, PPMParam param, uchar method) model.reset(new WordGraph(data, dlen, method == 2)); break; default: - STONEDB_ERROR("not implemented"); + TIANMU_ERROR("not implemented"); } model->TransformForPPM(param); @@ -352,4 +352,4 @@ CprsErr PPM::Decompress(Symb *dest, int dlen, char *src, int slen) { void PPM::PrintInfo(std::ostream &str) { str << "No. of all nodes in the model: " << model->GetNNodes() << std::endl; } } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/ppm.h b/storage/tianmu/compress/ppm.h similarity index 94% rename from storage/stonedb/compress/ppm.h rename to storage/tianmu/compress/ppm.h index a64693ac92..2763998092 100644 --- a/storage/stonedb/compress/ppm.h +++ b/storage/tianmu/compress/ppm.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_PPM_H_ -#define STONEDB_COMPRESS_PPM_H_ +#ifndef TIANMU_COMPRESS_PPM_H_ +#define TIANMU_COMPRESS_PPM_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "compress/arith_coder.h" #include "compress/ppm_defs.h" -namespace stonedb { +namespace Tianmu { namespace compress { class PPM { using Symb = uchar; @@ -62,6 +62,6 @@ class PPM { void PrintInfo(std::ostream &str); }; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_PPM_H_ +#endif // TIANMU_COMPRESS_PPM_H_ diff --git a/storage/stonedb/compress/ppm_defs.h b/storage/tianmu/compress/ppm_defs.h similarity index 94% rename from storage/stonedb/compress/ppm_defs.h rename to storage/tianmu/compress/ppm_defs.h index 0c3918c57c..57127af4bc 100644 --- a/storage/stonedb/compress/ppm_defs.h +++ b/storage/tianmu/compress/ppm_defs.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_PPM_DEFS_H_ -#define STONEDB_COMPRESS_PPM_DEFS_H_ +#ifndef TIANMU_COMPRESS_PPM_DEFS_H_ +#define TIANMU_COMPRESS_PPM_DEFS_H_ #pragma once #include "common/assert.h" #include "compress/defs.h" -namespace stonedb { +namespace Tianmu { namespace compress { using Count = ushort; @@ -86,6 +86,6 @@ class PPMModel { }; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_PPM_DEFS_H_ +#endif // TIANMU_COMPRESS_PPM_DEFS_H_ diff --git a/storage/stonedb/compress/range_code.h b/storage/tianmu/compress/range_code.h similarity index 97% rename from storage/stonedb/compress/range_code.h rename to storage/tianmu/compress/range_code.h index 36dc3ba110..c101b1a4a9 100644 --- a/storage/stonedb/compress/range_code.h +++ b/storage/tianmu/compress/range_code.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_RANGE_CODE_H_ -#define STONEDB_COMPRESS_RANGE_CODE_H_ +#ifndef TIANMU_COMPRESS_RANGE_CODE_H_ +#define TIANMU_COMPRESS_RANGE_CODE_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "compress/defs.h" #include "core/bin_tools.h" -namespace stonedb { +namespace Tianmu { namespace compress { /* Decoder always reads exactly the same no. of bytes as the encoder saves */ @@ -230,6 +230,6 @@ inline void RangeCoder::EncodeUniShift(ushort x, uint shift) { } } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_RANGE_CODE_H_ +#endif // TIANMU_COMPRESS_RANGE_CODE_H_ diff --git a/storage/stonedb/compress/suffix_tree.cpp b/storage/tianmu/compress/suffix_tree.cpp similarity index 99% rename from storage/stonedb/compress/suffix_tree.cpp rename to storage/tianmu/compress/suffix_tree.cpp index d6e0c12928..7c63b9f1e1 100644 --- a/storage/stonedb/compress/suffix_tree.cpp +++ b/storage/tianmu/compress/suffix_tree.cpp @@ -17,7 +17,7 @@ #include "suffix_tree.h" -namespace stonedb { +namespace Tianmu { namespace compress { #define VECT_INIT 16384 @@ -704,4 +704,4 @@ CprsErr SuffixTree::Move(Count c, Symb *str, int &len, Range &rng) template class SuffixTree; } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/suffix_tree.h b/storage/tianmu/compress/suffix_tree.h similarity index 98% rename from storage/stonedb/compress/suffix_tree.h rename to storage/tianmu/compress/suffix_tree.h index dba43879be..a6cf632e12 100644 --- a/storage/stonedb/compress/suffix_tree.h +++ b/storage/tianmu/compress/suffix_tree.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_SUFFIX_TREE_H_ -#define STONEDB_COMPRESS_SUFFIX_TREE_H_ +#ifndef TIANMU_COMPRESS_SUFFIX_TREE_H_ +#define TIANMU_COMPRESS_SUFFIX_TREE_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "compress/ppm_defs.h" -namespace stonedb { +namespace Tianmu { namespace compress { // this macro tells that some additional statistics should be computed and @@ -315,6 +315,6 @@ class SuffixTree : public PPMModel { }; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_SUFFIX_TREE_H_ +#endif // TIANMU_COMPRESS_SUFFIX_TREE_H_ diff --git a/storage/stonedb/compress/text_compressor.cpp b/storage/tianmu/compress/text_compressor.cpp similarity index 97% rename from storage/stonedb/compress/text_compressor.cpp rename to storage/tianmu/compress/text_compressor.cpp index 3170136804..633b954103 100644 --- a/storage/stonedb/compress/text_compressor.cpp +++ b/storage/tianmu/compress/text_compressor.cpp @@ -25,7 +25,7 @@ #include "compress/lz4.h" #include "system/fet.h" -namespace stonedb { +namespace Tianmu { namespace compress { // Compressed data format: @@ -85,7 +85,7 @@ void TextCompressor::SetParams(PPMParam &p, int ver, [[maybe_unused]] int lev, i BLD_RATIO = 2.0; break; default: - STONEDB_ERROR("not implemented"); + TIANMU_ERROR("not implemented"); } SetSplit(len); @@ -381,7 +381,7 @@ CprsErr TextCompressor::CompressVer4(char *dest, int &dlen, char **index, const const int cmpBytes = LZ4_compress(srcdata.get(), dest + pos, length); if (cmpBytes <= 0 || cmpBytes > dlen - pos) { - STONEDB_LOG(LogCtl_Level::ERROR, "CompressVer4 error,cmpBytes: %d dlen - pos = %d", cmpBytes, dlen - pos); + TIANMU_LOG(LogCtl_Level::ERROR, "CompressVer4 error,cmpBytes: %d dlen - pos = %d", cmpBytes, dlen - pos); return CprsErr::CPRS_ERR_OTH; } *(int *)(dest) = (int)cmpBytes; // store size of encoded data @@ -399,7 +399,7 @@ CprsErr TextCompressor::DecompressVer4(char *dest, int dlen, char *src, int slen const int decBytes = LZ4_decompress_safe(src + spos, dest, datalen, dlen); if (decBytes <= 0 || decBytes > dlen) { - STONEDB_LOG(LogCtl_Level::ERROR, "DecompressVer4 error,decBytes: %d dlen = %d", decBytes, dlen); + TIANMU_LOG(LogCtl_Level::ERROR, "DecompressVer4 error,decBytes: %d dlen = %d", decBytes, dlen); return CprsErr::CPRS_ERR_OTH; } @@ -424,7 +424,7 @@ CprsErr TextCompressor::CompressZlib(char *dest, int &dlen, char **index, const uint64_t destlen = dlen - pos; int ret = compress2(reinterpret_cast(dest + pos), &destlen, srcdata.get(), srclen, Z_DEFAULT_COMPRESSION); if (ret != Z_OK) { - STONEDB_LOG(LogCtl_Level::ERROR, "compress2 failure %d, destlen: %d, srclen %d, packlen %u", ret, destlen, srclen, + TIANMU_LOG(LogCtl_Level::ERROR, "compress2 failure %d, destlen: %d, srclen %d, packlen %u", ret, destlen, srclen, packlen); return CprsErr::CPRS_ERR_OTH; } @@ -442,7 +442,7 @@ CprsErr TextCompressor::DecompressZlib(char *dest, int dlen, char *src, int slen const int ret = uncompress(reinterpret_cast(dest), &destlen, reinterpret_cast(src + spos), srclen); if (ret != Z_OK) { - STONEDB_LOG(LogCtl_Level::ERROR, "uncompress error: %d, srclen: %d destlen = %d", ret, srclen, dlen); + TIANMU_LOG(LogCtl_Level::ERROR, "uncompress error: %d, srclen: %d destlen = %d", ret, srclen, dlen); return CprsErr::CPRS_ERR_OTH; } size_t sumlen = 0; @@ -555,4 +555,4 @@ CprsErr TextCompressor::Decompress(char *dest, int dlen, char *src, int slen, ch } } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/text_compressor.h b/storage/tianmu/compress/text_compressor.h similarity index 97% rename from storage/stonedb/compress/text_compressor.h rename to storage/tianmu/compress/text_compressor.h index ce838b31b0..70c46cfb29 100644 --- a/storage/stonedb/compress/text_compressor.h +++ b/storage/tianmu/compress/text_compressor.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_TEXT_COMPRESSOR_H_ -#define STONEDB_COMPRESS_TEXT_COMPRESSOR_H_ +#ifndef TIANMU_COMPRESS_TEXT_COMPRESSOR_H_ +#define TIANMU_COMPRESS_TEXT_COMPRESSOR_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "compress/inc_wgraph.h" #include "compress/ppm.h" -namespace stonedb { +namespace Tianmu { namespace compress { // TODO: safety - check model sizes and stop building the next model if the size @@ -151,6 +151,6 @@ class TextCompressor { }; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_TEXT_COMPRESSOR_H_ +#endif // TIANMU_COMPRESS_TEXT_COMPRESSOR_H_ diff --git a/storage/stonedb/compress/top_bit_dict.cpp b/storage/tianmu/compress/top_bit_dict.cpp similarity index 99% rename from storage/stonedb/compress/top_bit_dict.cpp rename to storage/tianmu/compress/top_bit_dict.cpp index 90c52c3005..f88c3c0fbe 100644 --- a/storage/stonedb/compress/top_bit_dict.cpp +++ b/storage/tianmu/compress/top_bit_dict.cpp @@ -20,7 +20,7 @@ #include "common/assert.h" #include "core/quick_math.h" -namespace stonedb { +namespace Tianmu { namespace compress { template @@ -219,4 +219,4 @@ void TopBitDict::Merge(DataSet *dataset) { TEMPLATE_CLS(TopBitDict) } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/top_bit_dict.h b/storage/tianmu/compress/top_bit_dict.h similarity index 93% rename from storage/stonedb/compress/top_bit_dict.h rename to storage/tianmu/compress/top_bit_dict.h index 0bfe09697f..2ab3b4066f 100644 --- a/storage/stonedb/compress/top_bit_dict.h +++ b/storage/tianmu/compress/top_bit_dict.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_TOP_BIT_DICT_H_ -#define STONEDB_COMPRESS_TOP_BIT_DICT_H_ +#ifndef TIANMU_COMPRESS_TOP_BIT_DICT_H_ +#define TIANMU_COMPRESS_TOP_BIT_DICT_H_ #pragma once #include "compress/data_filt.h" #include "compress/dictionary.h" #include "compress/range_code.h" -namespace stonedb { +namespace Tianmu { namespace compress { // Full dictionary of highest bits @@ -76,6 +76,6 @@ class TopBitDict : public DataFilt { }; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_TOP_BIT_DICT_H_ +#endif // TIANMU_COMPRESS_TOP_BIT_DICT_H_ diff --git a/storage/stonedb/compress/word_graph.cpp b/storage/tianmu/compress/word_graph.cpp similarity index 99% rename from storage/stonedb/compress/word_graph.cpp rename to storage/tianmu/compress/word_graph.cpp index ca0a7faee8..b042882e7f 100644 --- a/storage/stonedb/compress/word_graph.cpp +++ b/storage/tianmu/compress/word_graph.cpp @@ -19,7 +19,7 @@ #include -namespace stonedb { +namespace Tianmu { namespace compress { constexpr size_t VECT_INIT = 128_KB; @@ -656,7 +656,7 @@ void WordGraph::FindEdge(PEdge &e, PSEdge &se, Count c) { } #else - STONEDB_ERROR("not implemented"); + TIANMU_ERROR("not implemented"); #endif } } @@ -703,7 +703,7 @@ void WordGraph::GetRange(PEdge e, [[maybe_unused]] PSEdge se, Range &r) { } r.high = (next >= n.sedge + n.nshadow ? n.stotal : GSE(next).sum); #else - STONEDB_ERROR("not implemented"); + TIANMU_ERROR("not implemented"); #endif } @@ -880,4 +880,4 @@ Count WordGraph::GetShEscCount([[maybe_unused]] PNode n, [[maybe_unused]] int c) } } // namespace compress -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/compress/word_graph.h b/storage/tianmu/compress/word_graph.h similarity index 98% rename from storage/stonedb/compress/word_graph.h rename to storage/tianmu/compress/word_graph.h index bae966adb6..2b53598aee 100644 --- a/storage/stonedb/compress/word_graph.h +++ b/storage/tianmu/compress/word_graph.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_COMPRESS_WORD_GRAPH_H_ -#define STONEDB_COMPRESS_WORD_GRAPH_H_ +#ifndef TIANMU_COMPRESS_WORD_GRAPH_H_ +#define TIANMU_COMPRESS_WORD_GRAPH_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "common/assert.h" #include "compress/ppm_defs.h" -namespace stonedb { +namespace Tianmu { namespace compress { class WordGraph : public PPMModel { @@ -264,6 +264,6 @@ class WordGraph : public PPMModel { }; } // namespace compress -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_COMPRESS_WORD_GRAPH_H_ +#endif // TIANMU_COMPRESS_WORD_GRAPH_H_ diff --git a/storage/stonedb/core/aggregation_algorithm.cpp b/storage/tianmu/core/aggregation_algorithm.cpp similarity index 99% rename from storage/stonedb/core/aggregation_algorithm.cpp rename to storage/tianmu/core/aggregation_algorithm.cpp index 476302cc31..9bd9938587 100644 --- a/storage/stonedb/core/aggregation_algorithm.cpp +++ b/storage/tianmu/core/aggregation_algorithm.cpp @@ -30,7 +30,7 @@ low-level mechanisms #include "system/fet.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace core { void AggregationAlgorithm::Aggregate(bool just_distinct, int64_t &limit, int64_t &offset, ResultSender *sender) { MEASURE_FET("TempTable::Aggregate(...)"); @@ -166,7 +166,7 @@ void AggregationAlgorithm::Aggregate(bool just_distinct, int64_t &limit, int64_t // .....; else if (t->GetWhereConds().Size() == 0 && ((gbw.IsMinOnly() && t->NumOfAttrs() == 1 && min_v != common::MINUS_INF_64) || (gbw.IsMaxOnly() && t->NumOfAttrs() == 1 && max_v != common::PLUS_INF_64))) { - if (stonedb_sysvar_minmax_speedup && !has_lookup) { + if (tianmu_sysvar_minmax_speedup && !has_lookup) { int64_t value = min_v; if (gbw.IsMaxOnly()) value = max_v; gbw.FindCurrentRow(row); // needed to initialize grouping buffer @@ -309,7 +309,7 @@ void AggregationAlgorithm::MultiDimensionalGroupByScan(GroupByWrapper &gbw, int6 for (uint i = 0; i < t->NumOfAttrs(); i++) { if (t->GetAttrP(i)->mode == common::ColOperation::GROUP_CONCAT) { t->GetAttrP(i)->SetTypeName(common::CT::VARCHAR); - t->GetAttrP(i)->OverrideStringSize(stonedb_group_concat_max_len); + t->GetAttrP(i)->OverrideStringSize(tianmu_group_concat_max_len); } t->GetAttrP(i)->CreateBuffer(upper_groups); // note: may be more than needed if (t->GetAttrP(i)->mode == common::ColOperation::DELAYED) t->GetAttrP(i)->term.vc->LockSourcePacks(m); @@ -321,7 +321,7 @@ void AggregationAlgorithm::MultiDimensionalGroupByScan(GroupByWrapper &gbw, int6 int64_t output_size = (gbw.NumOfGroups() + gbw.TuplesNoOnes()) * t->GetOneOutputRecordSize(); gbw.RewindRows(); if (t->GetPageSize() >= (gbw.NumOfGroups() + gbw.TuplesNoOnes()) && output_size > (1L << 29) && - !t->HasHavingConditions() && stonedb_sysvar_parallel_filloutput) { + !t->HasHavingConditions() && tianmu_sysvar_parallel_filloutput) { // Turn on parallel output when: // 1. output page is large enough to hold all output rows // 2. output result is larger than 512MB @@ -828,7 +828,7 @@ void AggregationWorkerEnt::TaskAggrePacks(MIUpdatingIterator *taskIterator, [[ma if (grouping_result == 3 || grouping_result == 4) throw common::NotImplementedException("Aggregation overflow."); cur_tuple += packrow_length; } - STONEDB_LOG(LogCtl_Level::DEBUG, "TaskAggrePacks routine ends. Task id %d", taskIterator->GetTaskNum()); + TIANMU_LOG(LogCtl_Level::DEBUG, "TaskAggrePacks routine ends. Task id %d", taskIterator->GetTaskNum()); } void AggregationWorkerEnt::PrepShardingCopy(MIIterator *mit, GroupByWrapper *gb_sharding, @@ -929,4 +929,4 @@ void AggregationWorkerEnt::DistributeAggreTaskAverage(MIIterator &mit) { } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/aggregation_algorithm.h b/storage/tianmu/core/aggregation_algorithm.h similarity index 93% rename from storage/stonedb/core/aggregation_algorithm.h rename to storage/tianmu/core/aggregation_algorithm.h index 392a86a874..4b4d1092db 100644 --- a/storage/stonedb/core/aggregation_algorithm.h +++ b/storage/tianmu/core/aggregation_algorithm.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_AGGREGATION_ALGORITHM_H_ -#define STONEDB_CORE_AGGREGATION_ALGORITHM_H_ +#ifndef TIANMU_CORE_AGGREGATION_ALGORITHM_H_ +#define TIANMU_CORE_AGGREGATION_ALGORITHM_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "core/query.h" #include "core/temp_table.h" -namespace stonedb { +namespace Tianmu { namespace core { class AggregationAlgorithm { public: @@ -47,7 +47,7 @@ class AggregationAlgorithm { // No parallel for subquery/join/distinct cases bool ParallelAllowed(GroupByWrapper &gbw) { - return (stonedb_sysvar_groupby_speedup && !t->HasTempTable() && (mind->NumOfDimensions() == 1) && gbw.MayBeParallel()); + return (tianmu_sysvar_groupby_speedup && !t->HasTempTable() && (mind->NumOfDimensions() == 1) && gbw.MayBeParallel()); } void TaskFillOutput(GroupByWrapper *gbw, Transaction *ci, int64_t offset, int64_t limit); void ParallelFillOutputWrapper(GroupByWrapper &gbw, int64_t offset, int64_t limit, MIIterator &mit); @@ -101,6 +101,6 @@ class AggregationWorkerEnt { std::mutex mtx; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_AGGREGATION_ALGORITHM_H_ +#endif // TIANMU_CORE_AGGREGATION_ALGORITHM_H_ diff --git a/storage/stonedb/core/aggregator.h b/storage/tianmu/core/aggregator.h similarity index 94% rename from storage/stonedb/core/aggregator.h rename to storage/tianmu/core/aggregator.h index 3fa4ef3b2f..6074a89b1f 100644 --- a/storage/stonedb/core/aggregator.h +++ b/storage/tianmu/core/aggregator.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_AGGREGATOR_H_ -#define STONEDB_CORE_AGGREGATOR_H_ +#ifndef TIANMU_CORE_AGGREGATOR_H_ +#define TIANMU_CORE_AGGREGATOR_H_ #pragma once #include "core/column.h" -namespace stonedb { +namespace Tianmu { namespace core { /*! \brief A generalization of aggregation algorithms (counters) to be used in * GROUP BY etc. An object representing a concrete aggregation exists in one @@ -36,18 +36,18 @@ namespace core { * Therefore it is suggested to implement all variants as separate subclasses, * e.g. to distinguish 32- and 64-bit counters. */ -class STONEDBAggregator { +class TIANMUAggregator { public: - STONEDBAggregator() = default; - STONEDBAggregator(const STONEDBAggregator &sec) = default; - virtual ~STONEDBAggregator() = default; + TIANMUAggregator() = default; + TIANMUAggregator(const TIANMUAggregator &sec) = default; + virtual ~TIANMUAggregator() = default; // Obligatory part /*! * \brief Get a new copy of the aggregator of the proper subtype. * Should be externally deleted after usage. */ - virtual STONEDBAggregator *Copy() = 0; + virtual TIANMUAggregator *Copy() = 0; /*! * \brief Get the number of bytes for one counter. @@ -200,7 +200,7 @@ class STONEDBAggregator { /*! True only if we know that the pack will not change any of the currently * existing counter value. We know it basing on properly updated statistics * stored in the aggregator as well as on data pack statistics set by above - * functions. \pre STONEDBAggregator statistics should be updated. + * functions. \pre TIANMUAggregator statistics should be updated. */ virtual bool PackCannotChangeAggregation() { return false; } @@ -218,15 +218,15 @@ class STONEDBAggregator { * * Start value: 0. */ -class AggregatorCount64 : public STONEDBAggregator { +class AggregatorCount64 : public TIANMUAggregator { public: AggregatorCount64(int64_t max_count) : max_counter(max_count), cur_min_counter(common::PLUS_INF_64), pack_count(0) {} AggregatorCount64(const AggregatorCount64 &sec) - : STONEDBAggregator(sec), + : TIANMUAggregator(sec), max_counter(sec.max_counter), cur_min_counter(sec.cur_min_counter), pack_count(sec.pack_count) {} - STONEDBAggregator *Copy() override { return new AggregatorCount64(*this); } + TIANMUAggregator *Copy() override { return new AggregatorCount64(*this); } int BufferByteSize() override { return 8; } void PutAggregatedValue(unsigned char *buf, int64_t factor) override { stats_updated = false; @@ -285,15 +285,15 @@ class AggregatorCount64 : public STONEDBAggregator { * * Start value: 0. */ -class AggregatorCount32 : public STONEDBAggregator { +class AggregatorCount32 : public TIANMUAggregator { public: AggregatorCount32(int max_count) : max_counter(max_count), cur_min_counter(0x7FFFFFFF), pack_count(0) {} AggregatorCount32(const AggregatorCount32 &sec) - : STONEDBAggregator(sec), + : TIANMUAggregator(sec), max_counter(sec.max_counter), cur_min_counter(sec.cur_min_counter), pack_count(sec.pack_count) {} - STONEDBAggregator *Copy() override { return new AggregatorCount32(*this); } + TIANMUAggregator *Copy() override { return new AggregatorCount32(*this); } int BufferByteSize() override { return 4; } void PutAggregatedValue(unsigned char *buf, int64_t factor) override { stats_updated = false; @@ -346,6 +346,6 @@ class AggregatorCount32 : public STONEDBAggregator { int pack_count; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_AGGREGATOR_H_ +#endif // TIANMU_CORE_AGGREGATOR_H_ diff --git a/storage/stonedb/core/aggregator_advanced.cpp b/storage/tianmu/core/aggregator_advanced.cpp similarity index 97% rename from storage/stonedb/core/aggregator_advanced.cpp rename to storage/tianmu/core/aggregator_advanced.cpp index 079f82ee81..61e653e127 100644 --- a/storage/stonedb/core/aggregator_advanced.cpp +++ b/storage/tianmu/core/aggregator_advanced.cpp @@ -23,7 +23,7 @@ #include "aggregator_advanced.h" #include "types/rc_num.h" -namespace stonedb { +namespace Tianmu { namespace core { void AggregatorStat64::PutAggregatedValue(unsigned char *buf, int64_t v, int64_t factor) { // efficient implementation from WIKI @@ -193,7 +193,7 @@ void AggregatorGroupConcat::PutAggregatedValue(unsigned char *buf, const types:: std::memcpy(buf + pos, src.c_str(), copylen); // append the separator it->second = it->second + copylen; // update the length of the buffer } else { - STONEDB_LOG(LogCtl_Level::ERROR, + TIANMU_LOG(LogCtl_Level::ERROR, "Internal error for AggregatorGroupConcat: buffer length is " "%d, which beyond threshold %d.", pos, gconcat_maxlen); @@ -209,7 +209,7 @@ types::BString AggregatorGroupConcat::GetValueT(unsigned char *buf) { } int len = (it->second < gconcat_maxlen) ? it->second : gconcat_maxlen; - // STONEDB_LOG(LogCtl_Level::INFO, "GetValueT: buf %s, buf addr %x, len %d", buf, buf, + // TIANMU_LOG(LogCtl_Level::INFO, "GetValueT: buf %s, buf addr %x, len %d", buf, buf, // len); if (len == 0) { types::BString res("", 0); @@ -254,11 +254,11 @@ types::BString AggregatorGroupConcat::GetValueT(unsigned char *buf) { std::ostringstream outbuf_stream; std::copy(vstr.begin(), vstr.end(), std::ostream_iterator(outbuf_stream, si.separator.c_str())); - // STONEDB_LOG(LogCtl_Level::DEBUG, "buf %s, tmpbuf1 %s, pos %d, len %d \n", buf, + // TIANMU_LOG(LogCtl_Level::DEBUG, "buf %s, tmpbuf1 %s, pos %d, len %d \n", buf, // outbuf_stream.str().c_str(), pos, len); types::BString res(outbuf_stream.str().c_str(), len, true); return res; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/aggregator_advanced.h b/storage/tianmu/core/aggregator_advanced.h similarity index 77% rename from storage/stonedb/core/aggregator_advanced.h rename to storage/tianmu/core/aggregator_advanced.h index 37558715d1..5f683f8fb7 100644 --- a/storage/stonedb/core/aggregator_advanced.h +++ b/storage/tianmu/core/aggregator_advanced.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_AGGREGATOR_ADVANCED_H_ -#define STONEDB_CORE_AGGREGATOR_ADVANCED_H_ +#ifndef TIANMU_CORE_AGGREGATOR_ADVANCED_H_ +#define TIANMU_CORE_AGGREGATOR_ADVANCED_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "core/temp_table.h" #include "util/log_ctl.h" -namespace stonedb { +namespace Tianmu { namespace core { /*! \brief A generalization of aggregation algorithms (counters) to be used in * GROUP BY etc. See "Aggregator.h" for more details. @@ -37,12 +37,12 @@ namespace core { //! Abstract class for all "second central moment"-like statistical operations, // i.e. VAR_POP, VAR_SAMP, STD_POP, STD_SAMP -class AggregatorStat : public STONEDBAggregator { +class AggregatorStat : public TIANMUAggregator { public: // Buffer contents for all functions, 8+8+8 bytes: // - int64_t, double, double AggregatorStat() = default; - AggregatorStat(const AggregatorStat &sec) : STONEDBAggregator(sec) {} + AggregatorStat(const AggregatorStat &sec) : TIANMUAggregator(sec) {} void Merge(unsigned char *buf, unsigned char *src_buf) override; int BufferByteSize() override { return 24; } void Reset(unsigned char *buf) override { @@ -63,7 +63,7 @@ class AggregatorStat : public STONEDBAggregator { class AggregatorStat64 : public AggregatorStat { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorStat64(int precision) : prec_factor(types::PowOfTen(precision)) {} AggregatorStat64(const AggregatorStat64 &sec) : AggregatorStat(sec), prec_factor(sec.prec_factor) {} void PutAggregatedValue(unsigned char *buf, int64_t v, int64_t factor) override; @@ -74,7 +74,7 @@ class AggregatorStat64 : public AggregatorStat { class AggregatorStatD : public AggregatorStat { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorStatD() = default; AggregatorStatD(const AggregatorStatD &sec) : AggregatorStat(sec) {} void PutAggregatedValue(unsigned char *buf, int64_t v, int64_t factor) override; @@ -90,7 +90,7 @@ class AggregatorVarPop64 : public AggregatorStat64 { public: AggregatorVarPop64(int precision) : AggregatorStat64(precision) {} AggregatorVarPop64(const AggregatorVarPop64 &sec) : AggregatorStat64(sec) {} - STONEDBAggregator *Copy() override { return new AggregatorVarPop64(*this); } + TIANMUAggregator *Copy() override { return new AggregatorVarPop64(*this); } int64_t GetValue64(unsigned char *buf) override; }; @@ -98,7 +98,7 @@ class AggregatorVarSamp64 : public AggregatorStat64 { public: AggregatorVarSamp64(int precision) : AggregatorStat64(precision) {} AggregatorVarSamp64(const AggregatorVarSamp64 &sec) : AggregatorStat64(sec) {} - STONEDBAggregator *Copy() override { return new AggregatorVarSamp64(*this); } + TIANMUAggregator *Copy() override { return new AggregatorVarSamp64(*this); } int64_t GetValue64(unsigned char *buf) override; }; @@ -106,7 +106,7 @@ class AggregatorStdPop64 : public AggregatorStat64 { public: AggregatorStdPop64(int precision) : AggregatorStat64(precision) {} AggregatorStdPop64(const AggregatorStdPop64 &sec) : AggregatorStat64(sec) {} - STONEDBAggregator *Copy() override { return new AggregatorStdPop64(*this); } + TIANMUAggregator *Copy() override { return new AggregatorStdPop64(*this); } int64_t GetValue64(unsigned char *buf) override; }; @@ -114,7 +114,7 @@ class AggregatorStdSamp64 : public AggregatorStat64 { public: AggregatorStdSamp64(int precision) : AggregatorStat64(precision) {} AggregatorStdSamp64(const AggregatorStdSamp64 &sec) : AggregatorStat64(sec) {} - STONEDBAggregator *Copy() override { return new AggregatorStdSamp64(*this); } + TIANMUAggregator *Copy() override { return new AggregatorStdSamp64(*this); } int64_t GetValue64(unsigned char *buf) override; }; @@ -122,7 +122,7 @@ class AggregatorVarPopD : public AggregatorStatD { public: AggregatorVarPopD() = default; AggregatorVarPopD(const AggregatorVarPopD &sec) : AggregatorStatD(sec) {} - STONEDBAggregator *Copy() override { return new AggregatorVarPopD(*this); } + TIANMUAggregator *Copy() override { return new AggregatorVarPopD(*this); } int64_t GetValue64(unsigned char *buf) override; }; @@ -130,7 +130,7 @@ class AggregatorVarSampD : public AggregatorStatD { public: AggregatorVarSampD() = default; AggregatorVarSampD(const AggregatorVarSampD &sec) : AggregatorStatD(sec) {} - STONEDBAggregator *Copy() override { return new AggregatorVarSampD(*this); } + TIANMUAggregator *Copy() override { return new AggregatorVarSampD(*this); } int64_t GetValue64(unsigned char *buf) override; }; @@ -138,7 +138,7 @@ class AggregatorStdPopD : public AggregatorStatD { public: AggregatorStdPopD() = default; AggregatorStdPopD(const AggregatorStdPopD &sec) : AggregatorStatD(sec) {} - STONEDBAggregator *Copy() override { return new AggregatorStdPopD(*this); } + TIANMUAggregator *Copy() override { return new AggregatorStdPopD(*this); } int64_t GetValue64(unsigned char *buf) override; }; @@ -146,16 +146,16 @@ class AggregatorStdSampD : public AggregatorStatD { public: AggregatorStdSampD() = default; AggregatorStdSampD(const AggregatorStdSampD &sec) : AggregatorStatD(sec) {} - STONEDBAggregator *Copy() override { return new AggregatorStdSampD(*this); } + TIANMUAggregator *Copy() override { return new AggregatorStdSampD(*this); } int64_t GetValue64(unsigned char *buf) override; }; -class AggregatorBitAnd : public STONEDBAggregator { +class AggregatorBitAnd : public TIANMUAggregator { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorBitAnd() = default; - AggregatorBitAnd(const AggregatorBitAnd &sec) : STONEDBAggregator(sec) {} - STONEDBAggregator *Copy() override { return new AggregatorBitAnd(*this); } + AggregatorBitAnd(const AggregatorBitAnd &sec) : TIANMUAggregator(sec) {} + TIANMUAggregator *Copy() override { return new AggregatorBitAnd(*this); } int BufferByteSize() override { return 8; } void Reset(unsigned char *buf) override { *((int64_t *)buf) = 0xFFFFFFFFFFFFFFFFULL; } void PutAggregatedValue(unsigned char *buf, int64_t v, [[maybe_unused]] int64_t factor) override { @@ -170,12 +170,12 @@ class AggregatorBitAnd : public STONEDBAggregator { bool IgnoreDistinct() override { return true; } }; -class AggregatorBitOr : public STONEDBAggregator { +class AggregatorBitOr : public TIANMUAggregator { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorBitOr() = default; - AggregatorBitOr(const AggregatorBitOr &sec) : STONEDBAggregator(sec) {} - STONEDBAggregator *Copy() override { return new AggregatorBitOr(*this); } + AggregatorBitOr(const AggregatorBitOr &sec) : TIANMUAggregator(sec) {} + TIANMUAggregator *Copy() override { return new AggregatorBitOr(*this); } int BufferByteSize() override { return 8; } void Reset(unsigned char *buf) override { *((int64_t *)buf) = 0; } void PutAggregatedValue(unsigned char *buf, int64_t v, [[maybe_unused]] int64_t factor) override { @@ -190,12 +190,12 @@ class AggregatorBitOr : public STONEDBAggregator { bool IgnoreDistinct() override { return true; } }; -class AggregatorBitXor : public STONEDBAggregator { +class AggregatorBitXor : public TIANMUAggregator { public: - using STONEDBAggregator::PutAggregatedValue; - AggregatorBitXor() : STONEDBAggregator() {} - AggregatorBitXor(const AggregatorBitXor &sec) : STONEDBAggregator(sec) {} - STONEDBAggregator *Copy() override { return new AggregatorBitXor(*this); } + using TIANMUAggregator::PutAggregatedValue; + AggregatorBitXor() : TIANMUAggregator() {} + AggregatorBitXor(const AggregatorBitXor &sec) : TIANMUAggregator(sec) {} + TIANMUAggregator *Copy() override { return new AggregatorBitXor(*this); } int BufferByteSize() override { return 8; } void Reset(unsigned char *buf) override { *((int64_t *)buf) = 0; } void PutAggregatedValue(unsigned char *buf, int64_t v, int64_t factor) override { @@ -208,40 +208,40 @@ class AggregatorBitXor : public STONEDBAggregator { int64_t GetValue64(unsigned char *buf) override { return *((int64_t *)buf); } }; -class AggregatorGroupConcat : public STONEDBAggregator { +class AggregatorGroupConcat : public TIANMUAggregator { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorGroupConcat() = delete; AggregatorGroupConcat(SI si, common::CT type) : si(si), attrtype(type) {} AggregatorGroupConcat(const AggregatorGroupConcat &sec) - : STONEDBAggregator(sec), si(sec.si), gconcat_maxlen(sec.gconcat_maxlen), attrtype(sec.attrtype) {} + : TIANMUAggregator(sec), si(sec.si), gconcat_maxlen(sec.gconcat_maxlen), attrtype(sec.attrtype) {} - STONEDBAggregator *Copy() override { return new AggregatorGroupConcat(*this); } + TIANMUAggregator *Copy() override { return new AggregatorGroupConcat(*this); } int BufferByteSize() override { return gconcat_maxlen; } void Reset(unsigned char *buf) override { *((int64_t *)buf) = 0; } void PutAggregatedValue([[maybe_unused]] unsigned char *buf, [[maybe_unused]] int64_t v, [[maybe_unused]] int64_t factor) override { - STONEDB_ERROR("Internal error: invalid call for AggregatorGroupConcat"); + TIANMU_ERROR("Internal error: invalid call for AggregatorGroupConcat"); return; } void Merge([[maybe_unused]] unsigned char *buf, [[maybe_unused]] unsigned char *src_buf) override { - STONEDB_ERROR("Internal error: invalid call for AggregatorGroupConcat"); + TIANMU_ERROR("Internal error: invalid call for AggregatorGroupConcat"); return; } void PutAggregatedValue(unsigned char *buf, const types::BString &v, int64_t factor) override; int64_t GetValue64([[maybe_unused]] unsigned char *buf) override { - STONEDB_ERROR("Internal error: invalid call for AggregatorGroupConcat"); + TIANMU_ERROR("Internal error: invalid call for AggregatorGroupConcat"); return -1; } types::BString GetValueT(unsigned char *buf) override; private: const SI si{",", ORDER::ORDER_NOT_RELEVANT}; - const uint gconcat_maxlen = stonedb_group_concat_max_len; + const uint gconcat_maxlen = tianmu_group_concat_max_len; std::map lenmap; // store aggregation column length common::CT attrtype = common::CT::STRING; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_AGGREGATOR_ADVANCED_H_ +#endif // TIANMU_CORE_AGGREGATOR_ADVANCED_H_ diff --git a/storage/stonedb/core/aggregator_basic.cpp b/storage/tianmu/core/aggregator_basic.cpp similarity index 99% rename from storage/stonedb/core/aggregator_basic.cpp rename to storage/tianmu/core/aggregator_basic.cpp index 4e4ef671dd..710fd983ac 100644 --- a/storage/stonedb/core/aggregator_basic.cpp +++ b/storage/tianmu/core/aggregator_basic.cpp @@ -20,7 +20,7 @@ #include "core/transaction.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace core { void AggregatorSum64::PutAggregatedValue(unsigned char *buf, int64_t v, int64_t factor) { stats_updated = false; @@ -545,4 +545,4 @@ types::BString AggregatorListT::GetValueT(unsigned char *buf) { return res; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/aggregator_basic.h b/storage/tianmu/core/aggregator_basic.h similarity index 88% rename from storage/stonedb/core/aggregator_basic.h rename to storage/tianmu/core/aggregator_basic.h index dd97015ec6..733e26b95a 100644 --- a/storage/stonedb/core/aggregator_basic.h +++ b/storage/tianmu/core/aggregator_basic.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_AGGREGATOR_BASIC_H_ -#define STONEDB_CORE_AGGREGATOR_BASIC_H_ +#ifndef TIANMU_CORE_AGGREGATOR_BASIC_H_ +#define TIANMU_CORE_AGGREGATOR_BASIC_H_ #pragma once #include "core/aggregator.h" -namespace stonedb { +namespace Tianmu { namespace core { /*! \brief A generalization of aggregation algorithms (counters) to be used in * GROUP BY etc. See "Aggregator.h" for more details. @@ -39,24 +39,24 @@ namespace core { * Start value: common::NULL_VALUE_64. * Throws an exception on overflow. */ -class AggregatorSum64 : public STONEDBAggregator { - using STONEDBAggregator::PutAggregatedValue; +class AggregatorSum64 : public TIANMUAggregator { + using TIANMUAggregator::PutAggregatedValue; public: - AggregatorSum64() : STONEDBAggregator() { + AggregatorSum64() : TIANMUAggregator() { pack_sum = 0; pack_min = 0; pack_max = 0; null_group_found = false; } AggregatorSum64(AggregatorSum64 &sec) - : STONEDBAggregator(sec), + : TIANMUAggregator(sec), pack_sum(sec.pack_sum), pack_min(sec.pack_min), pack_max(sec.pack_max), null_group_found(sec.null_group_found) {} - STONEDBAggregator *Copy() override { return new AggregatorSum64(*this); } + TIANMUAggregator *Copy() override { return new AggregatorSum64(*this); } int BufferByteSize() override { return 8; } void PutAggregatedValue(unsigned char *buf, int64_t v, int64_t factor) override; void Merge(unsigned char *buf, unsigned char *src_buf) override; @@ -101,13 +101,13 @@ class AggregatorSum64 : public STONEDBAggregator { * * Start value: NULL_VALUE_D. */ -class AggregatorSumD : public STONEDBAggregator { - using STONEDBAggregator::PutAggregatedValue; +class AggregatorSumD : public TIANMUAggregator { + using TIANMUAggregator::PutAggregatedValue; public: - AggregatorSumD() : STONEDBAggregator() { pack_sum = 0; } - AggregatorSumD(AggregatorSumD &sec) : STONEDBAggregator(sec), pack_sum(sec.pack_sum) {} - STONEDBAggregator *Copy() override { return new AggregatorSumD(*this); } + AggregatorSumD() : TIANMUAggregator() { pack_sum = 0; } + AggregatorSumD(AggregatorSumD &sec) : TIANMUAggregator(sec), pack_sum(sec.pack_sum) {} + TIANMUAggregator *Copy() override { return new AggregatorSumD(*this); } int BufferByteSize() override { return 8; } void PutAggregatedValue(unsigned char *buf, int64_t v, int64_t factor) override; void PutAggregatedValue(unsigned char *buf, const types::BString &v, int64_t factor) override; @@ -134,8 +134,8 @@ class AggregatorSumD : public STONEDBAggregator { * * Start value: 0, but GetValueD will return NULL_VALUE_D. */ -class AggregatorAvg64 : public STONEDBAggregator { - using STONEDBAggregator::PutAggregatedValue; +class AggregatorAvg64 : public TIANMUAggregator { + using TIANMUAggregator::PutAggregatedValue; public: AggregatorAvg64(int precision) { @@ -145,12 +145,12 @@ class AggregatorAvg64 : public STONEDBAggregator { pack_sum = 0; } AggregatorAvg64(AggregatorAvg64 &sec) - : STONEDBAggregator(sec), + : TIANMUAggregator(sec), pack_sum(sec.pack_sum), pack_not_nulls(sec.pack_not_nulls), prec_factor(sec.prec_factor), warning_issued(sec.warning_issued) {} - STONEDBAggregator *Copy() override { return new AggregatorAvg64(*this); } + TIANMUAggregator *Copy() override { return new AggregatorAvg64(*this); } int BufferByteSize() override { return 16; } void PutAggregatedValue(unsigned char *buf, int64_t v, int64_t factor) override; void Merge(unsigned char *buf, unsigned char *src_buf) override; @@ -188,17 +188,17 @@ class AggregatorAvg64 : public STONEDBAggregator { * * Start value: 0, but GetValueD will return NULL_VALUE_D. */ -class AggregatorAvgD : public STONEDBAggregator { +class AggregatorAvgD : public TIANMUAggregator { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; - AggregatorAvgD() : STONEDBAggregator() { + AggregatorAvgD() : TIANMUAggregator() { pack_not_nulls = 0; pack_sum = 0; } AggregatorAvgD(AggregatorAvgD &sec) - : STONEDBAggregator(sec), pack_sum(sec.pack_sum), pack_not_nulls(sec.pack_not_nulls) {} - STONEDBAggregator *Copy() override { return new AggregatorAvgD(*this); } + : TIANMUAggregator(sec), pack_sum(sec.pack_sum), pack_not_nulls(sec.pack_not_nulls) {} + TIANMUAggregator *Copy() override { return new AggregatorAvgD(*this); } int BufferByteSize() override { return 16; } void PutAggregatedValue(unsigned char *buf, int64_t v, int64_t factor) override; void PutAggregatedValue(unsigned char *buf, const types::BString &v, int64_t factor) override; @@ -236,10 +236,10 @@ class AggregatorAvgD : public STONEDBAggregator { class AggregatorAvgYear : public AggregatorAvgD { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorAvgYear() : AggregatorAvgD() {} AggregatorAvgYear(AggregatorAvgYear &sec) : AggregatorAvgD(sec) {} - STONEDBAggregator *Copy() override { return new AggregatorAvgYear(*this); } + TIANMUAggregator *Copy() override { return new AggregatorAvgYear(*this); } void PutAggregatedValue(unsigned char *buf, int64_t v, int64_t factor) override; void PutAggregatedValue(unsigned char *buf, const types::BString &v, int64_t factor) override; void Merge(unsigned char *buf, unsigned char *src_buf) override; @@ -251,11 +251,11 @@ class AggregatorAvgYear : public AggregatorAvgD { }; //! Abstract class for all kinds of MIN(...) -class AggregatorMin : public STONEDBAggregator { +class AggregatorMin : public TIANMUAggregator { public: - using STONEDBAggregator::PutAggregatedValue; - AggregatorMin() : STONEDBAggregator() {} - AggregatorMin(AggregatorMin &sec) : STONEDBAggregator(sec) {} + using TIANMUAggregator::PutAggregatedValue; + AggregatorMin() : TIANMUAggregator() {} + AggregatorMin(AggregatorMin &sec) : TIANMUAggregator(sec) {} // Optimization part bool PackAggregationDistinctIrrelevant() override { return true; } bool FactorNeeded() override { return false; } @@ -272,7 +272,7 @@ class AggregatorMin : public STONEDBAggregator { */ class AggregatorMin32 : public AggregatorMin { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorMin32() : AggregatorMin() { stat_max = 0; pack_min = 0; @@ -280,7 +280,7 @@ class AggregatorMin32 : public AggregatorMin { } AggregatorMin32(AggregatorMin32 &sec) : AggregatorMin(sec), stat_max(sec.stat_max), pack_min(sec.pack_min), null_group_found(sec.null_group_found) {} - STONEDBAggregator *Copy() override { return new AggregatorMin32(*this); } + TIANMUAggregator *Copy() override { return new AggregatorMin32(*this); } int BufferByteSize() override { return 4; } void PutAggregatedValue(unsigned char *buf, int64_t factor) override { stats_updated = false; @@ -326,7 +326,7 @@ class AggregatorMin32 : public AggregatorMin { */ class AggregatorMin64 : public AggregatorMin { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorMin64() : AggregatorMin() { stat_max = 0; pack_min = 0; @@ -334,7 +334,7 @@ class AggregatorMin64 : public AggregatorMin { } AggregatorMin64(AggregatorMin64 &sec) : AggregatorMin(sec), stat_max(sec.stat_max), pack_min(sec.pack_min), null_group_found(sec.null_group_found) {} - STONEDBAggregator *Copy() override { return new AggregatorMin64(*this); } + TIANMUAggregator *Copy() override { return new AggregatorMin64(*this); } int BufferByteSize() override { return 8; } void PutAggregatedValue(unsigned char *buf, int64_t factor) override { stats_updated = false; @@ -380,7 +380,7 @@ class AggregatorMin64 : public AggregatorMin { */ class AggregatorMinD : public AggregatorMin { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorMinD() : AggregatorMin() { stat_max = 0; pack_min = 0; @@ -388,7 +388,7 @@ class AggregatorMinD : public AggregatorMin { } AggregatorMinD(AggregatorMinD &sec) : AggregatorMin(sec), stat_max(sec.stat_max), pack_min(sec.pack_min), null_group_found(sec.null_group_found) {} - STONEDBAggregator *Copy() override { return new AggregatorMinD(*this); } + TIANMUAggregator *Copy() override { return new AggregatorMinD(*this); } int BufferByteSize() override { return 8; } void PutAggregatedValue(unsigned char *buf, int64_t v, int64_t factor) override; void Merge(unsigned char *buf, unsigned char *src_buf) override; @@ -440,10 +440,10 @@ class AggregatorMinD : public AggregatorMin { */ class AggregatorMinT : public AggregatorMin { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorMinT(int max_len) : val_len(max_len) {} AggregatorMinT(AggregatorMinT &sec) : AggregatorMin(sec), val_len(sec.val_len) {} - STONEDBAggregator *Copy() override { return new AggregatorMinT(*this); } + TIANMUAggregator *Copy() override { return new AggregatorMinT(*this); } int BufferByteSize() override { return val_len + 2; } void PutAggregatedValue(unsigned char *buf, const types::BString &v, int64_t factor) override; void Merge(unsigned char *buf, unsigned char *src_buf) override; @@ -467,10 +467,10 @@ class AggregatorMinT : public AggregatorMin { */ class AggregatorMinT_UTF : public AggregatorMinT { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorMinT_UTF(int max_len, DTCollation coll); AggregatorMinT_UTF(AggregatorMinT_UTF &sec) : AggregatorMinT(sec), collation(sec.collation) {} - STONEDBAggregator *Copy() override { return new AggregatorMinT_UTF(*this); } + TIANMUAggregator *Copy() override { return new AggregatorMinT_UTF(*this); } void PutAggregatedValue(unsigned char *buf, const types::BString &v, int64_t factor) override; void Merge(unsigned char *buf, unsigned char *src_buf) override; @@ -479,16 +479,16 @@ class AggregatorMinT_UTF : public AggregatorMinT { }; //! Abstract class for all kinds of MAX(...) -class AggregatorMax : public STONEDBAggregator { +class AggregatorMax : public TIANMUAggregator { public: - AggregatorMax() : STONEDBAggregator() {} - AggregatorMax(AggregatorMax &sec) : STONEDBAggregator(sec) {} + AggregatorMax() : TIANMUAggregator() {} + AggregatorMax(AggregatorMax &sec) : TIANMUAggregator(sec) {} // Optimization part bool PackAggregationDistinctIrrelevant() override { return true; } bool FactorNeeded() override { return false; } bool IgnoreDistinct() override { return true; } bool PackAggregationNeedsMax() override { return true; } - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; }; /*! @@ -500,7 +500,7 @@ class AggregatorMax : public STONEDBAggregator { */ class AggregatorMax32 : public AggregatorMax { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorMax32() : AggregatorMax() { stat_min = 0; pack_max = 0; @@ -508,7 +508,7 @@ class AggregatorMax32 : public AggregatorMax { } AggregatorMax32(AggregatorMax32 &sec) : AggregatorMax(sec), stat_min(sec.stat_min), pack_max(sec.pack_max), null_group_found(sec.null_group_found) {} - STONEDBAggregator *Copy() override { return new AggregatorMax32(*this); } + TIANMUAggregator *Copy() override { return new AggregatorMax32(*this); } int BufferByteSize() override { return 4; } void PutAggregatedValue(unsigned char *buf, int64_t factor) override { stats_updated = false; @@ -554,7 +554,7 @@ class AggregatorMax32 : public AggregatorMax { */ class AggregatorMax64 : public AggregatorMax { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorMax64() : AggregatorMax() { stat_min = 0; pack_max = 0; @@ -562,7 +562,7 @@ class AggregatorMax64 : public AggregatorMax { } AggregatorMax64(AggregatorMax64 &sec) : AggregatorMax(sec), stat_min(sec.stat_min), pack_max(sec.pack_max), null_group_found(sec.null_group_found) {} - STONEDBAggregator *Copy() override { return new AggregatorMax64(*this); } + TIANMUAggregator *Copy() override { return new AggregatorMax64(*this); } int BufferByteSize() override { return 8; } void PutAggregatedValue(unsigned char *buf, int64_t factor) override { stats_updated = false; @@ -609,7 +609,7 @@ class AggregatorMax64 : public AggregatorMax { */ class AggregatorMaxD : public AggregatorMax { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorMaxD() : AggregatorMax() { stat_min = 0; pack_max = 0; @@ -617,7 +617,7 @@ class AggregatorMaxD : public AggregatorMax { } AggregatorMaxD(AggregatorMaxD &sec) : AggregatorMax(sec), stat_min(sec.stat_min), pack_max(sec.pack_max), null_group_found(sec.null_group_found) {} - STONEDBAggregator *Copy() override { return new AggregatorMaxD(*this); } + TIANMUAggregator *Copy() override { return new AggregatorMaxD(*this); } int BufferByteSize() override { return 8; } void PutAggregatedValue(unsigned char *buf, int64_t v, int64_t factor) override; void Merge(unsigned char *buf, unsigned char *src_buf) override; @@ -669,10 +669,10 @@ class AggregatorMaxD : public AggregatorMax { */ class AggregatorMaxT : public AggregatorMax { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorMaxT(int max_len) : val_len(max_len) {} AggregatorMaxT(AggregatorMaxT &sec) : AggregatorMax(sec), val_len(sec.val_len) {} - STONEDBAggregator *Copy() override { return new AggregatorMaxT(*this); } + TIANMUAggregator *Copy() override { return new AggregatorMaxT(*this); } int BufferByteSize() override { return val_len + 2; } void PutAggregatedValue(unsigned char *buf, const types::BString &v, int64_t factor) override; void Merge(unsigned char *buf, unsigned char *src_buf) override; @@ -696,10 +696,10 @@ class AggregatorMaxT : public AggregatorMax { */ class AggregatorMaxT_UTF : public AggregatorMaxT { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorMaxT_UTF(int max_len, DTCollation coll); AggregatorMaxT_UTF(AggregatorMaxT_UTF &sec) : AggregatorMaxT(sec), collation(sec.collation) {} - STONEDBAggregator *Copy() override { return new AggregatorMaxT_UTF(*this); } + TIANMUAggregator *Copy() override { return new AggregatorMaxT_UTF(*this); } void PutAggregatedValue(unsigned char *buf, const types::BString &v, int64_t factor) override; void Merge(unsigned char *buf, unsigned char *src_buf) override; @@ -714,12 +714,12 @@ class AggregatorMaxT_UTF : public AggregatorMaxT { * * Start value: NULL_VALUE (32 bit), will return common::NULL_VALUE_64. */ -class AggregatorList32 : public STONEDBAggregator { +class AggregatorList32 : public TIANMUAggregator { public: - using STONEDBAggregator::PutAggregatedValue; - AggregatorList32() : STONEDBAggregator() { value_set = false; } - AggregatorList32(AggregatorList32 &sec) : STONEDBAggregator(sec), value_set(sec.value_set) {} - STONEDBAggregator *Copy() override { return new AggregatorList32(*this); } + using TIANMUAggregator::PutAggregatedValue; + AggregatorList32() : TIANMUAggregator() { value_set = false; } + AggregatorList32(AggregatorList32 &sec) : TIANMUAggregator(sec), value_set(sec.value_set) {} + TIANMUAggregator *Copy() override { return new AggregatorList32(*this); } int BufferByteSize() override { return 4; } void PutAggregatedValue(unsigned char *buf, int64_t v, [[maybe_unused]] int64_t factor) override { if (*((int *)buf) == common::NULL_VALUE_32) { @@ -762,12 +762,12 @@ class AggregatorList32 : public STONEDBAggregator { * * Start value: common::NULL_VALUE_64. */ -class AggregatorList64 : public STONEDBAggregator { +class AggregatorList64 : public TIANMUAggregator { public: - using STONEDBAggregator::PutAggregatedValue; - AggregatorList64() : STONEDBAggregator() { value_set = false; } - AggregatorList64(AggregatorList64 &sec) : STONEDBAggregator(sec), value_set(sec.value_set) {} - STONEDBAggregator *Copy() override { return new AggregatorList64(*this); } + using TIANMUAggregator::PutAggregatedValue; + AggregatorList64() : TIANMUAggregator() { value_set = false; } + AggregatorList64(AggregatorList64 &sec) : TIANMUAggregator(sec), value_set(sec.value_set) {} + TIANMUAggregator *Copy() override { return new AggregatorList64(*this); } int BufferByteSize() override { return 8; } void PutAggregatedValue(unsigned char *buf, int64_t v, [[maybe_unused]] int64_t factor) override { if (*((int64_t *)buf) == common::NULL_VALUE_64) { @@ -811,12 +811,12 @@ class AggregatorList64 : public STONEDBAggregator { * Null value is indicated by \0,\0,\0 and zero-length non-null string by * \0,\0,\1. */ -class AggregatorListT : public STONEDBAggregator { +class AggregatorListT : public TIANMUAggregator { public: - using STONEDBAggregator::PutAggregatedValue; + using TIANMUAggregator::PutAggregatedValue; AggregatorListT(int max_len) : val_len(max_len) { value_set = false; } - AggregatorListT(AggregatorListT &sec) : STONEDBAggregator(sec), value_set(sec.value_set), val_len(sec.val_len) {} - STONEDBAggregator *Copy() override { return new AggregatorListT(*this); } + AggregatorListT(AggregatorListT &sec) : TIANMUAggregator(sec), value_set(sec.value_set), val_len(sec.val_len) {} + TIANMUAggregator *Copy() override { return new AggregatorListT(*this); } int BufferByteSize() override { return val_len + 2; } void PutAggregatedValue(unsigned char *buf, const types::BString &v, int64_t factor) override; void Merge(unsigned char *buf, unsigned char *src_buf) override; @@ -841,6 +841,6 @@ class AggregatorListT : public STONEDBAggregator { // without len }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_AGGREGATOR_BASIC_H_ +#endif // TIANMU_CORE_AGGREGATOR_BASIC_H_ diff --git a/storage/stonedb/core/bin_tools.cpp b/storage/tianmu/core/bin_tools.cpp similarity index 99% rename from storage/stonedb/core/bin_tools.cpp rename to storage/tianmu/core/bin_tools.cpp index cb738524ea..8007fee622 100644 --- a/storage/stonedb/core/bin_tools.cpp +++ b/storage/tianmu/core/bin_tools.cpp @@ -20,7 +20,7 @@ #include "core/bin_tools.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace core { const int bin_sums[256] = {0, 1, 1, 2, 1, 2, 2, 3, // 00000*** 1, 2, 2, 3, 2, 3, 3, 4, // 00001*** @@ -543,4 +543,4 @@ static void Transform(uint *buf, uint *in) { } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/bin_tools.h b/storage/tianmu/core/bin_tools.h similarity index 95% rename from storage/stonedb/core/bin_tools.h rename to storage/tianmu/core/bin_tools.h index 9797cbaf84..d191c3698b 100644 --- a/storage/stonedb/core/bin_tools.h +++ b/storage/tianmu/core/bin_tools.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_BIN_TOOLS_H_ -#define STONEDB_CORE_BIN_TOOLS_H_ +#ifndef TIANMU_CORE_BIN_TOOLS_H_ +#define TIANMU_CORE_BIN_TOOLS_H_ #pragma once #include "common/common_definitions.h" -namespace stonedb { +namespace Tianmu { namespace core { // Number of "1"-s in 32-bit value @@ -88,6 +88,6 @@ inline uint GetBitLen(uint64_t x) { inline uint GetBitLen(ushort x) { return GetBitLen((uint)x); } inline uint GetBitLen(uchar x) { return GetBitLen((uint)x); } } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_BIN_TOOLS_H_ +#endif // TIANMU_CORE_BIN_TOOLS_H_ diff --git a/storage/stonedb/core/blocked_mem_table.cpp b/storage/tianmu/core/blocked_mem_table.cpp similarity index 99% rename from storage/stonedb/core/blocked_mem_table.cpp rename to storage/tianmu/core/blocked_mem_table.cpp index 25616b2597..a42901271c 100644 --- a/storage/stonedb/core/blocked_mem_table.cpp +++ b/storage/tianmu/core/blocked_mem_table.cpp @@ -17,7 +17,7 @@ #include "blocked_mem_table.h" -namespace stonedb { +namespace Tianmu { namespace core { MemBlockManager::~MemBlockManager() { for (auto &it : free_blocks) dealloc(it); @@ -195,4 +195,4 @@ bool BlockedRowMemStorage::SetEndRow(int64_t row) { } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/blocked_mem_table.h b/storage/tianmu/core/blocked_mem_table.h similarity index 97% rename from storage/stonedb/core/blocked_mem_table.h rename to storage/tianmu/core/blocked_mem_table.h index c4f7cda290..9a7e01a845 100644 --- a/storage/stonedb/core/blocked_mem_table.h +++ b/storage/tianmu/core/blocked_mem_table.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_BLOCKED_MEM_TABLE_H_ -#define STONEDB_CORE_BLOCKED_MEM_TABLE_H_ +#ifndef TIANMU_CORE_BLOCKED_MEM_TABLE_H_ +#define TIANMU_CORE_BLOCKED_MEM_TABLE_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace core { class MemBlockManager final : public mm::TraceableObject { public: @@ -176,6 +176,6 @@ class BlockedRowMemStorage { bool release; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_BLOCKED_MEM_TABLE_H_ +#endif // TIANMU_CORE_BLOCKED_MEM_TABLE_H_ diff --git a/storage/stonedb/core/bloom_block.cpp b/storage/tianmu/core/bloom_block.cpp similarity index 98% rename from storage/stonedb/core/bloom_block.cpp rename to storage/tianmu/core/bloom_block.cpp index eb089e508e..b1613cd9c3 100644 --- a/storage/stonedb/core/bloom_block.cpp +++ b/storage/tianmu/core/bloom_block.cpp @@ -19,7 +19,7 @@ #include "core/bloom_coding.h" -namespace stonedb { +namespace Tianmu { namespace core { // Generate new filter every 2KB of data static const size_t kFilterBaseLg = 11; @@ -73,7 +73,7 @@ class BloomFilterPolicy : public FilterPolicy { if (k_ > 30) k_ = 30; } - const char *Name() const override { return "StoneDB.BuiltinBloomFilter2"; } + const char *Name() const override { return "Tianmu.BuiltinBloomFilter2"; } void CreateFilter(const Slice *keys, int n, std::string *dst) const override { // Compute bloom filter size (in both bits and bytes) size_t bits = n * bits_per_key_; @@ -215,4 +215,4 @@ bool FilterBlockReader::KeyMayMatch(uint64_t block_offset, const Slice &key) { return true; // Errors are treated as potential matches } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/bloom_block.h b/storage/tianmu/core/bloom_block.h similarity index 97% rename from storage/stonedb/core/bloom_block.h rename to storage/tianmu/core/bloom_block.h index 116502213c..6ba25c03d2 100644 --- a/storage/stonedb/core/bloom_block.h +++ b/storage/tianmu/core/bloom_block.h @@ -20,8 +20,8 @@ filters (e.g., bloom filters) for all data blocks in the table combined into a single filter block. */ -#ifndef STONEDB_CORE_BLOOM_BLOCK_H_ -#define STONEDB_CORE_BLOOM_BLOCK_H_ +#ifndef TIANMU_CORE_BLOOM_BLOCK_H_ +#define TIANMU_CORE_BLOOM_BLOCK_H_ #pragma once #include @@ -32,7 +32,7 @@ #include "common/assert.h" -namespace stonedb { +namespace Tianmu { namespace core { class Slice { public: @@ -191,6 +191,6 @@ class FilterBlockReader { size_t base_lg_; // Encoding parameter (see kFilterBaseLg in .cc file) }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_BLOOM_BLOCK_H_ +#endif // TIANMU_CORE_BLOOM_BLOCK_H_ diff --git a/storage/stonedb/core/bloom_coding.cpp b/storage/tianmu/core/bloom_coding.cpp similarity index 99% rename from storage/stonedb/core/bloom_coding.cpp rename to storage/tianmu/core/bloom_coding.cpp index 500fbd4fdf..5b24f110bd 100644 --- a/storage/stonedb/core/bloom_coding.cpp +++ b/storage/tianmu/core/bloom_coding.cpp @@ -17,7 +17,7 @@ #include "bloom_coding.h" -namespace stonedb { +namespace Tianmu { namespace core { void EncodeFixed32(char *buf, uint32_t value) { if (kLittleEndian) { @@ -200,4 +200,4 @@ bool GetLengthPrefixedSlice(Slice *input, Slice *result) { } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/bloom_coding.h b/storage/tianmu/core/bloom_coding.h similarity index 96% rename from storage/stonedb/core/bloom_coding.h rename to storage/tianmu/core/bloom_coding.h index a014acbd4f..cbf71a9320 100644 --- a/storage/stonedb/core/bloom_coding.h +++ b/storage/tianmu/core/bloom_coding.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_BLOOM_CODING_H_ -#define STONEDB_CORE_BLOOM_CODING_H_ +#ifndef TIANMU_CORE_BLOOM_CODING_H_ +#define TIANMU_CORE_BLOOM_CODING_H_ #pragma once #include @@ -23,7 +23,7 @@ #include #include "core/bloom_block.h" -namespace stonedb { +namespace Tianmu { namespace core { static const bool kLittleEndian = true; @@ -106,6 +106,6 @@ inline const char *GetVarint32Ptr(const char *p, const char *limit, uint32_t *va return GetVarint32PtrFallback(p, limit, value); } } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_BLOOM_CODING_H_ +#endif // TIANMU_CORE_BLOOM_CODING_H_ diff --git a/storage/stonedb/core/cached_buffer.cpp b/storage/tianmu/core/cached_buffer.cpp similarity index 99% rename from storage/stonedb/core/cached_buffer.cpp rename to storage/tianmu/core/cached_buffer.cpp index be83698356..25fe5cd95e 100644 --- a/storage/stonedb/core/cached_buffer.cpp +++ b/storage/tianmu/core/cached_buffer.cpp @@ -19,7 +19,7 @@ #include "core/transaction.h" -namespace stonedb { +namespace Tianmu { namespace core { template CachedBuffer::CachedBuffer(uint page_size, uint _elem_size, Transaction *conn) @@ -156,4 +156,4 @@ template class CachedBuffer; template class CachedBuffer; } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/cached_buffer.h b/storage/tianmu/core/cached_buffer.h similarity index 95% rename from storage/stonedb/core/cached_buffer.h rename to storage/tianmu/core/cached_buffer.h index 4ec33a148d..c77e6a30fe 100644 --- a/storage/stonedb/core/cached_buffer.h +++ b/storage/tianmu/core/cached_buffer.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_CACHED_BUFFER_H_ -#define STONEDB_CORE_CACHED_BUFFER_H_ +#ifndef TIANMU_CORE_CACHED_BUFFER_H_ +#define TIANMU_CORE_CACHED_BUFFER_H_ #pragma once #include "common/common_definitions.h" @@ -23,7 +23,7 @@ #include "system/cacheable_item.h" #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace core { /* This is a general purpose class to store 64bit number of elements of any @@ -94,6 +94,6 @@ class CachedBuffer : public system::CacheableItem, public mm::Tr Transaction *m_conn; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_CACHED_BUFFER_H_ +#endif // TIANMU_CORE_CACHED_BUFFER_H_ diff --git a/storage/stonedb/core/column.h b/storage/tianmu/core/column.h similarity index 92% rename from storage/stonedb/core/column.h rename to storage/tianmu/core/column.h index 14bfc3cafb..b7d6731142 100644 --- a/storage/stonedb/core/column.h +++ b/storage/tianmu/core/column.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_COLUMN_H_ -#define STONEDB_CORE_COLUMN_H_ +#ifndef TIANMU_CORE_COLUMN_H_ +#define TIANMU_CORE_COLUMN_H_ #pragma once #include "common/common_definitions.h" #include "core/column_type.h" #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace core { enum class PackOntologicalStatus { NULLS_ONLY, UNIFORM, UNIFORM_AND_NULLS, SEQUENTIAL, NORMAL }; @@ -47,6 +47,6 @@ class Column { ColumnType ct; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_COLUMN_H_ +#endif // TIANMU_CORE_COLUMN_H_ diff --git a/storage/stonedb/core/column_bin_encoder.cpp b/storage/tianmu/core/column_bin_encoder.cpp similarity index 99% rename from storage/stonedb/core/column_bin_encoder.cpp rename to storage/tianmu/core/column_bin_encoder.cpp index 732727d52c..005c492b61 100644 --- a/storage/stonedb/core/column_bin_encoder.cpp +++ b/storage/tianmu/core/column_bin_encoder.cpp @@ -21,7 +21,7 @@ #include "core/transaction.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { ColumnBinEncoder::ColumnBinEncoder(int flags) { ignore_nulls = ((flags & ENCODER_IGNORE_NULLS) != 0); @@ -1350,4 +1350,4 @@ uint MultiindexPositionEncoder::DimByteSize(MultiIndex *mind, int dim) // how m return CalculateByteSize(no_rows); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/column_bin_encoder.h b/storage/tianmu/core/column_bin_encoder.h similarity index 99% rename from storage/stonedb/core/column_bin_encoder.h rename to storage/tianmu/core/column_bin_encoder.h index 9fbd38913d..77636e29a2 100644 --- a/storage/stonedb/core/column_bin_encoder.h +++ b/storage/tianmu/core/column_bin_encoder.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_COLUMN_BIN_ENCODER_H_ -#define STONEDB_CORE_COLUMN_BIN_ENCODER_H_ +#ifndef TIANMU_CORE_COLUMN_BIN_ENCODER_H_ +#define TIANMU_CORE_COLUMN_BIN_ENCODER_H_ #pragma once #include "core/rsi_cmap.h" #include "types/text_stat.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { class MIIterator; class MIDummyIterator; @@ -503,6 +503,6 @@ class MultiindexPositionEncoder { std::vector dim_size; // byte size of the i-th stored dimension }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_COLUMN_BIN_ENCODER_H_ \ No newline at end of file +#endif // TIANMU_CORE_COLUMN_BIN_ENCODER_H_ \ No newline at end of file diff --git a/storage/stonedb/core/column_share.cpp b/storage/tianmu/core/column_share.cpp similarity index 92% rename from storage/stonedb/core/column_share.cpp rename to storage/tianmu/core/column_share.cpp index 21157a7e54..44675ba837 100644 --- a/storage/stonedb/core/column_share.cpp +++ b/storage/tianmu/core/column_share.cpp @@ -23,9 +23,9 @@ #include "core/column_share.h" #include "core/engine.h" #include "system/rc_system.h" -#include "system/stonedb_file.h" +#include "system/tianmu_file.h" -namespace stonedb { +namespace Tianmu { namespace core { // make sure the struct is not modified by mistake static_assert(sizeof(DPN) == 80, "Bad struct size of DPN"); @@ -34,7 +34,7 @@ ColumnShare::~ColumnShare() { if (start != nullptr) { if (::munmap(start, common::COL_DN_FILE_SIZE) != 0) { // DO NOT throw in dtor! - STONEDB_LOG(LogCtl_Level::WARN, "Failed to unmap DPN file. Error %d(%s)", errno, std::strerror(errno)); + TIANMU_LOG(LogCtl_Level::WARN, "Failed to unmap DPN file. Error %d(%s)", errno, std::strerror(errno)); } } if (dn_fd >= 0) ::close(dn_fd); @@ -73,7 +73,7 @@ void ColumnShare::map_dpn() { void ColumnShare::read_meta() { auto fname = m_path / common::COL_META_FILE; - system::StoneDBFile file; + system::TianmuFile file; file.OpenReadOnly(fname); COL_META meta; @@ -109,7 +109,7 @@ void ColumnShare::read_meta() { void ColumnShare::scan_dpn(common::TX_ID xid) { COL_VER_HDR hdr{}; - system::StoneDBFile fv; + system::TianmuFile fv; fv.OpenReadOnly(m_path / common::COL_VERSION_DIR / xid.ToString()); fv.ReadExact(&hdr, sizeof(hdr)); @@ -137,7 +137,7 @@ void ColumnShare::scan_dpn(common::TX_ID xid) { start[i].synced = 1; start[i].xmax = common::MAX_XID; if (start[i].local) { - STONEDB_LOG(LogCtl_Level::WARN, "uncommited pack found: %s %d", m_path.c_str(), i); + TIANMU_LOG(LogCtl_Level::WARN, "uncommited pack found: %s %d", m_path.c_str(), i); start[i].local = 0; } if (start[i].addr != DPN_INVALID_ADDR) { @@ -153,11 +153,11 @@ void ColumnShare::scan_dpn(common::TX_ID xid) { auto second = segs.cbegin(); for (auto first = second++; second != segs.cend(); ++first, ++second) { if (second->offset < first->offset + first->len) { - STONEDB_LOG(LogCtl_Level::ERROR, "sorted beg: -------------------"); + TIANMU_LOG(LogCtl_Level::ERROR, "sorted beg: -------------------"); for (auto &it : segs) { - STONEDB_LOG(LogCtl_Level::ERROR, " %u [%ld, %ld]", it.idx, it.offset, it.len); + TIANMU_LOG(LogCtl_Level::ERROR, " %u [%ld, %ld]", it.idx, it.offset, it.len); } - STONEDB_LOG(LogCtl_Level::ERROR, "sorted end: -------------------"); + TIANMU_LOG(LogCtl_Level::ERROR, "sorted end: -------------------"); throw common::DatabaseException("bad DPN index file: " + m_path.string()); } } @@ -244,4 +244,4 @@ void ColumnShare::sync_dpns() { if (ret != 0) throw std::system_error(errno, std::system_category(), "msync() " + m_path.string()); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/column_share.h b/storage/tianmu/core/column_share.h similarity index 95% rename from storage/stonedb/core/column_share.h rename to storage/tianmu/core/column_share.h index 8a7c98367f..810f79ac79 100644 --- a/storage/stonedb/core/column_share.h +++ b/storage/tianmu/core/column_share.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_COLUMN_SHARE_H_ -#define STONEDB_CORE_COLUMN_SHARE_H_ +#ifndef TIANMU_CORE_COLUMN_SHARE_H_ +#define TIANMU_CORE_COLUMN_SHARE_H_ #pragma once #include @@ -27,7 +27,7 @@ #include "core/dpn.h" #include "util/fs.h" -namespace stonedb { +namespace Tianmu { namespace core { class TableShare; @@ -123,6 +123,6 @@ class ColumnShare final { bool has_filter_bloom = false; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_COLUMN_SHARE_H_ +#endif // TIANMU_CORE_COLUMN_SHARE_H_ diff --git a/storage/stonedb/core/column_type.cpp b/storage/tianmu/core/column_type.cpp similarity index 95% rename from storage/stonedb/core/column_type.cpp rename to storage/tianmu/core/column_type.cpp index aceb92e42a..ea47f08421 100644 --- a/storage/stonedb/core/column_type.cpp +++ b/storage/tianmu/core/column_type.cpp @@ -21,7 +21,7 @@ #include "core/data_type.h" #include "core/quick_math.h" -namespace stonedb { +namespace Tianmu { namespace core { ColumnType::ColumnType(const DataType &dt) { if (dt.IsFixed()) { @@ -37,7 +37,7 @@ ColumnType::ColumnType(const DataType &dt) { ColumnType ct(dt.attrtype, false, common::PackFmt::DEFAULT, dt.precision, 0, dt.collation); std::swap(ct, *this); } else - STONEDB_ERROR("invalid conversion DataType -> ColumnType"); + TIANMU_ERROR("invalid conversion DataType -> ColumnType"); } bool ColumnType::operator==(const ColumnType &ct2) const { @@ -69,4 +69,4 @@ ColumnType ColumnType::RemovedLookup() const { return noLookup; } } // namespace core -} // namespace stonedb \ No newline at end of file +} // namespace Tianmu \ No newline at end of file diff --git a/storage/stonedb/core/column_type.h b/storage/tianmu/core/column_type.h similarity index 97% rename from storage/stonedb/core/column_type.h rename to storage/tianmu/core/column_type.h index 1fb590f9ba..dbbd4e66cc 100644 --- a/storage/stonedb/core/column_type.h +++ b/storage/tianmu/core/column_type.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_COLUMN_TYPE_H_ -#define STONEDB_CORE_COLUMN_TYPE_H_ +#ifndef TIANMU_CORE_COLUMN_TYPE_H_ +#define TIANMU_CORE_COLUMN_TYPE_H_ #pragma once #include "common/common_definitions.h" #include "core/rc_attr_typeinfo.h" -namespace stonedb { +namespace Tianmu { namespace core { struct DataType; @@ -159,6 +159,6 @@ struct ColumnType { } }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_COLUMN_TYPE_H_ +#endif // TIANMU_CORE_COLUMN_TYPE_H_ diff --git a/storage/stonedb/core/compilation_tools.cpp b/storage/tianmu/core/compilation_tools.cpp similarity index 97% rename from storage/stonedb/core/compilation_tools.cpp rename to storage/tianmu/core/compilation_tools.cpp index 8d834025cd..e730a6d305 100644 --- a/storage/stonedb/core/compilation_tools.cpp +++ b/storage/tianmu/core/compilation_tools.cpp @@ -21,7 +21,7 @@ #include "core/mysql_expression.h" #include "core/value_set.h" -namespace stonedb { +namespace Tianmu { namespace core { Item *UnRef(Item *item) { if (!item) return 0; @@ -62,7 +62,7 @@ int OperationUnmysterify(Item *item, common::ColOperation &oper, bool &distinct, case Item::FUNC_ITEM: case Item::COND_ITEM: case Item::SUBSELECT_ITEM: - case static_cast(Item_sdbfield::enumSDBFiledItem::SDBFIELD_ITEM): + case static_cast(Item_tianmufield::enumTIANMUFiledItem::TIANMUFIELD_ITEM): case Item::FIELD_ITEM: // regular select oper = common::ColOperation::LISTING; /*GROUP_BY : LISTING;*/ break; @@ -115,7 +115,7 @@ int OperationUnmysterify(Item *item, common::ColOperation &oper, bool &distinct, break; case Item_sum::GROUP_CONCAT_FUNC: distinct = ((Item_func_group_concat *)item)->get_distinct(); - STONEDB_LOG(LogCtl_Level::DEBUG, "group_concat distinct %d, sepertator %s, direction %d", distinct, + TIANMU_LOG(LogCtl_Level::DEBUG, "group_concat distinct %d, sepertator %s, direction %d", distinct, ((Item_func_group_concat *)item)->get_separator()->c_ptr(), ((Item_func_group_concat *)item)->direction()); oper = common::ColOperation::GROUP_CONCAT; @@ -176,7 +176,7 @@ void PrintItemTree(Item *item, int indent) { if ((int)type < sizeof(name_of) / sizeof(*name_of)) name = name_of[type]; else - name = "enumSDBFiledItem::SDBFIELD_ITEM"; + name = "enumTIANMUFiledItem::TIANMUFIELD_ITEM"; const char *result = ""; switch (item->result_type()) { @@ -284,4 +284,4 @@ void PrintItemTree(char const *info, Item *item) { PrintItemTree(item); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/compilation_tools.h b/storage/tianmu/core/compilation_tools.h similarity index 89% rename from storage/stonedb/core/compilation_tools.h rename to storage/tianmu/core/compilation_tools.h index 759d7634bd..f36807dad3 100644 --- a/storage/stonedb/core/compilation_tools.h +++ b/storage/tianmu/core/compilation_tools.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_COMPILATION_TOOLS_H_ -#define STONEDB_CORE_COMPILATION_TOOLS_H_ +#ifndef TIANMU_CORE_COMPILATION_TOOLS_H_ +#define TIANMU_CORE_COMPILATION_TOOLS_H_ #pragma once #include "core/query.h" -namespace stonedb { +namespace Tianmu { namespace core { #define ASSERT_MYSQL_STRING(x) \ DEBUG_ASSERT(!x.str[x.length] && \ @@ -37,6 +37,6 @@ int OperationUnmysterify(Item *item, common::ColOperation &oper, bool &distinct, void PrintItemTree(Item *item, int indent = 0); void PrintItemTree(char const *info, Item *item); } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_COMPILATION_TOOLS_H_ +#endif // TIANMU_CORE_COMPILATION_TOOLS_H_ diff --git a/storage/stonedb/core/compiled_query.cpp b/storage/tianmu/core/compiled_query.cpp similarity index 99% rename from storage/stonedb/core/compiled_query.cpp rename to storage/tianmu/core/compiled_query.cpp index 3ecf7f2808..338914e8d3 100644 --- a/storage/stonedb/core/compiled_query.cpp +++ b/storage/tianmu/core/compiled_query.cpp @@ -20,7 +20,7 @@ #include "core/query.h" #include "vc/multi_value_column.h" -namespace stonedb { +namespace Tianmu { namespace core { CompiledQuery::CompiledQuery() { no_tabs = 0; @@ -420,7 +420,7 @@ void CompiledQuery::CQStep::Print(Query *query) { default: std::sprintf(buf, "Unsupported type of CQStep: %d", type); } - STONEDB_LOG(LogCtl_Level::DEBUG, "%s", buf); + TIANMU_LOG(LogCtl_Level::DEBUG, "%s", buf); } void CompiledQuery::TableAlias(TabID &t_out, const TabID &n, const char *name, [[maybe_unused]] int id) { @@ -899,4 +899,4 @@ TabID CompiledQuery::GetTableOfCond(const CondID &cond_id) { return TabID(); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/compiled_query.h b/storage/tianmu/core/compiled_query.h similarity index 98% rename from storage/stonedb/core/compiled_query.h rename to storage/tianmu/core/compiled_query.h index c954f5fcef..d8ba426359 100644 --- a/storage/stonedb/core/compiled_query.h +++ b/storage/tianmu/core/compiled_query.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_COMPILED_QUERY_H_ -#define STONEDB_CORE_COMPILED_QUERY_H_ +#ifndef TIANMU_CORE_COMPILED_QUERY_H_ +#define TIANMU_CORE_COMPILED_QUERY_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "core/just_a_table.h" #include "core/temp_table.h" -namespace stonedb { +namespace Tianmu { namespace core { /* CompiledQuery - for storing execution plan of a query (sequence of @@ -274,6 +274,6 @@ class CompiledQuery final { std::multimap TabIDSteps; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_COMPILED_QUERY_H_ +#endif // TIANMU_CORE_COMPILED_QUERY_H_ diff --git a/storage/stonedb/core/condition.cpp b/storage/tianmu/core/condition.cpp similarity index 98% rename from storage/stonedb/core/condition.cpp rename to storage/tianmu/core/condition.cpp index b7f734279c..bef0951dd0 100644 --- a/storage/stonedb/core/condition.cpp +++ b/storage/tianmu/core/condition.cpp @@ -19,7 +19,7 @@ #include "core/temp_table.h" -namespace stonedb { +namespace Tianmu { namespace core { void Condition::AddDescriptor(CQTerm e1, common::Operator op, CQTerm e2, CQTerm e3, TempTable *t, int no_dims, char like_esc) { @@ -79,4 +79,4 @@ void SingleTreeCondition::AddTree(common::LogicalOperator lop, DescTree *sec_tre tree = new DescTree(*sec_tree); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/condition.h b/storage/tianmu/core/condition.h similarity index 94% rename from storage/stonedb/core/condition.h rename to storage/tianmu/core/condition.h index 054e0320ac..fe967dbb5b 100644 --- a/storage/stonedb/core/condition.h +++ b/storage/tianmu/core/condition.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_CONDITION_H_ -#define STONEDB_CORE_CONDITION_H_ +#ifndef TIANMU_CORE_CONDITION_H_ +#define TIANMU_CORE_CONDITION_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "core/cq_term.h" #include "core/descriptor.h" -namespace stonedb { +namespace Tianmu { namespace core { class Condition { protected: @@ -60,6 +60,6 @@ class SingleTreeCondition : public Condition { bool IsType_Tree() override { return true; } }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_CONDITION_H_ +#endif // TIANMU_CORE_CONDITION_H_ diff --git a/storage/stonedb/core/condition_encoder.cpp b/storage/tianmu/core/condition_encoder.cpp similarity index 98% rename from storage/stonedb/core/condition_encoder.cpp rename to storage/tianmu/core/condition_encoder.cpp index 9a977d654e..ebb295104d 100644 --- a/storage/stonedb/core/condition_encoder.cpp +++ b/storage/tianmu/core/condition_encoder.cpp @@ -29,7 +29,7 @@ #include "vc/single_column.h" #include "vc/subselect_column.h" -namespace stonedb { +namespace Tianmu { namespace core { ConditionEncoder::ConditionEncoder(bool additional_nulls, uint32_t power) : additional_nulls(additional_nulls), @@ -245,10 +245,10 @@ void ConditionEncoder::TransformOtherThanINsOnNumerics() { v1 = attr->EncodeValue64(mvc->GetSetMin(mit).Get(), v1_rounded); // 1-level values } else if (desc->val1.vc->IsConst()) { - common::ErrorCode sdbrc = common::ErrorCode::SUCCESS; + common::ErrorCode tianmu_rc = common::ErrorCode::SUCCESS; v1 = attr->EncodeValue64(desc->val1.vc->GetValue(mit), v1_rounded, - &sdbrc); // 1-level values - if (sdbrc != common::ErrorCode::SUCCESS) { + &tianmu_rc); // 1-level values + if (tianmu_rc != common::ErrorCode::SUCCESS) { desc->encoded = false; throw common::DataTypeConversionException(common::ErrorCode::DATACONVERSION); } @@ -266,11 +266,11 @@ void ConditionEncoder::TransformOtherThanINsOnNumerics() { v2 = attr->EncodeValue64(mvc->GetSetMin(mit).Get(), v2_rounded); // 1-level values } else { - common::ErrorCode sdbrc = common::ErrorCode::SUCCESS; + common::ErrorCode tianmu_rc = common::ErrorCode::SUCCESS; if (!desc->val2.IsNull() && desc->val2.vc && desc->val2.vc->IsConst()) { v2 = attr->EncodeValue64(desc->val2.vc->GetValue(mit), v2_rounded, - &sdbrc); // 1-level values - if (sdbrc != common::ErrorCode::SUCCESS) { + &tianmu_rc); // 1-level values + if (tianmu_rc != common::ErrorCode::SUCCESS) { desc->encoded = false; throw common::DataTypeConversionException(common::ErrorCode::DATACONVERSION); } @@ -817,4 +817,4 @@ void ConditionEncoder::LookupExpressionTransformation() { } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/condition_encoder.h b/storage/tianmu/core/condition_encoder.h similarity index 92% rename from storage/stonedb/core/condition_encoder.h rename to storage/tianmu/core/condition_encoder.h index 9da8005869..d199140ecd 100644 --- a/storage/stonedb/core/condition_encoder.h +++ b/storage/tianmu/core/condition_encoder.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_CONDITION_ENCODER_H_ -#define STONEDB_CORE_CONDITION_ENCODER_H_ +#ifndef TIANMU_CORE_CONDITION_ENCODER_H_ +#define TIANMU_CORE_CONDITION_ENCODER_H_ #pragma once #include "common/common_definitions.h" #include "core/column_type.h" #include "core/rc_attr.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { class MultiValColumn; } // namespace vcolumn @@ -73,6 +73,6 @@ class ConditionEncoder { uint32_t pack_power; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_CONDITION_ENCODER_H_ +#endif // TIANMU_CORE_CONDITION_ENCODER_H_ diff --git a/storage/stonedb/core/cq_term.cpp b/storage/tianmu/core/cq_term.cpp similarity index 98% rename from storage/stonedb/core/cq_term.cpp rename to storage/tianmu/core/cq_term.cpp index e3ec297183..338f461a6f 100644 --- a/storage/stonedb/core/cq_term.cpp +++ b/storage/tianmu/core/cq_term.cpp @@ -24,7 +24,7 @@ #include "types/value_parser4txt.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { CQTerm::CQTerm() : type(common::CT::UNK), vc(NULL), vc_id(common::NULL_VALUE_32), is_vc_owner(false) {} @@ -99,4 +99,4 @@ char *CQTerm::ToString(char p_buf[], size_t buf_ct, int tab_id) const { return p_buf; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/cq_term.h b/storage/tianmu/core/cq_term.h similarity index 96% rename from storage/stonedb/core/cq_term.h rename to storage/tianmu/core/cq_term.h index 90e21ccac0..b3309fc134 100644 --- a/storage/stonedb/core/cq_term.h +++ b/storage/tianmu/core/cq_term.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_CQ_TERM_H_ -#define STONEDB_CORE_CQ_TERM_H_ +#ifndef TIANMU_CORE_CQ_TERM_H_ +#define TIANMU_CORE_CQ_TERM_H_ #pragma once #include "common/common_definitions.h" #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { class VirtualColumn; @@ -112,6 +112,6 @@ struct CQTerm { char *ToString(char p_buf[], size_t buf_ct, int tab_id) const; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_CQ_TERM_H_ +#endif // TIANMU_CORE_CQ_TERM_H_ diff --git a/storage/stonedb/core/ctask.h b/storage/tianmu/core/ctask.h similarity index 89% rename from storage/stonedb/core/ctask.h rename to storage/tianmu/core/ctask.h index 22fbe6e291..9a4b2d1a28 100644 --- a/storage/stonedb/core/ctask.h +++ b/storage/tianmu/core/ctask.h @@ -14,11 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_CTASK_H_ -#define STONEDB_CORE_CTASK_H_ +#ifndef TIANMU_CORE_CTASK_H_ +#define TIANMU_CORE_CTASK_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace core { struct CTask { int dwTaskId; // task id @@ -29,6 +29,6 @@ struct CTask { CTask() : dwTaskId(0), dwPackNum(0), dwEndPackno(0), dwTuple(0), dwStartPackno(0) {} }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_CTASK_H_ +#endif // TIANMU_CORE_CTASK_H_ diff --git a/storage/stonedb/core/data_cache.cpp b/storage/tianmu/core/data_cache.cpp similarity index 98% rename from storage/stonedb/core/data_cache.cpp rename to storage/tianmu/core/data_cache.cpp index 90e26e59cc..e84344bd0d 100644 --- a/storage/stonedb/core/data_cache.cpp +++ b/storage/tianmu/core/data_cache.cpp @@ -19,7 +19,7 @@ #include "core/rc_attr.h" -namespace stonedb { +namespace Tianmu { namespace core { void DataCache::ReleaseAll() { _packs.clear(); @@ -114,4 +114,4 @@ std::condition_variable_any &DataCache::condition() { return (_ftreeWaitIO); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/data_cache.h b/storage/tianmu/core/data_cache.h similarity index 96% rename from storage/stonedb/core/data_cache.h rename to storage/tianmu/core/data_cache.h index 3232f4be5f..8a0c3d7354 100644 --- a/storage/stonedb/core/data_cache.h +++ b/storage/tianmu/core/data_cache.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_DATA_CACHE_H_ -#define STONEDB_CORE_DATA_CACHE_H_ +#ifndef TIANMU_CORE_DATA_CACHE_H_ +#define TIANMU_CORE_DATA_CACHE_H_ #pragma once #include @@ -26,7 +26,7 @@ #include "core/pack.h" -namespace stonedb { +namespace Tianmu { namespace core { using TraceableObjectPtr = std::shared_ptr; @@ -96,7 +96,7 @@ class DataCache final { if constexpr (T::ID == COORD_TYPE::PACK) { p->TrackAccess(); // int objnum = c.size(); - // STONEDB_LOG(LogCtl_Level::DEBUG, "PutObject packs objnum %d + // TIANMU_LOG(LogCtl_Level::DEBUG, "PutObject packs objnum %d // (table:%d,pack:%d,clounm:%d)", objnum,pc_table(coord_), // pc_dp(coord_), pc_column(coord_)); } @@ -118,7 +118,7 @@ class DataCache final { if (it != c.end()) { // if (T::ID == COORD_TYPE::PACK) { // int objnum = c.size(); - // STONEDB_LOG(LogCtl_Level::DEBUG, "DropObject packs objnum %d + // TIANMU_LOG(LogCtl_Level::DEBUG, "DropObject packs objnum %d // (table:%d,pack:%d,clounm:%d)", objnum,pc_table(coord_), // pc_dp(coord_), pc_column(coord_)); //} @@ -271,6 +271,6 @@ class DataCache final { std::unordered_map const &cache() const; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_DATA_CACHE_H_ +#endif // TIANMU_CORE_DATA_CACHE_H_ diff --git a/storage/stonedb/core/data_type.cpp b/storage/tianmu/core/data_type.cpp similarity index 88% rename from storage/stonedb/core/data_type.cpp rename to storage/tianmu/core/data_type.cpp index 0081c54a28..3a824e8697 100644 --- a/storage/stonedb/core/data_type.cpp +++ b/storage/tianmu/core/data_type.cpp @@ -21,7 +21,7 @@ #include "core/column_type.h" #include "core/quick_math.h" -namespace stonedb { +namespace Tianmu { namespace core { #define MAX(a, b) ((a) > (b) ? (a) : (b)) @@ -35,23 +35,23 @@ DataType::DataType(common::CT atype, int prec, int scale, DTCollation collation) switch (attrtype) { case common::CT::INT: valtype = ValueType::VT_FIXED; - fixmax = MAX(std::numeric_limits::max(), -SDB_INT_MIN); + fixmax = MAX(std::numeric_limits::max(), -TIANMU_INT_MIN); break; case common::CT::BIGINT: valtype = ValueType::VT_FIXED; - fixmax = MAX(common::SDB_BIGINT_MAX, -common::SDB_BIGINT_MIN); + fixmax = MAX(common::TIANMU_BIGINT_MAX, -common::TIANMU_BIGINT_MIN); break; case common::CT::MEDIUMINT: valtype = ValueType::VT_FIXED; - fixmax = MAX(SDB_MEDIUMINT_MAX, -SDB_MEDIUMINT_MIN); + fixmax = MAX(TIANMU_MEDIUMINT_MAX, -TIANMU_MEDIUMINT_MIN); break; case common::CT::SMALLINT: valtype = ValueType::VT_FIXED; - fixmax = MAX(SDB_SMALLINT_MAX, -SDB_SMALLINT_MIN); + fixmax = MAX(TIANMU_SMALLINT_MAX, -TIANMU_SMALLINT_MIN); break; case common::CT::BYTEINT: valtype = ValueType::VT_FIXED; - fixmax = MAX(SDB_TINYINT_MAX, -SDB_TINYINT_MIN); + fixmax = MAX(TIANMU_TINYINT_MAX, -TIANMU_TINYINT_MIN); break; case common::CT::NUM: @@ -111,4 +111,4 @@ DataType &DataType::operator=(const ColumnType &ct) { return *this; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/data_type.h b/storage/tianmu/core/data_type.h similarity index 92% rename from storage/stonedb/core/data_type.h rename to storage/tianmu/core/data_type.h index 70977fc411..d537f23e60 100644 --- a/storage/stonedb/core/data_type.h +++ b/storage/tianmu/core/data_type.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_DATA_TYPE_H_ -#define STONEDB_CORE_DATA_TYPE_H_ +#ifndef TIANMU_CORE_DATA_TYPE_H_ +#define TIANMU_CORE_DATA_TYPE_H_ #pragma once #include "common/common_definitions.h" -namespace stonedb { +namespace Tianmu { namespace core { struct ColumnType; @@ -36,7 +36,7 @@ struct ColumnType; struct DataType final { enum class ValueType { VT_FLOAT, VT_FIXED, VT_STRING, VT_DATETIME, VT_NOTKNOWN = 255 }; ValueType valtype; - common::CT attrtype; // storage type of SDB (only for source columns; + common::CT attrtype; // storage type of TIANMU (only for source columns; // otherwise common::CT::UNK) int fixscale; // base-10 scale of ValueType::VT_FIXED (no. of decimal digits after // comma) @@ -65,6 +65,6 @@ struct DataType final { bool IsDateTime() const { return valtype == ValueType::VT_DATETIME; } }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_DATA_TYPE_H_ +#endif // TIANMU_CORE_DATA_TYPE_H_ diff --git a/storage/stonedb/core/descriptor.cpp b/storage/tianmu/core/descriptor.cpp similarity index 99% rename from storage/stonedb/core/descriptor.cpp rename to storage/tianmu/core/descriptor.cpp index 5e4e48a5b6..a8e841dec4 100644 --- a/storage/stonedb/core/descriptor.cpp +++ b/storage/tianmu/core/descriptor.cpp @@ -32,7 +32,7 @@ #include "vc/subselect_column.h" #include "vc/type_cast_column.h" -namespace stonedb { +namespace Tianmu { namespace core { inline bool IsVirtualColumnEqual(vcolumn::VirtualColumn *vc_left, vcolumn::VirtualColumn *vc_right) { if (vc_left && vc_left->IsTypeCastColumn() && vc_right && vc_right->IsTypeCastColumn()) { @@ -376,7 +376,7 @@ bool Descriptor::IsType_AttrAttr() const // true if "column op column" from one return true; } -bool Descriptor::IsType_STONEDBExpression() const // only columns, constants and STONEDBExpressions +bool Descriptor::IsType_TIANMUExpression() const // only columns, constants and TIANMUExpressions { if (attr.vc == NULL) return false; if ((static_cast(attr.vc->IsSingleColumn()) || attr.vc->IsConst()) && @@ -1715,12 +1715,12 @@ bool Descriptor::WithoutTypeCast() { (!val2.vc || !val2.vc->IsTypeCastColumn()); } -bool Descriptor::IsSDBItemsEmpty() { +bool Descriptor::IsTIANMUItemsEmpty() { if (IsType_OrTree()) - return tree->IsSDBItemsEmpty(); + return tree->IsTIANMUItemsEmpty(); else - return (!attr.vc || attr.vc->GetSDBItems().empty()) && (!val1.vc || val1.vc->GetSDBItems().empty()) && - (!val2.vc || val2.vc->GetSDBItems().empty()); + return (!attr.vc || attr.vc->GetTIANMUItems().empty()) && (!val1.vc || val1.vc->GetTIANMUItems().empty()) && + (!val2.vc || val2.vc->GetTIANMUItems().empty()); } void Descriptor::CoerceCollation() { @@ -1803,7 +1803,7 @@ bool Descriptor::ExsitTmpTable() const { } bool Descriptor::IsleftIndexSearch() const { - if (!stonedb_sysvar_index_search || IsType_OrTree()) return false; + if (!tianmu_sysvar_index_search || IsType_OrTree()) return false; if (IsType_AttrValOrAttrValVal() && encoded) { auto col = static_cast(attr.vc); if (table && table->NumOfTables() == 1 && table->GetTableP(0)->TableType() == TType::TABLE && @@ -2445,11 +2445,11 @@ void DescTreeNode::MakeSingleColsPrivate(std::vector & } } -bool DescTreeNode::IsSDBItemsEmpty() { +bool DescTreeNode::IsTIANMUItemsEmpty() { if (left && right) - return left->IsSDBItemsEmpty() && right->IsSDBItemsEmpty(); + return left->IsTIANMUItemsEmpty() && right->IsTIANMUItemsEmpty(); else - return desc.IsSDBItemsEmpty(); + return desc.IsTIANMUItemsEmpty(); } bool DescTreeNode::WithoutAttrs() { @@ -2649,4 +2649,4 @@ void DescTreeNode::MEvaluatePack(MIUpdatingIterator &mit, int taskid) { } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/descriptor.h b/storage/tianmu/core/descriptor.h similarity index 97% rename from storage/stonedb/core/descriptor.h rename to storage/tianmu/core/descriptor.h index ee1ee89c9b..11f45a4d78 100644 --- a/storage/stonedb/core/descriptor.h +++ b/storage/tianmu/core/descriptor.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_DESCRIPTOR_H_ -#define STONEDB_CORE_DESCRIPTOR_H_ +#ifndef TIANMU_CORE_DESCRIPTOR_H_ +#define TIANMU_CORE_DESCRIPTOR_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "core/cq_term.h" #include "core/dimension_group.h" -namespace stonedb { +namespace Tianmu { namespace core { class ParameterizedFilter; class MIIterator; @@ -92,7 +92,7 @@ class Descriptor { bool IsEmpty() const { return op == common::Operator::O_UNKNOWN_FUNC; } bool IsTrue() const { return op == common::Operator::O_TRUE; } bool IsFalse() const { return op == common::Operator::O_FALSE; } - bool IsSDBItemsEmpty(); + bool IsTIANMUItemsEmpty(); bool WithoutAttrs(); bool WithoutTypeCast(); @@ -122,7 +122,7 @@ class Descriptor { DescriptorJoinType GetJoinType() const { return desc_t; } bool IsType_Subquery(); - bool IsType_STONEDBExpression() const; // only columns, constants and STONEDBExpressions + bool IsType_TIANMUExpression() const; // only columns, constants and TIANMUExpressions bool IsType_JoinComplex() const; bool IsType_Join() const { return (IsType_JoinSimple() || IsType_JoinComplex()); } bool IsDelayed() const { return delayed; } @@ -258,7 +258,7 @@ struct DescTreeNode { void RoughAccumulate(MIIterator &mit); void ClearRoughValues(); void MakeSingleColsPrivate(std::vector &virt_cols); - bool IsSDBItemsEmpty(); + bool IsTIANMUItemsEmpty(); bool WithoutAttrs(); bool WithoutTypeCast(); // for muti-thread @@ -330,11 +330,11 @@ class DescTree { void RoughAccumulate(MIIterator &mit) { root->RoughAccumulate(mit); } bool UseRoughAccumulated() { return root->UseRoughAccumulated(); } // true if anything to simplify void MakeSingleColsPrivate(std::vector &virt_cols); - bool IsSDBItemsEmpty() { return root->IsSDBItemsEmpty(); } + bool IsTIANMUItemsEmpty() { return root->IsTIANMUItemsEmpty(); } bool WithoutAttrs() { return root->WithoutAttrs(); } bool WithoutTypeCast() { return root->WithoutTypeCast(); } }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_DESCRIPTOR_H_ +#endif // TIANMU_CORE_DESCRIPTOR_H_ diff --git a/storage/stonedb/core/dimension_group.cpp b/storage/tianmu/core/dimension_group.cpp similarity index 99% rename from storage/stonedb/core/dimension_group.cpp rename to storage/tianmu/core/dimension_group.cpp index f4bbd8d6e9..0e8041f4ca 100644 --- a/storage/stonedb/core/dimension_group.cpp +++ b/storage/tianmu/core/dimension_group.cpp @@ -18,7 +18,7 @@ #include "dimension_group.h" #include -namespace stonedb { +namespace Tianmu { namespace core { DimensionGroupFilter::DimensionGroupFilter(int dim, int64_t size, uint32_t power) { base_dim = dim; @@ -369,4 +369,4 @@ bool DimensionGroupMaterialized::DGMaterializedIterator::BarrierAfterPackrow() { return false; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/dimension_group.h b/storage/tianmu/core/dimension_group.h similarity index 99% rename from storage/stonedb/core/dimension_group.h rename to storage/tianmu/core/dimension_group.h index b0c3d9b915..1955b523b9 100644 --- a/storage/stonedb/core/dimension_group.h +++ b/storage/tianmu/core/dimension_group.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_DIMENSION_GROUP_H_ -#define STONEDB_CORE_DIMENSION_GROUP_H_ +#ifndef TIANMU_CORE_DIMENSION_GROUP_H_ +#define TIANMU_CORE_DIMENSION_GROUP_H_ #pragma once #include "core/bin_tools.h" @@ -23,7 +23,7 @@ #include "core/filter.h" #include "core/index_table.h" -namespace stonedb { +namespace Tianmu { namespace core { class PackOrderer; @@ -412,6 +412,6 @@ class DimensionGroupMaterialized : public DimensionGroup { bool *nulls_possible; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_DIMENSION_GROUP_H_ +#endif // TIANMU_CORE_DIMENSION_GROUP_H_ diff --git a/storage/stonedb/core/dimension_group_multiple.cpp b/storage/tianmu/core/dimension_group_multiple.cpp similarity index 99% rename from storage/stonedb/core/dimension_group_multiple.cpp rename to storage/tianmu/core/dimension_group_multiple.cpp index 4375102f75..af8b442647 100644 --- a/storage/stonedb/core/dimension_group_multiple.cpp +++ b/storage/tianmu/core/dimension_group_multiple.cpp @@ -17,7 +17,7 @@ #include "core/dimension_group_multiple.h" -namespace stonedb { +namespace Tianmu { namespace core { bool IndexTableItem::FindPackEnd(int64_t pos, int64_t *cur_pack, int64_t *next_pack_pos) { if (pos < 0 || pos >= count_) return false; @@ -387,4 +387,4 @@ bool DimensionGroupMultiMaterialized::DGIterator::GetSlices(std::vector return supported; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/dimension_group_multiple.h b/storage/tianmu/core/dimension_group_multiple.h similarity index 97% rename from storage/stonedb/core/dimension_group_multiple.h rename to storage/tianmu/core/dimension_group_multiple.h index 1e60f57542..3213a12244 100644 --- a/storage/stonedb/core/dimension_group_multiple.h +++ b/storage/tianmu/core/dimension_group_multiple.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_DIMENSION_GROUP_MULTIPLE_H_ -#define STONEDB_CORE_DIMENSION_GROUP_MULTIPLE_H_ +#ifndef TIANMU_CORE_DIMENSION_GROUP_MULTIPLE_H_ +#define TIANMU_CORE_DIMENSION_GROUP_MULTIPLE_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "core/filter.h" #include "core/index_table.h" -namespace stonedb { +namespace Tianmu { namespace core { class MultiIndexTable; @@ -198,6 +198,6 @@ class DimensionGroupMultiMaterialized : public DimensionGroup { std::vector dim_tables_; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_DIMENSION_GROUP_MULTIPLE_H_ +#endif // TIANMU_CORE_DIMENSION_GROUP_MULTIPLE_H_ diff --git a/storage/stonedb/core/dimension_group_virtual.cpp b/storage/tianmu/core/dimension_group_virtual.cpp similarity index 99% rename from storage/stonedb/core/dimension_group_virtual.cpp rename to storage/tianmu/core/dimension_group_virtual.cpp index b7e2cdc0cf..a82e9d79d9 100644 --- a/storage/stonedb/core/dimension_group_virtual.cpp +++ b/storage/tianmu/core/dimension_group_virtual.cpp @@ -18,7 +18,7 @@ #include "dimension_group_virtual.h" #include -namespace stonedb { +namespace Tianmu { namespace core { DimensionGroupVirtual::DimensionGroupVirtual(DimensionVector &dims, int bdim, Filter *f_source, int copy_mode) // copy_mode: 0 - copy filter, 1 - ShallowCopy filter, 2 - @@ -330,4 +330,4 @@ int64_t DimensionGroupVirtual::DGVirtualOrderedIterator::GetCurPos(int dim) { return res - 1; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/dimension_group_virtual.h b/storage/tianmu/core/dimension_group_virtual.h similarity index 97% rename from storage/stonedb/core/dimension_group_virtual.h rename to storage/tianmu/core/dimension_group_virtual.h index 05d4843b27..f1d95b9661 100644 --- a/storage/stonedb/core/dimension_group_virtual.h +++ b/storage/tianmu/core/dimension_group_virtual.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_DIMENSION_GROUP_VIRTUAL_H_ -#define STONEDB_CORE_DIMENSION_GROUP_VIRTUAL_H_ +#ifndef TIANMU_CORE_DIMENSION_GROUP_VIRTUAL_H_ +#define TIANMU_CORE_DIMENSION_GROUP_VIRTUAL_H_ #pragma once #include "core/dimension_group.h" -namespace stonedb { +namespace Tianmu { namespace core { class DimensionGroupVirtual : public DimensionGroup { @@ -157,6 +157,6 @@ class DimensionGroupVirtual : public DimensionGroup { bool *nulls_possible; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_DIMENSION_GROUP_VIRTUAL_H_ +#endif // TIANMU_CORE_DIMENSION_GROUP_VIRTUAL_H_ diff --git a/storage/stonedb/core/dimension_vector.h b/storage/tianmu/core/dimension_vector.h similarity index 95% rename from storage/stonedb/core/dimension_vector.h rename to storage/tianmu/core/dimension_vector.h index add4ed847d..2c3cf71ec4 100644 --- a/storage/stonedb/core/dimension_vector.h +++ b/storage/tianmu/core/dimension_vector.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_DIMENSION_VECTOR_H_ -#define STONEDB_CORE_DIMENSION_VECTOR_H_ +#ifndef TIANMU_CORE_DIMENSION_VECTOR_H_ +#define TIANMU_CORE_DIMENSION_VECTOR_H_ #pragma once #include #include "common/assert.h" -namespace stonedb { +namespace Tianmu { namespace core { class DimensionVector { public: @@ -109,6 +109,6 @@ class DimensionVector { std::vector v; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_DIMENSION_VECTOR_H_ +#endif // TIANMU_CORE_DIMENSION_VECTOR_H_ diff --git a/storage/stonedb/core/dpn.h b/storage/tianmu/core/dpn.h similarity index 96% rename from storage/stonedb/core/dpn.h rename to storage/tianmu/core/dpn.h index 208932b7c9..905d945167 100644 --- a/storage/stonedb/core/dpn.h +++ b/storage/tianmu/core/dpn.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_DPN_H_ -#define STONEDB_CORE_DPN_H_ +#ifndef TIANMU_CORE_DPN_H_ +#define TIANMU_CORE_DPN_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "common/common_definitions.h" -namespace stonedb { +namespace Tianmu { namespace core { constexpr uint64_t tag_one = (1L << 48); constexpr uint64_t tag_mask = 0x0000FFFFFFFFFFFF; @@ -101,6 +101,6 @@ struct DPN final { const uint64_t DPN_INVALID_ADDR = -1; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_DPN_H_ +#endif // TIANMU_CORE_DPN_H_ diff --git a/storage/stonedb/core/engine.cpp b/storage/tianmu/core/engine.cpp similarity index 79% rename from storage/stonedb/core/engine.cpp rename to storage/tianmu/core/engine.cpp index 23ea7e28b4..ceecad51c2 100644 --- a/storage/stonedb/core/engine.cpp +++ b/storage/tianmu/core/engine.cpp @@ -43,7 +43,7 @@ #include "mysql/thread_pool_priv.h" #include "thr_lock.h" -namespace stonedb { +namespace Tianmu { namespace dbhandler { extern void resolve_async_join_settings(const std::string &settings); } @@ -51,13 +51,13 @@ namespace core { #ifdef PROFILE_LOCK_WAITING LockProfiler lock_profiler; #endif -constexpr auto BUFFER_FILE = "STONEDB_INSERT_BUFFER"; +constexpr auto BUFFER_FILE = "TIANMU_INSERT_BUFFER"; namespace { // It should be immutable after RCEngine initialization -std::vector stonedb_data_dirs; +std::vector tianmu_data_dirs; std::mutex v_mtx; -const char *STONEDB_DATA_DIR = "stonedb_data"; +const char *TIANMU_DATA_DIR = "tianmu_data"; } // namespace static void signal_handler([[maybe_unused]] int sig, siginfo_t *si, [[maybe_unused]] void *uc) { @@ -72,7 +72,7 @@ static int setup_sig_handler() { sigemptyset(&sa.sa_mask); if (sigaction(SIGRTMIN, &sa, NULL) == -1) { - STONEDB_LOG(LogCtl_Level::INFO, "Failed to set up signal handler. error =%d[%s]", errno, std::strerror(errno)); + TIANMU_LOG(LogCtl_Level::INFO, "Failed to set up signal handler. error =%d[%s]", errno, std::strerror(errno)); return 1; } return 0; @@ -81,43 +81,43 @@ static int setup_sig_handler() { fs::path Engine::GetNextDataDir() { std::scoped_lock guard(v_mtx); - if (stonedb_data_dirs.empty()) { + if (tianmu_data_dirs.empty()) { // fall back to use MySQL data directory - auto p = rceng->stonedb_data_dir / STONEDB_DATA_DIR; + auto p = rceng->tianmu_data_dir / TIANMU_DATA_DIR; if (!fs::is_directory(p)) fs::create_directory(p); return p; } - auto sz = stonedb_data_dirs.size(); + auto sz = tianmu_data_dirs.size(); if (sz == 1) { // we have no choice - return stonedb_data_dirs[0]; + return tianmu_data_dirs[0]; } - if (stonedb_sysvar_dist_policy == 1) { - return stonedb_data_dirs[std::rand() % sz]; - } else if (stonedb_sysvar_dist_policy == 2) { - auto v = stonedb_data_dirs; + if (tianmu_sysvar_dist_policy == 1) { + return tianmu_data_dirs[std::rand() % sz]; + } else if (tianmu_sysvar_dist_policy == 2) { + auto v = tianmu_data_dirs; v.erase(std::remove_if(v.begin(), v.end(), [](const fs::path &s) { auto si = fs::space(s); auto usage = 100 - ((si.available * 100) / si.capacity); - if (usage > static_cast(stonedb_sysvar_disk_usage_threshold)) { - STONEDB_LOG(LogCtl_Level::WARN, "disk %s usage %d%%", s.native().c_str(), usage); + if (usage > static_cast(tianmu_sysvar_disk_usage_threshold)) { + TIANMU_LOG(LogCtl_Level::WARN, "disk %s usage %d%%", s.native().c_str(), usage); return true; } return false; }), v.end()); if (v.size() == 0) { - STONEDB_LOG(LogCtl_Level::ERROR, "all data directories usage exceed %d%%", stonedb_sysvar_disk_usage_threshold); + TIANMU_LOG(LogCtl_Level::ERROR, "all data directories usage exceed %d%%", tianmu_sysvar_disk_usage_threshold); throw common::Exception("Disk usage exceeds defined threshold"); } return v[std::rand() % v.size()]; } // round-robin static int idx = 0; - return stonedb_data_dirs[idx++ % sz]; + return tianmu_data_dirs[idx++ % sz]; } static int has_pack(const LEX_STRING &comment) { @@ -160,7 +160,7 @@ static std::string has_mem_name(const LEX_STRING &comment) { return name; } -bool parameter_equals(THD *thd, enum sdb_var_name vn, longlong value) { +bool parameter_equals(THD *thd, enum tianmu_var_name vn, longlong value) { longlong param = 0; std::string s_res; @@ -180,39 +180,39 @@ bool Engine::TrxCmp::operator()(Transaction *l, Transaction *r) const { return l Engine::Engine() : delay_insert_thread_pool( "bg_loader", - stonedb_sysvar_bg_load_threads - ? stonedb_sysvar_bg_load_threads + tianmu_sysvar_bg_load_threads + ? tianmu_sysvar_bg_load_threads : ((std::thread::hardware_concurrency() / 2) ? (std::thread::hardware_concurrency() / 2) : 1)), load_thread_pool("loader", - stonedb_sysvar_load_threads ? stonedb_sysvar_load_threads : std::thread::hardware_concurrency()), + tianmu_sysvar_load_threads ? tianmu_sysvar_load_threads : std::thread::hardware_concurrency()), query_thread_pool( - "query", stonedb_sysvar_query_threads ? stonedb_sysvar_query_threads : std::thread::hardware_concurrency()), - insert_buffer(BUFFER_FILE, stonedb_sysvar_insert_buffer_size) { - stonedb_data_dir = mysql_real_data_home; + "query", tianmu_sysvar_query_threads ? tianmu_sysvar_query_threads : std::thread::hardware_concurrency()), + insert_buffer(BUFFER_FILE, tianmu_sysvar_insert_buffer_size) { + tianmu_data_dir = mysql_real_data_home; } int Engine::Init(uint engine_slot) { m_slot = engine_slot; ConfigureRCControl(); - if (stonedb_sysvar_controlquerylog > 0) { + if (tianmu_sysvar_controlquerylog > 0) { rcquerylog.setOn(); } else { rcquerylog.setOff(); } std::srand(unsigned(time(NULL))); - if (stonedb_sysvar_servermainheapsize == 0) { + if (tianmu_sysvar_servermainheapsize == 0) { long pages = sysconf(_SC_PHYS_PAGES); long pagesize = sysconf(_SC_PAGESIZE); if (pagesize > 0 && pages > 0) { - stonedb_sysvar_servermainheapsize = pages * pagesize / 1_MB / 2; + tianmu_sysvar_servermainheapsize = pages * pagesize / 1_MB / 2; } else { - stonedb_sysvar_servermainheapsize = 10000; + tianmu_sysvar_servermainheapsize = 10000; } } - size_t main_size = size_t(stonedb_sysvar_servermainheapsize) << 20; + size_t main_size = size_t(tianmu_sysvar_servermainheapsize) << 20; - std::string hugefiledir = stonedb_sysvar_hugefiledir; + std::string hugefiledir = tianmu_sysvar_hugefiledir; int hugefilesize = 0; // unused if (hugefiledir.empty()) mm::MemoryManagerInitializer::Instance(0, main_size); @@ -221,7 +221,7 @@ int Engine::Init(uint engine_slot) { the_filter_block_owner = new TheFilterBlockOwner(); - std::string cachefolder_path = stonedb_sysvar_cachefolder; + std::string cachefolder_path = tianmu_sysvar_cachefolder; boost::trim(cachefolder_path); boost::trim_if(cachefolder_path, boost::is_any_of("\"")); if (SetUpCacheFolder(cachefolder_path) != 0) return 1; @@ -232,23 +232,23 @@ int Engine::Init(uint engine_slot) { #ifdef FUNCTIONS_EXECUTION_TIMES fet = new FunctionsExecutionTimes(); #endif - STONEDB_LOG(LogCtl_Level::INFO, "StoneDB engine started. "); - STONEDB_LOG(LogCtl_Level::INFO, "StoneDB data directories:"); - STONEDB_LOG(LogCtl_Level::INFO, " {"); - if (stonedb_data_dirs.empty()) - STONEDB_LOG(LogCtl_Level::INFO, " default"); + TIANMU_LOG(LogCtl_Level::INFO, "Tianmu engine started. "); + TIANMU_LOG(LogCtl_Level::INFO, "Tianmu data directories:"); + TIANMU_LOG(LogCtl_Level::INFO, " {"); + if (tianmu_data_dirs.empty()) + TIANMU_LOG(LogCtl_Level::INFO, " default"); else - for (auto &dir : stonedb_data_dirs) { + for (auto &dir : tianmu_data_dirs) { auto si = fs::space(dir); - STONEDB_LOG(LogCtl_Level::INFO, " %s capacity/available: %ld/%ld", dir.native().c_str(), si.capacity, + TIANMU_LOG(LogCtl_Level::INFO, " %s capacity/available: %ld/%ld", dir.native().c_str(), si.capacity, si.available); } - STONEDB_LOG(LogCtl_Level::INFO, " }"); + TIANMU_LOG(LogCtl_Level::INFO, " }"); - STONEDB_LOG(LogCtl_Level::INFO, "StoneDB thread pool for background load, size = %ld", + TIANMU_LOG(LogCtl_Level::INFO, "Tianmu thread pool for background load, size = %ld", delay_insert_thread_pool.size()); - STONEDB_LOG(LogCtl_Level::INFO, "StoneDB thread pool for load, size = %ld", load_thread_pool.size()); - STONEDB_LOG(LogCtl_Level::INFO, "StoneDB thread pool for query, size = %ld", query_thread_pool.size()); + TIANMU_LOG(LogCtl_Level::INFO, "Tianmu thread pool for load, size = %ld", load_thread_pool.size()); + TIANMU_LOG(LogCtl_Level::INFO, "Tianmu thread pool for query, size = %ld", query_thread_pool.size()); m_monitor_thread = std::thread([this] { struct job { @@ -258,7 +258,7 @@ int Engine::Init(uint engine_slot) { {60, [this]() { this->LogStat(); }}, {60 * 5, []() { - STONEDB_LOG( + TIANMU_LOG( LogCtl_Level::INFO, "Memory: release [%llu %llu %llu %llu] %llu, total " "%llu. (un)freeable %lu/%lu, total alloc/free " @@ -278,13 +278,13 @@ int Engine::Init(uint engine_slot) { counter++; std::unique_lock lk(cv_mtx); if (cv.wait_for(lk, std::chrono::seconds(loop_interval)) == std::cv_status::timeout) { - if (!stonedb_sysvar_qps_log) continue; + if (!tianmu_sysvar_qps_log) continue; for (auto &j : jobs) { if (counter % (j.interval / loop_interval) == 0) j.func(); } } } - STONEDB_LOG(LogCtl_Level::INFO, "StoneDB monitor thread exiting..."); + TIANMU_LOG(LogCtl_Level::INFO, "Tianmu monitor thread exiting..."); }); m_load_thread = std::thread([this] { ProcessDelayedInsert(); }); @@ -296,15 +296,15 @@ int Engine::Init(uint engine_slot) { std::unique_lock lk(cv_mtx); if (cv.wait_for(lk, std::chrono::seconds(3)) == std::cv_status::timeout) HandleDeferredJobs(); } while (!exiting); - STONEDB_LOG(LogCtl_Level::INFO, "StoneDB file purge thread exiting..."); + TIANMU_LOG(LogCtl_Level::INFO, "Tianmu file purge thread exiting..."); }); if (setup_sig_handler()) { return -1; } - if (stonedb_sysvar_start_async > 0) ResetTaskExecutor(stonedb_sysvar_start_async); - dbhandler::resolve_async_join_settings(stonedb_sysvar_async_join); + if (tianmu_sysvar_start_async > 0) ResetTaskExecutor(tianmu_sysvar_start_async); + dbhandler::resolve_async_join_settings(tianmu_sysvar_async_join); return 0; } @@ -319,7 +319,7 @@ void Engine::HandleDeferredJobs() { fs::remove(t.file, ec); // Ignore ENOENT since files might be deleted by 'drop table'. if (ec && ec != std::errc::no_such_file_or_directory) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to remove file %s Error:%s", t.file.string().c_str(), ec.message()); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to remove file %s Error:%s", t.file.string().c_str(), ec.message()); } } else { gc_tasks.emplace_back(t); @@ -338,7 +338,7 @@ Engine::~Engine() { std::scoped_lock lk(cv_mtx); std::scoped_lock lk_merge(cv_merge_mtx); exiting = true; - STONEDB_LOG(LogCtl_Level::INFO, "StoneDB engine shutting down."); + TIANMU_LOG(LogCtl_Level::INFO, "Tianmu engine shutting down."); } cv.notify_all(); cv_merge.notify_all(); @@ -357,16 +357,16 @@ Engine::~Engine() { try { mm::MemoryManagerInitializer::EnsureNoLeakedTraceableObject(); } catch (common::AssertException &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Memory leak! %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Memory leak! %s", e.what()); } catch (...) { - STONEDB_LOG(LogCtl_Level::ERROR, "Unkown exception caught"); + TIANMU_LOG(LogCtl_Level::ERROR, "Unkown exception caught"); } if (rccontrol.isOn()) mm::MemoryManagerInitializer::deinit(true); else mm::MemoryManagerInitializer::deinit(false); - STONEDB_LOG(LogCtl_Level::INFO, "StoneDB engine destroyed."); + TIANMU_LOG(LogCtl_Level::INFO, "Tianmu engine destroyed."); } void Engine::EncodeRecord(const std::string &table_path, int tid, Field **field, size_t col, size_t blobs, @@ -425,19 +425,19 @@ void Engine::EncodeRecord(const std::string &table_path, int tid, Field **field, switch (f->type()) { case MYSQL_TYPE_TINY: { int64_t v = f->val_int(); - if (v > SDB_TINYINT_MAX) - v = SDB_TINYINT_MAX; - else if (v < SDB_TINYINT_MIN) - v = SDB_TINYINT_MIN; + if (v > TIANMU_TINYINT_MAX) + v = TIANMU_TINYINT_MAX; + else if (v < TIANMU_TINYINT_MIN) + v = TIANMU_TINYINT_MIN; *(int64_t *)ptr = v; ptr += sizeof(int64_t); } break; case MYSQL_TYPE_SHORT: { int64_t v = f->val_int(); - if (v > SDB_SMALLINT_MAX) - v = SDB_SMALLINT_MAX; - else if (v < SDB_SMALLINT_MIN) - v = SDB_SMALLINT_MIN; + if (v > TIANMU_SMALLINT_MAX) + v = TIANMU_SMALLINT_MAX; + else if (v < TIANMU_SMALLINT_MIN) + v = TIANMU_SMALLINT_MIN; *(int64_t *)ptr = v; ptr += sizeof(int64_t); } break; @@ -445,26 +445,26 @@ void Engine::EncodeRecord(const std::string &table_path, int tid, Field **field, int64_t v = f->val_int(); if (v > std::numeric_limits::max()) v = std::numeric_limits::max(); - else if (v < SDB_INT_MIN) - v = SDB_INT_MIN; + else if (v < TIANMU_INT_MIN) + v = TIANMU_INT_MIN; *(int64_t *)ptr = v; ptr += sizeof(int64_t); } break; case MYSQL_TYPE_INT24: { int64_t v = f->val_int(); - if (v > SDB_MEDIUMINT_MAX) - v = SDB_MEDIUMINT_MAX; - else if (v < SDB_MEDIUMINT_MIN) - v = SDB_MEDIUMINT_MIN; + if (v > TIANMU_MEDIUMINT_MAX) + v = TIANMU_MEDIUMINT_MAX; + else if (v < TIANMU_MEDIUMINT_MIN) + v = TIANMU_MEDIUMINT_MIN; *(int64_t *)ptr = v; ptr += sizeof(int64_t); } break; case MYSQL_TYPE_LONGLONG: { int64_t v = f->val_int(); - if (v > common::SDB_BIGINT_MAX) - v = common::SDB_BIGINT_MAX; - else if (v < common::SDB_BIGINT_MIN) - v = common::SDB_BIGINT_MIN; + if (v > common::TIANMU_BIGINT_MAX) + v = common::TIANMU_BIGINT_MAX; + else if (v < common::TIANMU_BIGINT_MIN) + v = common::TIANMU_BIGINT_MIN; *(int64_t *)ptr = v; ptr += sizeof(int64_t); } break; @@ -558,9 +558,9 @@ uint32_t Engine::GetNextTableId() { static std::mutex seq_mtx; std::scoped_lock lk(seq_mtx); - fs::path p = stonedb_data_dir / "stonedb.tid"; + fs::path p = tianmu_data_dir / "tianmu.tid"; if (!fs::exists(p)) { - STONEDB_LOG(LogCtl_Level::INFO, "Creating table id file"); + TIANMU_LOG(LogCtl_Level::INFO, "Creating table id file"); std::ofstream seq_file(p.string()); if (seq_file) seq_file << 0; if (!seq_file) { @@ -589,7 +589,7 @@ std::shared_ptr Engine::GetTableOption(const std::string &table, TA int power = has_pack(form->s->comment); if (power < 5 || power > 16) { - STONEDB_LOG(LogCtl_Level::ERROR, "create table comment: pack size shift(%d) should be >=5 and <= 16"); + TIANMU_LOG(LogCtl_Level::ERROR, "create table comment: pack size shift(%d) should be >=5 and <= 16"); throw common::SyntaxException("Unexpected data pack size."); } @@ -600,7 +600,7 @@ std::shared_ptr Engine::GetTableOption(const std::string &table, TA opt->atis.push_back(Engine::GetAttrTypeInfo(*f)); } - opt->path = table + common::STONEDB_EXT; + opt->path = table + common::TIANMU_EXT; opt->name = form->s->table_name.str; return opt; } @@ -671,7 +671,7 @@ AttributeTypeInfo Engine::GetAttrTypeInfo(const Field &field) { if (const Field_str *fstr = dynamic_cast(&field)) { DTCollation coll(fstr->charset(), fstr->derivation()); if (fmt == common::PackFmt::TRIE && types::IsCaseInsensitive(coll)) { - STONEDB_LOG(LogCtl_Level::ERROR, "TRIE can not work with case-insensitive collation: %s!", + TIANMU_LOG(LogCtl_Level::ERROR, "TRIE can not work with case-insensitive collation: %s!", coll.collation->name); throw common::UnsupportedDataTypeException(); } @@ -740,7 +740,7 @@ void Engine::CommitTx(THD *thd, bool all) { void Engine::Rollback(THD *thd, bool all, bool force_error_message) { force_error_message = force_error_message || (!all && thd_test_options(thd, OPTION_NOT_AUTOCOMMIT)); - STONEDB_LOG(LogCtl_Level::ERROR, "Roll back query '%s'", thd->query().str); + TIANMU_LOG(LogCtl_Level::ERROR, "Roll back query '%s'", thd->query().str); if (current_tx) { GetTx(thd)->Rollback(thd, force_error_message); ClearTx(thd); @@ -763,7 +763,7 @@ void Engine::DeleteTable(const char *table, [[maybe_unused]] THD *thd) { UnRegisterTable(table); std::string p = table; - p += common::STONEDB_EXT; + p += common::TIANMU_EXT; auto id = RCTable::GetTableId(p); cache.ReleaseTable(id); filter_cache.RemoveIf([id](const FilterCoordinate &c) { return c[0] == int(id); }); @@ -773,7 +773,7 @@ void Engine::DeleteTable(const char *table, [[maybe_unused]] THD *thd) { gc_tasks.remove_if([id](const purge_task &t) -> bool { return static_cast(t.cookie) == id; }); } system::DeleteDirectory(p); - STONEDB_LOG(LogCtl_Level::INFO, "Drop table %s, ID = %u", table, id); + TIANMU_LOG(LogCtl_Level::INFO, "Drop table %s, ID = %u", table, id); } void Engine::TruncateTable(const std::string &table_path, [[maybe_unused]] THD *thd) { @@ -786,7 +786,7 @@ void Engine::TruncateTable(const std::string &table_path, [[maybe_unused]] THD * auto id = tab->GetID(); cache.ReleaseTable(id); filter_cache.RemoveIf([id](const FilterCoordinate &c) { return c[0] == int(id); }); - STONEDB_LOG(LogCtl_Level::INFO, "Truncated table %s, ID = %u", table_path.c_str(), id); + TIANMU_LOG(LogCtl_Level::INFO, "Truncated table %s, ID = %u", table_path.c_str(), id); } void Engine::GetTableIterator(const std::string &table_path, RCTable::Iterator &iter_begin, RCTable::Iterator &iter_end, @@ -925,30 +925,30 @@ void Engine::ClearTx(THD *thd) { int Engine::SetUpCacheFolder(const std::string &cachefolder_path) { if (!fs::exists(cachefolder_path)) { - STONEDB_LOG(LogCtl_Level::INFO, "Cachefolder %s does not exist. Trying to create it.", cachefolder_path.c_str()); + TIANMU_LOG(LogCtl_Level::INFO, "Cachefolder %s does not exist. Trying to create it.", cachefolder_path.c_str()); std::error_code ec; fs::create_directories(cachefolder_path, ec); if (ec) { - sql_print_error("StoneDB: Can not create folder %s.", cachefolder_path.c_str()); - STONEDB_LOG(LogCtl_Level::ERROR, "DatabaseException: %s", ec.message().c_str()); + sql_print_error("Tianmu: Can not create folder %s.", cachefolder_path.c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "DatabaseException: %s", ec.message().c_str()); return 1; } } if (!system::IsReadWriteAllowed(cachefolder_path)) { - sql_print_error("StoneDB: Can not access cache folder %s.", cachefolder_path.c_str()); - STONEDB_LOG(LogCtl_Level::ERROR, "Can not access cache folder %s", cachefolder_path.c_str()); + sql_print_error("Tianmu: Can not access cache folder %s.", cachefolder_path.c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "Can not access cache folder %s", cachefolder_path.c_str()); return 1; } return 0; } -std::string get_parameter_name(enum sdb_var_name vn) { - DEBUG_ASSERT(static_cast(vn) >= 0 && static_cast(vn) <= static_cast(sdb_var_name::SDB_VAR_LIMIT)); - return sdb_var_name_strings[static_cast(vn)]; +std::string get_parameter_name(enum tianmu_var_name vn) { + DEBUG_ASSERT(static_cast(vn) >= 0 && static_cast(vn) <= static_cast(tianmu_var_name::TIANMU_VAR_LIMIT)); + return tianmu_var_name_strings[static_cast(vn)]; } -int get_parameter(THD *thd, enum sdb_var_name vn, double &value) { +int get_parameter(THD *thd, enum tianmu_var_name vn, double &value) { std::string var_data = get_parameter_name(vn); user_var_entry *m_entry; my_bool null_val; @@ -960,7 +960,7 @@ int get_parameter(THD *thd, enum sdb_var_name vn, double &value) { return 0; } -int get_parameter(THD *thd, enum sdb_var_name vn, int64_t &value) { +int get_parameter(THD *thd, enum tianmu_var_name vn, int64_t &value) { std::string var_data = get_parameter_name(vn); user_var_entry *m_entry; my_bool null_val; @@ -973,7 +973,7 @@ int get_parameter(THD *thd, enum sdb_var_name vn, int64_t &value) { return 0; } -int get_parameter(THD *thd, enum sdb_var_name vn, std::string &value) { +int get_parameter(THD *thd, enum tianmu_var_name vn, std::string &value) { my_bool null_val; std::string var_data = get_parameter_name(vn); user_var_entry *m_entry; @@ -990,7 +990,7 @@ int get_parameter(THD *thd, enum sdb_var_name vn, std::string &value) { return 0; } -int get_parameter(THD *thd, enum sdb_var_name vn, longlong &result, std::string &s_result) { +int get_parameter(THD *thd, enum tianmu_var_name vn, longlong &result, std::string &s_result) { user_var_entry *m_entry; std::string var_data = get_parameter_name(vn); @@ -999,7 +999,7 @@ int get_parameter(THD *thd, enum sdb_var_name vn, longlong &result, std::string if (m_entry->type() == DECIMAL_RESULT) { switch (vn) { - case sdb_var_name::SDB_ABORT_ON_THRESHOLD: { + case tianmu_var_name::TIANMU_ABORT_ON_THRESHOLD: { double dv; my_bool null_value; my_decimal v; @@ -1016,10 +1016,10 @@ int get_parameter(THD *thd, enum sdb_var_name vn, longlong &result, std::string return 0; } else if (m_entry->type() == INT_RESULT) { switch (vn) { - case sdb_var_name::SDB_THROTTLE: - case sdb_var_name::SDB_STONEDBEXPRESSIONS: - case sdb_var_name::SDB_PARALLEL_AGGR: - case sdb_var_name::SDB_ABORT_ON_COUNT: + case tianmu_var_name::TIANMU_THROTTLE: + case tianmu_var_name::TIANMU_TIANMUEXPRESSIONS: + case tianmu_var_name::TIANMU_PARALLEL_AGGR: + case tianmu_var_name::TIANMU_ABORT_ON_COUNT: my_bool null_value; result = m_entry->val_int(&null_value); break; @@ -1036,13 +1036,13 @@ int get_parameter(THD *thd, enum sdb_var_name vn, longlong &result, std::string m_entry->val_str(&null_value, &str, NOT_FIXED_DEC); var_data = std::string(str.ptr()); - if (vn == sdb_var_name::SDB_DATAFORMAT || vn == sdb_var_name::SDB_REJECT_FILE_PATH) { + if (vn == tianmu_var_name::TIANMU_DATAFORMAT || vn == tianmu_var_name::TIANMU_REJECT_FILE_PATH) { s_result = var_data; - } else if (vn == sdb_var_name::SDB_PIPEMODE) { + } else if (vn == tianmu_var_name::TIANMU_PIPEMODE) { boost::to_upper(var_data); if (var_data == "SERVER") result = 1; if (var_data == "CLIENT") result = 0; - } else if (vn == sdb_var_name::SDB_NULL) { + } else if (vn == tianmu_var_name::TIANMU_NULL) { s_result = var_data; } return 0; @@ -1055,13 +1055,13 @@ int get_parameter(THD *thd, enum sdb_var_name vn, longlong &result, std::string void Engine::RenameTable([[maybe_unused]] Transaction *trans_, const std::string &from, const std::string &to, [[maybe_unused]] THD *thd) { UnRegisterTable(from); - auto id = RCTable::GetTableId(from + common::STONEDB_EXT); + auto id = RCTable::GetTableId(from + common::TIANMU_EXT); cache.ReleaseTable(id); filter_cache.RemoveIf([id](const FilterCoordinate &c) { return c[0] == int(id); }); - system::RenameFile(stonedb_data_dir / (from + common::STONEDB_EXT), stonedb_data_dir / (to + common::STONEDB_EXT)); + system::RenameFile(tianmu_data_dir / (from + common::TIANMU_EXT), tianmu_data_dir / (to + common::TIANMU_EXT)); RenameRdbTable(from, to); UnregisterMemTable(from, to); - STONEDB_LOG(LogCtl_Level::INFO, "Rename table %s to %s", from.c_str(), to.c_str()); + TIANMU_LOG(LogCtl_Level::INFO, "Rename table %s to %s", from.c_str(), to.c_str()); } void Engine::PrepareAlterTable(const std::string &table_path, std::vector &new_cols, @@ -1093,7 +1093,7 @@ static void HandleDelayedLoad(int tid, std::vector> &vec tabname.length=tab_name.length(); // END - //STONEDB UPGRADE + //TIANMU UPGRADE Global_THD_manager *thd_manager = Global_THD_manager::get_instance();//global thread manager THD *thd = new THD; @@ -1118,7 +1118,7 @@ static void HandleDelayedLoad(int tid, std::vector> &vec lex_start(thd); TABLE_LIST tl; tl.init_one_table(thd->strmake(thd->db().str, thd->db().length), thd->db().length, tabname.str, tabname.length, - tabname.str, TL_WRITE_CONCURRENT_INSERT);//STONEDB UPGRADE + tabname.str, TL_WRITE_CONCURRENT_INSERT);//TIANMU UPGRADE tl.updating = 1; // the table will be opened in mysql_load @@ -1135,7 +1135,7 @@ static void HandleDelayedLoad(int tid, std::vector> &vec thd->is_slave_error = 1; } - thd->set_catalog({0, 1});//STONEDB UPGRADE + thd->set_catalog({0, 1});//TIANMU UPGRADE thd->set_db({NULL,0}); /* will free the current database */ thd->reset_query(); thd->get_stmt_da()->set_overwrite_status(true); @@ -1152,7 +1152,7 @@ static void HandleDelayedLoad(int tid, std::vector> &vec free_root(thd->mem_root, MYF(MY_KEEP_PREALLOC)); if (thd->is_fatal_error) { - STONEDB_LOG(LogCtl_Level::ERROR, "LOAD DATA failed on table '%s'", tab_name.c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "LOAD DATA failed on table '%s'", tab_name.c_str()); } thd->release_resources(); thd_manager->remove_thd(thd); @@ -1186,9 +1186,9 @@ void Engine::ProcessDelayedInsert() { int buffer_recordnum = 0; int sleep_cnt = 0; while (!exiting) { - if (stonedb_sysvar_enable_rowstore) { + if (tianmu_sysvar_enable_rowstore) { std::unique_lock lk(cv_mtx); - cv.wait_for(lk, std::chrono::milliseconds(stonedb_sysvar_insert_wait_ms)); + cv.wait_for(lk, std::chrono::milliseconds(tianmu_sysvar_insert_wait_ms)); continue; } @@ -1197,15 +1197,15 @@ void Engine::ProcessDelayedInsert() { if (len == 0) { if (tm.empty()) { std::unique_lock lk(cv_mtx); - cv.wait_for(lk, std::chrono::milliseconds(stonedb_sysvar_insert_wait_ms)); + cv.wait_for(lk, std::chrono::milliseconds(tianmu_sysvar_insert_wait_ms)); } else { - if (buffer_recordnum >= stonedb_sysvar_insert_numthreshold || sleep_cnt > stonedb_sysvar_insert_cntthreshold) { + if (buffer_recordnum >= tianmu_sysvar_insert_numthreshold || sleep_cnt > tianmu_sysvar_insert_cntthreshold) { DistributeLoad(tm); buffer_recordnum = 0; sleep_cnt = 0; } else { std::unique_lock lk(cv_mtx); - cv.wait_for(lk, std::chrono::milliseconds(stonedb_sysvar_insert_wait_ms)); + cv.wait_for(lk, std::chrono::milliseconds(tianmu_sysvar_insert_wait_ms)); sleep_cnt++; } } @@ -1215,13 +1215,13 @@ void Engine::ProcessDelayedInsert() { buffer_recordnum++; auto tid = *(int32_t *)rec.get(); tm[tid].emplace_back(std::move(rec)); - if (tm[tid].size() > static_cast(stonedb_sysvar_insert_max_buffered)) { + if (tm[tid].size() > static_cast(tianmu_sysvar_insert_max_buffered)) { // in case the ingress rate is too high DistributeLoad(tm); buffer_recordnum = 0; } } - STONEDB_LOG(LogCtl_Level::INFO, "StoneDB load thread exiting..."); + TIANMU_LOG(LogCtl_Level::INFO, "Tianmu load thread exiting..."); } void Engine::ProcessDelayedMerge() { @@ -1239,9 +1239,9 @@ void Engine::ProcessDelayedMerge() { std::map sleep_cnts; while (!exiting) { - if (!stonedb_sysvar_enable_rowstore) { + if (!tianmu_sysvar_enable_rowstore) { std::unique_lock lk(cv_merge_mtx); - cv_merge.wait_for(lk, std::chrono::milliseconds(stonedb_sysvar_insert_wait_ms)); + cv_merge.wait_for(lk, std::chrono::milliseconds(tianmu_sysvar_insert_wait_ms)); continue; } @@ -1251,8 +1251,8 @@ void Engine::ProcessDelayedMerge() { std::scoped_lock guard(mem_table_mutex); for (auto &[name, mem_table] : mem_table_map) { int64_t record_count = mem_table->CountRecords(); - if (record_count >= stonedb_sysvar_insert_numthreshold || - (sleep_cnts.count(name) && sleep_cnts[name] > stonedb_sysvar_insert_cntthreshold)) { + if (record_count >= tianmu_sysvar_insert_numthreshold || + (sleep_cnts.count(name) && sleep_cnts[name] > tianmu_sysvar_insert_cntthreshold)) { auto share = rceng->getTableShare(name); auto tid = share->TabID(); utils::BitSet null_mask(share->NumOfCols()); @@ -1274,14 +1274,14 @@ void Engine::ProcessDelayedMerge() { } } } catch (common::Exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "delayed merge failed. %s %s", e.what(), e.trace().c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "delayed merge failed. %s %s", e.what(), e.trace().c_str()); std::unique_lock lk(cv_merge_mtx); - cv_merge.wait_for(lk, std::chrono::milliseconds(stonedb_sysvar_insert_wait_ms)); + cv_merge.wait_for(lk, std::chrono::milliseconds(tianmu_sysvar_insert_wait_ms)); continue; } catch (...) { - STONEDB_LOG(LogCtl_Level::ERROR, "delayed merge failed."); + TIANMU_LOG(LogCtl_Level::ERROR, "delayed merge failed."); std::unique_lock lk(cv_merge_mtx); - cv_merge.wait_for(lk, std::chrono::milliseconds(stonedb_sysvar_insert_wait_ms)); + cv_merge.wait_for(lk, std::chrono::milliseconds(tianmu_sysvar_insert_wait_ms)); continue; } } @@ -1289,23 +1289,23 @@ void Engine::ProcessDelayedMerge() { DistributeLoad(tm); else { std::unique_lock lk(cv_merge_mtx); - cv_merge.wait_for(lk, std::chrono::milliseconds(stonedb_sysvar_insert_wait_ms)); + cv_merge.wait_for(lk, std::chrono::milliseconds(tianmu_sysvar_insert_wait_ms)); } } - STONEDB_LOG(LogCtl_Level::INFO, "StoneDB merge thread exiting..."); + TIANMU_LOG(LogCtl_Level::INFO, "Tianmu merge thread exiting..."); } void Engine::LogStat() { static long last_sample_time = 0; static query_id_t saved_query_id = 0; - static StonedbStat saved; + static TianmuStat saved; if (last_sample_time == 0) { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); last_sample_time = t.tv_sec; saved_query_id = global_query_id; - saved = stonedb_stat; + saved = tianmu_stat; return; } @@ -1314,7 +1314,7 @@ void Engine::LogStat() { long sample_time = t.tv_sec; long diff = sample_time - last_sample_time; if (diff == 0) { - STONEDB_LOG(LogCtl_Level::ERROR, "LogStat() called too frequently. last sample time %ld ", last_sample_time); + TIANMU_LOG(LogCtl_Level::ERROR, "LogStat() called too frequently. last sample time %ld ", last_sample_time); return; } query_id_t query_id = global_query_id; @@ -1349,39 +1349,39 @@ void Engine::LogStat() { msg + sql_statement_names[c].str + " " + std::to_string(delta) + "/" + std::to_string(sv.com_stat[c]) + ", "; } msg = msg + "queries " + std::to_string(queries) + "/" + std::to_string(global_query_id); - STONEDB_LOG(LogCtl_Level::INFO, msg.c_str()); + TIANMU_LOG(LogCtl_Level::INFO, msg.c_str()); } - STONEDB_LOG(LogCtl_Level::INFO, + TIANMU_LOG(LogCtl_Level::INFO, "Select: %lu/%lu, Loaded: %lu/%lu(%lu/%lu), dup: %lu/%lu, insert: " "%lu/%lu, failed insert: %lu/%lu, update: " "%lu/%lu", - stonedb_stat.select - saved.select, stonedb_stat.select, stonedb_stat.loaded - saved.loaded, - stonedb_stat.loaded, stonedb_stat.load_cnt - saved.load_cnt, stonedb_stat.load_cnt, - stonedb_stat.loaded_dup - saved.loaded_dup, stonedb_stat.loaded_dup, - stonedb_stat.delayinsert - saved.delayinsert, stonedb_stat.delayinsert, - stonedb_stat.failed_delayinsert - saved.failed_delayinsert, stonedb_stat.failed_delayinsert, - stonedb_stat.update - saved.update, stonedb_stat.update); + tianmu_stat.select - saved.select, tianmu_stat.select, tianmu_stat.loaded - saved.loaded, + tianmu_stat.loaded, tianmu_stat.load_cnt - saved.load_cnt, tianmu_stat.load_cnt, + tianmu_stat.loaded_dup - saved.loaded_dup, tianmu_stat.loaded_dup, + tianmu_stat.delayinsert - saved.delayinsert, tianmu_stat.delayinsert, + tianmu_stat.failed_delayinsert - saved.failed_delayinsert, tianmu_stat.failed_delayinsert, + tianmu_stat.update - saved.update, tianmu_stat.update); - if (stonedb_stat.loaded == saved.loaded && stonedb_stat.delayinsert > saved.delayinsert) { - STONEDB_LOG(LogCtl_Level::ERROR, "No data loaded from insert buffer"); + if (tianmu_stat.loaded == saved.loaded && tianmu_stat.delayinsert > saved.delayinsert) { + TIANMU_LOG(LogCtl_Level::ERROR, "No data loaded from insert buffer"); } // update with last minute statistics - IPM = stonedb_stat.delayinsert - saved.delayinsert; - IT = stonedb_stat.delayinsert; - QPM = stonedb_stat.select - saved.select; - QT = stonedb_stat.select; - LPM = stonedb_stat.loaded - saved.loaded; - LT = stonedb_stat.loaded; - LDPM = stonedb_stat.loaded_dup - saved.loaded_dup; - LDT = stonedb_stat.loaded_dup; - UPM = stonedb_stat.update - saved.update; - UT = stonedb_stat.update; + IPM = tianmu_stat.delayinsert - saved.delayinsert; + IT = tianmu_stat.delayinsert; + QPM = tianmu_stat.select - saved.select; + QT = tianmu_stat.select; + LPM = tianmu_stat.loaded - saved.loaded; + LT = tianmu_stat.loaded; + LDPM = tianmu_stat.loaded_dup - saved.loaded_dup; + LDT = tianmu_stat.loaded_dup; + UPM = tianmu_stat.update - saved.update; + UT = tianmu_stat.update; last_sample_time = sample_time; saved_query_id = query_id; - saved = stonedb_stat; + saved = tianmu_stat; } void Engine::InsertDelayed(const std::string &table_path, int tid, TABLE *table) { @@ -1398,8 +1398,8 @@ void Engine::InsertDelayed(const std::string &table_path, int tid, TABLE *table) try { insert_buffer.Write(utils::MappedCircularBuffer::TAG::INSERT_RECORD, buf.get(), buf_sz); } catch (std::length_error &e) { - if (failed++ >= stonedb_sysvar_insert_wait_time / 50) { - STONEDB_LOG(LogCtl_Level::ERROR, "insert buffer is out of space"); + if (failed++ >= tianmu_sysvar_insert_wait_time / 50) { + TIANMU_LOG(LogCtl_Level::ERROR, "insert buffer is out of space"); throw e; } std::this_thread::sleep_for(std::chrono::milliseconds(50)); @@ -1427,36 +1427,36 @@ int Engine::InsertRow(const std::string &table_path, [[maybe_unused]] Transactio std::shared_ptr &share) { int ret = 0; try { - if (stonedb_sysvar_insert_delayed) { - if (stonedb_sysvar_enable_rowstore) { + if (tianmu_sysvar_insert_delayed) { + if (tianmu_sysvar_enable_rowstore) { InsertMemRow(table_path, share, table); } else { InsertDelayed(table_path, share->TabID(), table); } - stonedb_stat.delayinsert++; + tianmu_stat.delayinsert++; } else { auto rct = current_tx->GetTableByPath(table_path); ret = rct->Insert(table); } return ret; } catch (common::Exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "delayed inserting failed. %s %s", e.what(), e.trace().c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "delayed inserting failed. %s %s", e.what(), e.trace().c_str()); } catch (std::exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "delayed inserting failed. %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "delayed inserting failed. %s", e.what()); } catch (...) { - STONEDB_LOG(LogCtl_Level::ERROR, "delayed inserting failed."); + TIANMU_LOG(LogCtl_Level::ERROR, "delayed inserting failed."); } - if (stonedb_sysvar_insert_delayed) { - stonedb_stat.failed_delayinsert++; + if (tianmu_sysvar_insert_delayed) { + tianmu_stat.failed_delayinsert++; ret = 1; } return ret; } -common::SDBError Engine::RunLoader(THD *thd, sql_exchange *ex, TABLE_LIST *table_list, void *arg) { - common::SDBError sdbe; +common::TIANMUError Engine::RunLoader(THD *thd, sql_exchange *ex, TABLE_LIST *table_list, void *arg) { + common::TIANMUError tianmu_e; TABLE *table; int transactional_table = 0; @@ -1466,9 +1466,9 @@ common::SDBError Engine::RunLoader(THD *thd, sql_exchange *ex, TABLE_LIST *table try { std::unique_ptr iop; - auto sdberror = Engine::GetIOP(iop, *thd, *ex, table, arg); + auto tianmu_error = Engine::GetIOP(iop, *thd, *ex, table, arg); - if (sdberror != common::ErrorCode::SUCCESS) throw sdberror; + if (tianmu_error != common::ErrorCode::SUCCESS) throw tianmu_error; std::string table_path = GetTablePath(table); @@ -1481,7 +1481,7 @@ common::SDBError Engine::RunLoader(THD *thd, sql_exchange *ex, TABLE_LIST *table if (current_tx->Killed()) { thd->send_kill_message(); - throw common::SDBError(common::ErrorCode::KILLED); + throw common::TIANMUError(common::ErrorCode::KILLED); } // We must invalidate the table in query cache before binlog writing and @@ -1490,9 +1490,9 @@ common::SDBError Engine::RunLoader(THD *thd, sql_exchange *ex, TABLE_LIST *table COPY_INFO::Statistics stats; stats.records = ha_rows(tab->NoRecordsLoaded()); - stonedb_stat.loaded += tab->NoRecordsLoaded(); - stonedb_stat.loaded_dup += tab->NoRecordsDuped(); - stonedb_stat.load_cnt++; + tianmu_stat.loaded += tab->NoRecordsLoaded(); + tianmu_stat.loaded_dup += tab->NoRecordsDuped(); + tianmu_stat.load_cnt++; char name[FN_REFLEN]; my_snprintf(name, sizeof(name), ER(ER_LOAD_INFO), (long)stats.records, @@ -1503,16 +1503,16 @@ common::SDBError Engine::RunLoader(THD *thd, sql_exchange *ex, TABLE_LIST *table /* ok to client */ my_ok(thd, stats.records, 0L, name); } catch (common::Exception &e) { - sdbe = common::SDBError(common::ErrorCode::UNKNOWN_ERROR, "StoneDB internal error"); - } catch (common::SDBError &e) { - sdbe = e; + tianmu_e = common::TIANMUError(common::ErrorCode::UNKNOWN_ERROR, "Tianmu internal error"); + } catch (common::TIANMUError &e) { + tianmu_e = e; } //if (thd->transaction.stmt.cannot_safely_rollback()) // thd->transaction.all.mark_modified_non_trans_table(); if (transactional_table) { - if (sdbe == common::ErrorCode::SUCCESS) + if (tianmu_e == common::ErrorCode::SUCCESS) trans_commit_stmt(thd); else trans_rollback_stmt(thd); @@ -1523,10 +1523,10 @@ common::SDBError Engine::RunLoader(THD *thd, sql_exchange *ex, TABLE_LIST *table thd->lock = 0; } //thd->abort_on_warning = 0; - return sdbe; + return tianmu_e; } -bool Engine::IsSDBRoute(THD *thd, TABLE_LIST *table_list, SELECT_LEX *selects_list, +bool Engine::IsTIANMURoute(THD *thd, TABLE_LIST *table_list, SELECT_LEX *selects_list, int &in_case_of_failure_can_go_to_mysql, int with_insert) { in_case_of_failure_can_go_to_mysql = true; @@ -1535,19 +1535,19 @@ bool Engine::IsSDBRoute(THD *thd, TABLE_LIST *table_list, SELECT_LEX *selects_li if (!table_list) return false; - bool has_SDBTable = false; + bool has_TIANMUTable = false; for (TABLE_LIST *tl = table_list; tl; tl = tl->next_global) { // SZN:we go through tables if (!tl->is_view_or_derived() && !tl->is_view()) { // In this list we have all views, derived tables and their // sources, so anyway we walk through all the source tables // even though we seem to reject the control of views - if (!IsSDBTable(tl->table)) + if (!IsTIANMUTable(tl->table)) return false; else - has_SDBTable = true; + has_TIANMUTable = true; } } - if (!has_SDBTable) // No StoneDB table is involved. Return to MySQL. + if (!has_TIANMUTable) // No Tianmu table is involved. Return to MySQL. return false; // then we check the parameter of file format. @@ -1558,16 +1558,16 @@ bool Engine::IsSDBRoute(THD *thd, TABLE_LIST *table_list, SELECT_LEX *selects_li if (file) { // it writes to a file longlong param = 0; std::string s_res; - if (!get_parameter(thd, sdb_var_name::SDB_DATAFORMAT, param, s_res)) { + if (!get_parameter(thd, tianmu_var_name::TIANMU_DATAFORMAT, param, s_res)) { if (boost::iequals(boost::trim_copy(s_res), "MYSQL")) return false; common::DataFormatPtr df = common::DataFormat::GetDataFormat(s_res); if (!df) { // parameter is UNKNOWN VALUE - my_message(ER_SYNTAX_ERROR, "Histgore specific error: Unknown value of SDB_DATAFORMAT parameter", MYF(0)); + my_message(ER_SYNTAX_ERROR, "Histgore specific error: Unknown value of TIANMU_DATAFORMAT parameter", MYF(0)); return true; } else if (!df->CanExport()) { my_message(ER_SYNTAX_ERROR, - (std::string("StoneDB specific error: Export in '") + df->GetName() + ("' format is not supported.")) + (std::string("Tianmu specific error: Export in '") + df->GetName() + ("' format is not supported.")) .c_str(), MYF(0)); return true; @@ -1583,7 +1583,7 @@ bool Engine::IsSDBRoute(THD *thd, TABLE_LIST *table_list, SELECT_LEX *selects_li return true; } -bool Engine::IsSDBTable(TABLE *table) { +bool Engine::IsTIANMUTable(TABLE *table) { return table && table->s->db_type() == rcbase_hton; // table->db_type is always NULL } @@ -1609,7 +1609,7 @@ std::unique_ptr Engine::CreateIOParameters(const std::stri data_dir = ""; data_path = path; } else { - data_dir = rceng->stonedb_data_dir; + data_dir = rceng->tianmu_data_dir; std::string db_name, tab_name; std::tie(db_name, tab_name) = GetNames(path); data_path += db_name; @@ -1662,44 +1662,44 @@ void Engine::ComputeTimeZoneDiffInMinutes(THD *thd, short &sign, short &minutes) minutes = (short)(secs / 60); } -common::SDBError Engine::GetRejectFileIOParameters(THD &thd, std::unique_ptr &io_params) { +common::TIANMUError Engine::GetRejectFileIOParameters(THD &thd, std::unique_ptr &io_params) { std::string reject_file; int64_t abort_on_count = 0; double abort_on_threshold = 0; - get_parameter(&thd, sdb_var_name::SDB_REJECT_FILE_PATH, reject_file); - if (get_parameter(&thd, sdb_var_name::SDB_REJECT_FILE_PATH, reject_file) == 2) - return common::SDBError(common::ErrorCode::WRONG_PARAMETER, "Wrong value of STONEDB_LOAD_REJECT_FILE parameter."); + get_parameter(&thd, tianmu_var_name::TIANMU_REJECT_FILE_PATH, reject_file); + if (get_parameter(&thd, tianmu_var_name::TIANMU_REJECT_FILE_PATH, reject_file) == 2) + return common::TIANMUError(common::ErrorCode::WRONG_PARAMETER, "Wrong value of TIANMU_LOAD_REJECT_FILE parameter."); - if (get_parameter(&thd, sdb_var_name::SDB_ABORT_ON_COUNT, abort_on_count) == 2) - return common::SDBError(common::ErrorCode::WRONG_PARAMETER, "Wrong value of SDB_ABORT_ON_COUNT parameter."); + if (get_parameter(&thd, tianmu_var_name::TIANMU_ABORT_ON_COUNT, abort_on_count) == 2) + return common::TIANMUError(common::ErrorCode::WRONG_PARAMETER, "Wrong value of TIANMU_ABORT_ON_COUNT parameter."); - if (get_parameter(&thd, sdb_var_name::SDB_ABORT_ON_THRESHOLD, abort_on_threshold) == 2) - return common::SDBError(common::ErrorCode::WRONG_PARAMETER, "Wrong value of SDB_ABORT_ON_THRESHOLD parameter."); + if (get_parameter(&thd, tianmu_var_name::TIANMU_ABORT_ON_THRESHOLD, abort_on_threshold) == 2) + return common::TIANMUError(common::ErrorCode::WRONG_PARAMETER, "Wrong value of TIANMU_ABORT_ON_THRESHOLD parameter."); if (abort_on_count != 0 && abort_on_threshold != 0) - return common::SDBError(common::ErrorCode::WRONG_PARAMETER, - "SDB_ABORT_ON_COUNT and SDB_ABORT_ON_THRESHOLD " + return common::TIANMUError(common::ErrorCode::WRONG_PARAMETER, + "TIANMU_ABORT_ON_COUNT and TIANMU_ABORT_ON_THRESHOLD " "parameters are mutualy exclusive."); if (!(abort_on_threshold >= 0.0 && abort_on_threshold < 1.0)) - return common::SDBError(common::ErrorCode::WRONG_PARAMETER, - "SDB_ABORT_ON_THRESHOLD parameter value must be in range (0,1)."); + return common::TIANMUError(common::ErrorCode::WRONG_PARAMETER, + "TIANMU_ABORT_ON_THRESHOLD parameter value must be in range (0,1)."); if ((abort_on_count != 0 || abort_on_threshold != 0) && reject_file.empty()) - return common::SDBError(common::ErrorCode::WRONG_PARAMETER, - "SDB_ABORT_ON_COUNT or SDB_ABORT_ON_THRESHOLD can by only specified with " - "SDB_REJECT_FILE_PATH parameter."); + return common::TIANMUError(common::ErrorCode::WRONG_PARAMETER, + "TIANMU_ABORT_ON_COUNT or TIANMU_ABORT_ON_THRESHOLD can by only specified with " + "TIANMU_REJECT_FILE_PATH parameter."); if (!reject_file.empty() && fs::exists(reject_file)) - return common::SDBError(common::ErrorCode::WRONG_PARAMETER, + return common::TIANMUError(common::ErrorCode::WRONG_PARAMETER, "Can not create the reject file, the file already exists."); io_params->SetRejectFile(reject_file, abort_on_count, abort_on_threshold); return common::ErrorCode::SUCCESS; } -common::SDBError Engine::GetIOP(std::unique_ptr &io_params, THD &thd, sql_exchange &ex, +common::TIANMUError Engine::GetIOP(std::unique_ptr &io_params, THD &thd, sql_exchange &ex, TABLE *table, void *arg, bool for_exporter) { const CHARSET_INFO *cs = ex.cs; bool local_load = for_exporter ? false : (bool)(thd.lex)->local_file; @@ -1722,17 +1722,17 @@ common::SDBError Engine::GetIOP(std::unique_ptr &io_params if (ex.filetype == FILETYPE_MEM) { io_params->load_delayed_insert_ = true; } -#ifdef DONT_ALLOW_FULL_LOAD_DATA_PATSTONEDB +#ifdef DONT_ALLOW_FULL_LOAD_DATA_PATTIANMU ex->file_name += dirname_length(ex->file_name); #endif longlong param = 0; std::string s_res; if (common::DataFormat::GetNoFormats() > 1) { - if (!get_parameter(&thd, sdb_var_name::SDB_DATAFORMAT, param, s_res)) { + if (!get_parameter(&thd, tianmu_var_name::TIANMU_DATAFORMAT, param, s_res)) { common::DataFormatPtr df = common::DataFormat::GetDataFormat(s_res); if (!df) - return common::SDBError(common::ErrorCode::WRONG_PARAMETER, "Unknown value of SDB_DATAFORMAT parameter."); + return common::TIANMUError(common::ErrorCode::WRONG_PARAMETER, "Unknown value of TIANMU_DATAFORMAT parameter."); else io_mode = df->GetId(); } else @@ -1740,7 +1740,7 @@ common::SDBError Engine::GetIOP(std::unique_ptr &io_params } else io_mode = common::DataFormat::GetDataFormat(0)->GetId(); - if (!get_parameter(&thd, sdb_var_name::SDB_NULL, param, s_res)) io_params->SetNullsStr(s_res); + if (!get_parameter(&thd, tianmu_var_name::TIANMU_NULL, param, s_res)) io_params->SetNullsStr(s_res); if (io_params->LoadDelayed()) { std::strcpy(name, ex.file_name); @@ -1758,17 +1758,17 @@ common::SDBError Engine::GetIOP(std::unique_ptr &io_params io_params->SetOutput(io_mode, name); if (ex.field.escaped->length() > 1) - return common::SDBError(common::ErrorCode::WRONG_PARAMETER, "Multicharacter escape std::string not supported."); + return common::TIANMUError(common::ErrorCode::WRONG_PARAMETER, "Multicharacter escape std::string not supported."); if (ex.field.enclosed->length() > 1 && (ex.field.enclosed->length() != 4 || strcasecmp(ex.field.enclosed->ptr(), "NULL") != 0)) - return common::SDBError(common::ErrorCode::WRONG_PARAMETER, "Multicharacter enclose std::string not supported."); + return common::TIANMUError(common::ErrorCode::WRONG_PARAMETER, "Multicharacter enclose std::string not supported."); if (!for_exporter) { - common::SDBError sdberr = GetRejectFileIOParameters(thd, io_params); - if (sdberr.GetErrorCode() != common::ErrorCode::SUCCESS) return sdberr; + common::TIANMUError tianmu_err = GetRejectFileIOParameters(thd, io_params); + if (tianmu_err.GetErrorCode() != common::ErrorCode::SUCCESS) return tianmu_err; } - if (stonedb_sysvar_usemysqlimportexportdefaults) { + if (tianmu_sysvar_usemysqlimportexportdefaults) { io_params->SetEscapeCharacter(*ex.field.escaped->ptr()); io_params->SetDelimiter(ex.field.field_term->ptr()); io_params->SetLineTerminator(ex.line.line_term->ptr()); @@ -1794,12 +1794,12 @@ common::SDBError Engine::GetIOP(std::unique_ptr &io_params if (io_params->EscapeCharacter() != 0 && io_params->Delimiter().find(io_params->EscapeCharacter()) != std::string::npos) - return common::SDBError(common::ErrorCode::WRONG_PARAMETER, + return common::TIANMUError(common::ErrorCode::WRONG_PARAMETER, "Field terminator containing the escape character not supported."); if (io_params->EscapeCharacter() != 0 && io_params->StringQualifier() != 0 && io_params->EscapeCharacter() == io_params->StringQualifier()) - return common::SDBError(common::ErrorCode::WRONG_PARAMETER, + return common::TIANMUError(common::ErrorCode::WRONG_PARAMETER, "The same enclose and escape characters not supported."); bool unsupported_syntax = false; @@ -1860,17 +1860,17 @@ std::shared_ptr Engine::GetTableShare(const TABLE_SHARE *table_share try { auto it = table_share_map.find(name); if (it == table_share_map.end()) { - auto share = std::make_shared(name + common::STONEDB_EXT, table_share); + auto share = std::make_shared(name + common::TIANMU_EXT, table_share); table_share_map[name] = share; return share; } return it->second; } catch (common::Exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to create table share: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to create table share: %s", e.what()); } catch (std::exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to create table share: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to create table share: %s", e.what()); } catch (...) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to create table share"); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to create table share"); } return nullptr; } @@ -1920,11 +1920,11 @@ void Engine::AddMemTable(TABLE *form, std::shared_ptr share) { } return; } catch (common::Exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to create memory table: %s / %s", e.what(), e.trace().c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to create memory table: %s / %s", e.what(), e.trace().c_str()); } catch (std::exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to create memory table: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to create memory table: %s", e.what()); } catch (...) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to create memory table"); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to create memory table"); } return; } @@ -1986,32 +1986,32 @@ std::string Engine::RowStoreStat() { } } // namespace core -} // namespace stonedb +} // namespace Tianmu -int stonedb_push_data_dir(const char *dir) { - using namespace stonedb; +int tianmu_push_data_dir(const char *dir) { + using namespace Tianmu; using namespace core; try { auto p = fs::path(dir); if (!fs::is_directory(p)) { - STONEDB_LOG(LogCtl_Level::ERROR, "Path %s is not a directory or cannot be accessed.", dir); + TIANMU_LOG(LogCtl_Level::ERROR, "Path %s is not a directory or cannot be accessed.", dir); return 1; } if (fs::space(p).available < 1_GB) { - STONEDB_LOG(LogCtl_Level::ERROR, "StoneDB requires data directory has at least 1G available space!"); + TIANMU_LOG(LogCtl_Level::ERROR, "Tianmu requires data directory has at least 1G available space!"); return 1; } - p /= fs::path(STONEDB_DATA_DIR); - auto result = std::find(std::begin(stonedb_data_dirs), std::end(stonedb_data_dirs), p); - if (result != std::end(stonedb_data_dirs)) { - STONEDB_LOG(LogCtl_Level::WARN, "Path %s specified multiple times as data directory.", dir); + p /= fs::path(TIANMU_DATA_DIR); + auto result = std::find(std::begin(tianmu_data_dirs), std::end(tianmu_data_dirs), p); + if (result != std::end(tianmu_data_dirs)) { + TIANMU_LOG(LogCtl_Level::WARN, "Path %s specified multiple times as data directory.", dir); } else { fs::create_directory(p); - stonedb_data_dirs.emplace_back(p); + tianmu_data_dirs.emplace_back(p); } } catch (fs::filesystem_error &err) { - STONEDB_LOG(LogCtl_Level::ERROR, "Filesystem error %s", err.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Filesystem error %s", err.what()); return 1; } diff --git a/storage/stonedb/core/engine.h b/storage/tianmu/core/engine.h similarity index 84% rename from storage/stonedb/core/engine.h rename to storage/tianmu/core/engine.h index 6a764d41bc..d7fd5cd309 100644 --- a/storage/stonedb/core/engine.h +++ b/storage/tianmu/core/engine.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_ENGINE_H_ -#define STONEDB_CORE_ENGINE_H_ +#ifndef TIANMU_CORE_ENGINE_H_ +#define TIANMU_CORE_ENGINE_H_ #pragma once #include @@ -45,7 +45,7 @@ extern handlerton *rcbase_hton; class Field; -namespace stonedb { +namespace Tianmu { namespace types { class RCDataType; } // namespace types @@ -59,7 +59,7 @@ class KVStore; } // namespace index namespace exporter { -class select_sdb_export; +class select_tianmu_export; } // namespace exporter namespace core { @@ -95,20 +95,20 @@ class Engine final { unsigned long GetLDT() const { return LDT; } unsigned long GetUPM() const { return UPM; } unsigned long GetUT() const { return UT; } - void IncStonedbStatUpdate() { ++stonedb_stat.update; } + void IncTianmuStatUpdate() { ++tianmu_stat.update; } std::vector GetTableAttributesInfo(const std::string &table_path, TABLE_SHARE *table_share); void UpdateAndStoreColumnComment(TABLE *table, int field_id, Field *source_field, int source_field_id, CHARSET_INFO *cs); void GetTableIterator(const std::string &table_path, RCTable::Iterator &iter_begin, RCTable::Iterator &iter_end, std::shared_ptr &table, const std::vector &, THD *thd); - common::SDBError RunLoader(THD *thd, sql_exchange *ex, TABLE_LIST *table_list, void *arg); + common::TIANMUError RunLoader(THD *thd, sql_exchange *ex, TABLE_LIST *table_list, void *arg); void CommitTx(THD *thd, bool all); void Rollback(THD *thd, bool all, bool force_error_message = false); Transaction *CreateTx(THD *thd); Transaction *GetTx(THD *thd); void ClearTx(THD *thd); int HandleSelect(THD *thd, LEX *lex, Query_result *&result_output, ulong setup_tables_done_option, int &res, - int &optimize_after_sdb, int &sdb_free_join, int with_insert = false); + int &optimize_after_tianmu, int &tianmu_free_join, int with_insert = false); system::ResourceManager *getResourceManager() const { return m_resourceManager; } std::shared_ptr GetTableRD(const std::string &table_path); int InsertRow(const std::string &tablename, Transaction *trans_, TABLE *table, std::shared_ptr &share); @@ -145,7 +145,7 @@ class Engine final { static AttributeTypeInfo GetCorrespondingATI(Field &field); static AttributeTypeInfo GetAttrTypeInfo(const Field &field); static common::CT GetCorrespondingType(const enum_field_types &eft); - static bool IsSDBTable(TABLE *table); + static bool IsTIANMUTable(TABLE *table); static bool ConvertToField(Field *field, types::RCDataType &rcitem, std::vector *blob_buf); static int Convert(int &is_null, my_decimal *value, types::RCDataType &rcitem, int output_scale = -1); static int Convert(int &is_null, int64_t &value, types::RCDataType &rcitem, enum_field_types f_type); @@ -153,9 +153,9 @@ class Engine final { static int Convert(int &is_null, String *value, types::RCDataType &rcitem, enum_field_types f_type); static void ComputeTimeZoneDiffInMinutes(THD *thd, short &sign, short &minutes); static std::string GetTablePath(TABLE *table); - static common::SDBError GetIOP(std::unique_ptr &io_params, THD &thd, sql_exchange &ex, + static common::TIANMUError GetIOP(std::unique_ptr &io_params, THD &thd, sql_exchange &ex, TABLE *table = 0, void *arg = NULL, bool for_exporter = false); - static common::SDBError GetRejectFileIOParameters(THD &thd, std::unique_ptr &io_params); + static common::TIANMUError GetRejectFileIOParameters(THD &thd, std::unique_ptr &io_params); static fs::path GetNextDataDir(); private: @@ -165,7 +165,7 @@ class Engine final { int SetUpCacheFolder(const std::string &cachefolder_path); static bool AreConvertible(types::RCDataType &rcitem, enum_field_types my_type, uint length = 0); - static bool IsSDBRoute(THD *thd, TABLE_LIST *table_list, SELECT_LEX *selects_list, + static bool IsTIANMURoute(THD *thd, TABLE_LIST *table_list, SELECT_LEX *selects_list, int &in_case_of_failure_can_go_to_mysql, int with_insert); static const char *GetFilename(SELECT_LEX *selects_list, int &is_dumpfile); static std::unique_ptr CreateIOParameters(const std::string &path, void *arg); @@ -180,7 +180,7 @@ class Engine final { std::unique_ptr &buf, uint32_t &size); private: - struct StonedbStat { + struct TianmuStat { unsigned long loaded; unsigned long load_cnt; unsigned long delayinsert; @@ -188,7 +188,7 @@ class Engine final { unsigned long select; unsigned long loaded_dup; unsigned long update; - } stonedb_stat{}; + } tianmu_stat{}; std::thread m_load_thread; std::thread m_merge_thread; @@ -229,7 +229,7 @@ class Engine final { std::unordered_map> table_share_map; std::mutex table_share_mutex; - fs::path stonedb_data_dir; + fs::path tianmu_data_dir; utils::MappedCircularBuffer insert_buffer; @@ -302,43 +302,43 @@ class ResultExportSender final : public ResultSender { void Init(TempTable *t) override; void SendRecord(const std::vector> &record) override; - exporter::select_sdb_export *export_res; + exporter::select_tianmu_export *export_res; std::unique_ptr rcde; std::shared_ptr rcbuffer; }; -enum class sdb_var_name { - SDB_DATAFORMAT, - SDB_PIPEMODE, - SDB_NULL, - SDB_THROTTLE, - SDB_STONEDBEXPRESSIONS, - SDB_PARALLEL_AGGR, - SDB_REJECT_FILE_PATH, - SDB_ABORT_ON_COUNT, - SDB_ABORT_ON_THRESHOLD, - SDB_VAR_LIMIT // KEEP THIS LAST +enum class tianmu_var_name { + TIANMU_DATAFORMAT, + TIANMU_PIPEMODE, + TIANMU_NULL, + TIANMU_THROTTLE, + TIANMU_TIANMUEXPRESSIONS, + TIANMU_PARALLEL_AGGR, + TIANMU_REJECT_FILE_PATH, + TIANMU_ABORT_ON_COUNT, + TIANMU_ABORT_ON_THRESHOLD, + TIANMU_VAR_LIMIT // KEEP THIS LAST }; -static std::string sdb_var_name_strings[] = {"STONEDB_LOAD_TIMEOUT", "STONEDB_LOAD_DATAFORMAT", - "STONEDB_LOAD_PIPEMODE", "STONEDB_LOAD_NULL", - "STONEDB_LOAD_THROTTLE", "STONEDB_LOAD_STONEDBEXPRESSIONS", - "STONEDB_LOAD_PARALLEL_AGGR", "STONEDB_LOAD_REJECT_FILE", - "STONEDB_LOAD_ABORT_ON_COUNT", "STONEDB_LOAD_ABORT_ON_THRESHOLD"}; +static std::string tianmu_var_name_strings[] = {"TIANMU_LOAD_TIMEOUT", "TIANMU_LOAD_DATAFORMAT", + "TIANMU_LOAD_PIPEMODE", "TIANMU_LOAD_NULL", + "TIANMU_LOAD_THROTTLE", "TIANMU_LOAD_TIANMUEXPRESSIONS", + "TIANMU_LOAD_PARALLEL_AGGR", "TIANMU_LOAD_REJECT_FILE", + "TIANMU_LOAD_ABORT_ON_COUNT", "TIANMU_LOAD_ABORT_ON_THRESHOLD"}; -std::string get_parameter_name(enum sdb_var_name vn); +std::string get_parameter_name(enum tianmu_var_name vn); -int get_parameter(THD *thd, enum sdb_var_name vn, longlong &result, std::string &s_result); +int get_parameter(THD *thd, enum tianmu_var_name vn, longlong &result, std::string &s_result); // return 0 on success // 1 if parameter was not specified // 2 if was specified but with wrong type -int get_parameter(THD *thd, enum sdb_var_name vn, double &value); -int get_parameter(THD *thd, enum sdb_var_name vn, int64_t &value); -int get_parameter(THD *thd, enum sdb_var_name vn, std::string &value); +int get_parameter(THD *thd, enum tianmu_var_name vn, double &value); +int get_parameter(THD *thd, enum tianmu_var_name vn, int64_t &value); +int get_parameter(THD *thd, enum tianmu_var_name vn, std::string &value); -bool parameter_equals(THD *thd, enum sdb_var_name vn, longlong value); +bool parameter_equals(THD *thd, enum tianmu_var_name vn, longlong value); } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_ENGINE_H_ +#endif // TIANMU_CORE_ENGINE_H_ diff --git a/storage/stonedb/core/engine_convert.cpp b/storage/tianmu/core/engine_convert.cpp similarity index 93% rename from storage/stonedb/core/engine_convert.cpp rename to storage/tianmu/core/engine_convert.cpp index 007fb58e41..028e854680 100644 --- a/storage/stonedb/core/engine_convert.cpp +++ b/storage/tianmu/core/engine_convert.cpp @@ -21,7 +21,7 @@ #include "core/engine.h" #include "core/transaction.h" -namespace stonedb { +namespace Tianmu { namespace core { bool Engine::ConvertToField(Field *field, types::RCDataType &rcitem, std::vector *blob_buf) { if (rcitem.IsNull()) { @@ -362,23 +362,23 @@ int Engine::Convert(int &is_null, int64_t &value, types::RCDataType &rcitem, enu else if (value == common::PLUS_INF_64) value = std::numeric_limits::max(); else if (value == common::MINUS_INF_64) - value = SDB_INT_MIN; + value = TIANMU_INT_MIN; break; case MYSQL_TYPE_TINY: if (value == common::NULL_VALUE_64) value = common::NULL_VALUE_C; else if (value == common::PLUS_INF_64) - value = SDB_TINYINT_MAX; + value = TIANMU_TINYINT_MAX; else if (value == common::MINUS_INF_64) - value = SDB_TINYINT_MIN; + value = TIANMU_TINYINT_MIN; break; case MYSQL_TYPE_SHORT: if (value == common::NULL_VALUE_64) value = common::NULL_VALUE_SH; else if (value == common::PLUS_INF_64) - value = SDB_SMALLINT_MAX; + value = TIANMU_SMALLINT_MAX; else if (value == common::MINUS_INF_64) - value = SDB_SMALLINT_MIN; + value = TIANMU_SMALLINT_MIN; break; default: break; @@ -451,7 +451,7 @@ int Engine::Convert(int &is_null, String *value, types::RCDataType &rcitem, enum if (types::RCDateTime *rcdt = dynamic_cast(&rcitem)) { if (*rcdt != types::RC_TIMESTAMP_SPEC) { MYSQL_TIME local_time; - my_time_t secs = stonedb_sec_since_epoch(rcdt->Year(), rcdt->Month(), rcdt->Day(), rcdt->Hour(), + my_time_t secs = tianmu_sec_since_epoch(rcdt->Year(), rcdt->Month(), rcdt->Day(), rcdt->Hour(), rcdt->Minute(), rcdt->Second()); current_tx->Thd()->variables.time_zone->gmt_sec_to_TIME(&local_time, secs); char buf[32]; @@ -479,45 +479,45 @@ int Engine::Convert(int &is_null, String *value, types::RCDataType &rcitem, enum bool Engine::AreConvertible(types::RCDataType &rcitem, enum_field_types my_type, [[maybe_unused]] uint length) { /*if(rcitem->Type() == Engine::GetCorrespondingType(my_type, length) || rcitem->IsNull()) return true;*/ - common::CT sdbtype = rcitem.Type(); + common::CT tianmu_type = rcitem.Type(); switch (my_type) { case MYSQL_TYPE_LONGLONG: - if (sdbtype == common::CT::INT || sdbtype == common::CT::MEDIUMINT || sdbtype == common::CT::BIGINT || - (sdbtype == common::CT::NUM && dynamic_cast(rcitem).Scale() == 0)) + if (tianmu_type == common::CT::INT || tianmu_type == common::CT::MEDIUMINT || tianmu_type == common::CT::BIGINT || + (tianmu_type == common::CT::NUM && dynamic_cast(rcitem).Scale() == 0)) return true; break; case MYSQL_TYPE_NEWDECIMAL: - if (sdbtype == common::CT::FLOAT || sdbtype == common::CT::REAL || ATI::IsIntegerType(sdbtype) || - sdbtype == common::CT::NUM) + if (tianmu_type == common::CT::FLOAT || tianmu_type == common::CT::REAL || ATI::IsIntegerType(tianmu_type) || + tianmu_type == common::CT::NUM) return true; break; case MYSQL_TYPE_BLOB: case MYSQL_TYPE_TINY_BLOB: case MYSQL_TYPE_MEDIUM_BLOB: case MYSQL_TYPE_LONG_BLOB: - return (sdbtype == common::CT::STRING || sdbtype == common::CT::VARCHAR || sdbtype == common::CT::BYTE || - sdbtype == common::CT::VARBYTE || sdbtype == common::CT::LONGTEXT || sdbtype == common::CT::BIN); + return (tianmu_type == common::CT::STRING || tianmu_type == common::CT::VARCHAR || tianmu_type == common::CT::BYTE || + tianmu_type == common::CT::VARBYTE || tianmu_type == common::CT::LONGTEXT || tianmu_type == common::CT::BIN); case MYSQL_TYPE_YEAR: - return sdbtype == common::CT::YEAR; + return tianmu_type == common::CT::YEAR; case MYSQL_TYPE_SHORT: - return sdbtype == common::CT::SMALLINT; + return tianmu_type == common::CT::SMALLINT; case MYSQL_TYPE_TINY: - return sdbtype == common::CT::BYTEINT; + return tianmu_type == common::CT::BYTEINT; case MYSQL_TYPE_INT24: - return sdbtype == common::CT::MEDIUMINT; + return tianmu_type == common::CT::MEDIUMINT; case MYSQL_TYPE_LONG: - return sdbtype == common::CT::INT; + return tianmu_type == common::CT::INT; case MYSQL_TYPE_FLOAT: case MYSQL_TYPE_DOUBLE: - return sdbtype == common::CT::FLOAT || sdbtype == common::CT::REAL; + return tianmu_type == common::CT::FLOAT || tianmu_type == common::CT::REAL; case MYSQL_TYPE_TIMESTAMP: case MYSQL_TYPE_DATETIME: - return (sdbtype == common::CT::DATETIME || sdbtype == common::CT::TIMESTAMP); + return (tianmu_type == common::CT::DATETIME || tianmu_type == common::CT::TIMESTAMP); case MYSQL_TYPE_TIME: - return sdbtype == common::CT::TIME; + return tianmu_type == common::CT::TIME; case MYSQL_TYPE_NEWDATE: case MYSQL_TYPE_DATE: - return sdbtype == common::CT::DATE; + return tianmu_type == common::CT::DATE; case MYSQL_TYPE_VARCHAR: case MYSQL_TYPE_STRING: case MYSQL_TYPE_VAR_STRING: @@ -629,4 +629,4 @@ AttributeTypeInfo Engine::GetCorrespondingATI(Field &field) { return AttributeTypeInfo(at, !field.maybe_null(), field.field_length); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/engine_execute.cpp b/storage/tianmu/core/engine_execute.cpp similarity index 85% rename from storage/stonedb/core/engine_execute.cpp rename to storage/tianmu/core/engine_execute.cpp index ee05092319..02a41ab0c7 100644 --- a/storage/stonedb/core/engine_execute.cpp +++ b/storage/tianmu/core/engine_execute.cpp @@ -28,11 +28,11 @@ #include "util/log_ctl.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { int optimize_select(THD *thd, ulong select_options, Query_result *result, - SELECT_LEX *select_lex, int &optimize_after_sdb, int &free_join); + SELECT_LEX *select_lex, int &optimize_after_tianmu, int &free_join); class KillTimer { public: @@ -44,7 +44,7 @@ class KillTimer { sev._sigev_un._tid = syscall(SYS_gettid); sev.sigev_value.sival_ptr = thd; if (timer_create(CLOCK_MONOTONIC, &sev, &id)) { - STONEDB_LOG(LogCtl_Level::INFO, "Failed to create timer. error =%d[%s]", errno, std::strerror(errno)); + TIANMU_LOG(LogCtl_Level::INFO, "Failed to create timer. error =%d[%s]", errno, std::strerror(errno)); return; } @@ -52,7 +52,7 @@ class KillTimer { std::memset(&interval, 0, sizeof(interval)); interval.it_value.tv_sec = secs; if (timer_settime(id, 0, &interval, NULL)) { - STONEDB_LOG(LogCtl_Level::INFO, "Failed to set up timer. error =%d[%s]", errno, std::strerror(errno)); + TIANMU_LOG(LogCtl_Level::INFO, "Failed to set up timer. error =%d[%s]", errno, std::strerror(errno)); return; } armed = true; @@ -71,31 +71,31 @@ class KillTimer { Handles a single query If an error appears during query preparation/optimization query structures are cleaned up and the function returns information about the -error through res'. If the query can not be compiled by StoneDB engine +error through res'. If the query can not be compiled by Tianmu engine RETURN_QUERY_TO_MYSQL_ROUTE is returned and MySQL engine continues query execution. */ int Engine::HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_tables_done_option, int &res, - int &optimize_after_sdb, int &sdb_free_join, int with_insert) { - KillTimer timer(thd, stonedb_sysvar_max_execution_time); + int &optimize_after_tianmu, int &tianmu_free_join, int with_insert) { + KillTimer timer(thd, tianmu_sysvar_max_execution_time); int in_case_of_failure_can_go_to_mysql; - optimize_after_sdb = FALSE; - sdb_free_join = 0; + optimize_after_tianmu = FALSE; + tianmu_free_join = 0; SELECT_LEX_UNIT *unit = NULL; SELECT_LEX *select_lex = NULL; Query_result_export *se = NULL; - if (stonedb_sysvar_pushdown) + if (tianmu_sysvar_pushdown) thd->variables.optimizer_switch|=OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN; - if (!IsSDBRoute(thd, lex->query_tables, lex->select_lex, in_case_of_failure_can_go_to_mysql, with_insert)) { + if (!IsTIANMURoute(thd, lex->query_tables, lex->select_lex, in_case_of_failure_can_go_to_mysql, with_insert)) { return RETURN_QUERY_TO_MYSQL_ROUTE; } if (lock_tables(thd, thd->lex->query_tables, thd->lex->table_count, 0)) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to lock tables for query '%s'", thd->query().str); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to lock tables for query '%s'", thd->query().str); return RCBASE_QUERY_ROUTE; } /* @@ -104,11 +104,11 @@ int Engine::HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_ */ query_cache.store_query(thd, thd->lex->query_tables); - stonedb_stat.select++; + tianmu_stat.select++; // at this point all tables are in RCBase engine, so we can proceed with the - // query and we know that if the result goes to the file, the SDB_DATAFORMAT is - // one of SDB formats + // query and we know that if the result goes to the file, the TIANMU_DATAFORMAT is + // one of TIANMU formats int route = RCBASE_QUERY_ROUTE; SELECT_LEX *save_current_select = lex->current_select(); List derived_optimized; // collection to remember derived @@ -137,19 +137,19 @@ int Engine::HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_ // materialized?) // OR not cacheable (meaning not yet in cache, i.e. not // materialized it seems to boil down to NOT MATERIALIZED(?) - res = cursor->derived_unit()->optimize_for_stonedb(); //===exec() + res = cursor->derived_unit()->optimize_for_tianmu(); //===exec() derived_optimized.push_back(cursor->derived_unit()); } } else { //??not union cursor->derived_unit()->set_limit(first_select); if (cursor->derived_unit()->select_limit_cnt == HA_POS_ERROR) first_select->remove_base_options(OPTION_FOUND_ROWS); lex->set_current_select(first_select); - int optimize_derived_after_sdb = FALSE; + int optimize_derived_after_tianmu = FALSE; res = optimize_select( thd, ulong(first_select->active_options() | thd->variables.option_bits | SELECT_NO_UNLOCK), - (Query_result*)cursor->derived_result, first_select, optimize_derived_after_sdb, + (Query_result*)cursor->derived_result, first_select, optimize_derived_after_tianmu, free_join); - if (optimize_derived_after_sdb) derived_optimized.push_back(cursor->derived_unit()); + if (optimize_derived_after_tianmu) derived_optimized.push_back(cursor->derived_unit()); } lex->set_current_select(save_current_select); if (!res && free_join) // no error & @@ -160,7 +160,7 @@ int Engine::HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_ } se = dynamic_cast(result); - if (se != NULL) result = new exporter::select_sdb_export(se); + if (se != NULL) result = new exporter::select_tianmu_export(se); // prepare, optimize and execute the main query select_lex = lex->select_lex; unit = lex->unit; @@ -178,8 +178,8 @@ int Engine::HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_ route = RETURN_QUERY_TO_MYSQL_ROUTE; else { int old_executed = unit->is_executed(); - res = unit->optimize_for_stonedb(); //====exec() - optimize_after_sdb = TRUE; + res = unit->optimize_for_tianmu(); //====exec() + optimize_after_tianmu = TRUE; if (!res) { try { route = rceng->Execute(unit->thd, unit->thd->lex, result, unit); @@ -192,10 +192,10 @@ int Engine::HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_ else { const char *err_msg = - "Error: Query syntax not implemented in StoneDB, can " + "Error: Query syntax not implemented in Tianmu, can " "export " - "only to MySQL format (set SDB_DATAFORMAT to 'MYSQL')."; - STONEDB_LOG(LogCtl_Level::ERROR, err_msg); + "only to MySQL format (set TIANMU_DATAFORMAT to 'MYSQL')."; + TIANMU_LOG(LogCtl_Level::ERROR, err_msg); my_message(ER_SYNTAX_ERROR, err_msg, MYF(0)); throw ReturnMeToMySQLWithError(); } @@ -209,7 +209,7 @@ int Engine::HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_ } if (res || route == RCBASE_QUERY_ROUTE) { res |= (int)unit->cleanup(0); - optimize_after_sdb = FALSE; + optimize_after_tianmu = FALSE; } } else { unit->set_limit(unit->global_parameters()); // the fragment of original @@ -224,20 +224,20 @@ int Engine::HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_ int err; err = optimize_select( thd, ulong(select_lex->active_options() | thd->variables.option_bits | setup_tables_done_option), result, - select_lex, optimize_after_sdb, sdb_free_join); + select_lex, optimize_after_tianmu, tianmu_free_join); // RCBase query engine entry point if (!err) { try { route = Execute(thd, lex, result); if (route == RETURN_QUERY_TO_MYSQL_ROUTE && !in_case_of_failure_can_go_to_mysql) { - STONEDB_LOG(LogCtl_Level::ERROR, - "Error: Query syntax not implemented in StoneDB, can export " - "only to MySQL format (set SDB_DATAFORMAT to 'MYSQL')."); + TIANMU_LOG(LogCtl_Level::ERROR, + "Error: Query syntax not implemented in Tianmu, can export " + "only to MySQL format (set TIANMU_DATAFORMAT to 'MYSQL')."); my_message(ER_SYNTAX_ERROR, - "Query syntax not implemented in StoneDB, can export only " + "Query syntax not implemented in Tianmu, can export only " "to MySQL " - "format (set SDB_DATAFORMAT to 'MYSQL').", + "format (set TIANMU_DATAFORMAT to 'MYSQL').", MYF(0)); throw ReturnMeToMySQLWithError(); } @@ -246,20 +246,20 @@ int Engine::HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_ err = TRUE; } } - if (sdb_free_join) { // there was a join created in an upper function + if (tianmu_free_join) { // there was a join created in an upper function // so an upper function will do the cleanup if (err || route == RCBASE_QUERY_ROUTE) { thd->proc_info = "end"; err |= (int)select_lex->cleanup(0); - optimize_after_sdb = FALSE; - sdb_free_join = 0; + optimize_after_tianmu = FALSE; + tianmu_free_join = 0; } res = (err || thd->is_error()); } else res = select_lex->join->error; } if (select_lex->join && Query::IsLOJ(select_lex->join_list)) - optimize_after_sdb = 2; // optimize partially (part=4), since part of LOJ + optimize_after_tianmu = 2; // optimize partially (part=4), since part of LOJ // optimization was already done res |= (int)thd->is_error(); // the ending of original handle_select(...) */ if (unlikely(res)) { @@ -268,12 +268,12 @@ int Engine::HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_ result->abort_result_set(); } if (se != NULL) { - // free the sdb export object, + // free the tianmu export object, // restore the original mysql export object // and prepare if it is expected to be prepared if (!select_lex->next_select() && select_lex->join != 0 && select_lex->query_result() == result) { select_lex->set_query_result(se); - if (((exporter::select_sdb_export *)result)->IsPrepared()) + if (((exporter::select_tianmu_export *)result)->IsPrepared()) se->prepare(select_lex->join->fields_list, unit); } @@ -289,7 +289,7 @@ int Engine::HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_ for (TABLE_LIST *cursor = sl->get_table_list(); cursor; cursor = cursor->next_local) if (cursor->table && cursor->is_derived()) { lex->thd->derived_tables_processing = TRUE; - cursor->derived_unit()->optimize_after_stonedb(); + cursor->derived_unit()->optimize_after_tianmu(); } lex->set_current_select(save_current_select); } @@ -299,10 +299,10 @@ int Engine::HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_ } /* -Prepares and optimizes a single select for StoneDB engine +Prepares and optimizes a single select for Tianmu engine */ int optimize_select(THD *thd, ulong select_options, Query_result *result, - SELECT_LEX *select_lex, int &optimize_after_sdb, int &free_join) + SELECT_LEX *select_lex, int &optimize_after_tianmu, int &free_join) { // copied from sql_select.cpp from the beginning of mysql_select(...) int err = 0; @@ -348,7 +348,7 @@ int optimize_select(THD *thd, ulong select_options, Query_result *result, } join->best_rowcount = 2; - optimize_after_sdb = TRUE; + optimize_after_tianmu = TRUE; if ((err = join->optimize(1))) return err; return FALSE; @@ -366,7 +366,7 @@ int Engine::Execute(THD *thd, LEX *lex, Query_result *result_output, SELECT_LEX_ const char *export_file_name = GetFilename(selects_list, is_dumpfile); if (is_dumpfile) { push_warning(thd, Sql_condition::SL_NOTE, ER_UNKNOWN_ERROR, - "Dumpfile not implemented in StoneDB, executed by MySQL engine."); + "Dumpfile not implemented in Tianmu, executed by MySQL engine."); return RETURN_QUERY_TO_MYSQL_ROUTE; } @@ -379,12 +379,12 @@ int Engine::Execute(THD *thd, LEX *lex, Query_result *result_output, SELECT_LEX_ try { if (!query.Compile(&cqu, selects_list, last_distinct)) { push_warning(thd, Sql_condition::SL_NOTE, ER_UNKNOWN_ERROR, - "Query syntax not implemented in StoneDB, executed by MySQL engine."); + "Query syntax not implemented in Tianmu, executed by MySQL engine."); return RETURN_QUERY_TO_MYSQL_ROUTE; } } catch (common::Exception const &x) { - STONEDB_LOG(LogCtl_Level::ERROR, "Query Compile Error: %s", x.what()); - my_message(ER_UNKNOWN_ERROR, (std::string("StoneDB compile specific error: ") + x.what()).c_str(), MYF(0)); + TIANMU_LOG(LogCtl_Level::ERROR, "Query Compile Error: %s", x.what()); + my_message(ER_UNKNOWN_ERROR, (std::string("Tianmu compile specific error: ") + x.what()).c_str(), MYF(0)); throw ReturnMeToMySQLWithError(); } @@ -396,15 +396,15 @@ int Engine::Execute(THD *thd, LEX *lex, Query_result *result_output, SELECT_LEX_ try { std::shared_ptr rct; if (lex->sql_command == SQLCOM_INSERT_SELECT && - Engine::IsSDBTable(((Query_tables_list *)lex)->query_tables->table)) { + Engine::IsTIANMUTable(((Query_tables_list *)lex)->query_tables->table)) { std::string table_path = Engine::GetTablePath(((Query_tables_list *)lex)->query_tables->table); rct = current_tx->GetTableByPathIfExists(table_path); } if (unit_for_union != NULL && !unit_for_union->is_prepared()) { int res = result_output->prepare(unit_for_union->item_list, unit_for_union); if (res) { - STONEDB_LOG(LogCtl_Level::ERROR, "Error: Unsupported UNION"); - my_message(ER_UNKNOWN_ERROR, "StoneDB: unsupported UNION", MYF(0)); + TIANMU_LOG(LogCtl_Level::ERROR, "Error: Unsupported UNION"); + my_message(ER_UNKNOWN_ERROR, "Tianmu: unsupported UNION", MYF(0)); throw ReturnMeToMySQLWithError(); } if (export_file_name) @@ -455,13 +455,13 @@ int handle_exceptions(THD *thd, Transaction *cur_connection, bool with_error) { try { std::string msg = "Query terminated with exception: "; msg += thd->query().str; - STONEDB_LOG(LogCtl_Level::INFO, msg); + TIANMU_LOG(LogCtl_Level::INFO, msg); throw; } catch (common::NotImplementedException const &x) { rccontrol.lock(cur_connection->GetThreadID()) << "Switched to MySQL: " << x.what() << system::unlock; my_message(ER_UNKNOWN_ERROR, (std::string("The query includes syntax that is not supported " - "by the storage engine. StoneDB: ") + + "by the storage engine. Tianmu: ") + x.what()) .c_str(), MYF(0)); @@ -474,17 +474,17 @@ int handle_exceptions(THD *thd, Transaction *cur_connection, bool with_error) { } catch (common::OutOfMemoryException const &x) { rccontrol.lock(cur_connection->GetThreadID()) << "Error: " << x.what() << system::unlock; my_message(static_cast(common::ErrorCode::OUT_OF_MEMORY), - (std::string("StoneDB out of resources error: ") + x.what()).c_str(), MYF(0)); + (std::string("Tianmu out of resources error: ") + x.what()).c_str(), MYF(0)); throw ReturnMeToMySQLWithError(); } catch (common::DataTypeConversionException const &x) { rccontrol.lock(cur_connection->GetThreadID()) << "Error: " << x.what() << system::unlock; my_message(static_cast(common::ErrorCode::DATACONVERSION), - (std::string("StoneDB specific error: ") + x.what()).c_str(), MYF(0)); + (std::string("Tianmu specific error: ") + x.what()).c_str(), MYF(0)); throw ReturnMeToMySQLWithError(); } catch (common::DBObjectException const &x) { // the subselect had more than one row in a comparison // without ANY or ALL rccontrol.lock(cur_connection->GetThreadID()) << "Error: " << x.what() << system::unlock; - my_message(ER_SYNTAX_ERROR, (std::string("StoneDB specific error: ") + x.what()).c_str(), MYF(0)); + my_message(ER_SYNTAX_ERROR, (std::string("Tianmu specific error: ") + x.what()).c_str(), MYF(0)); throw ReturnMeToMySQLWithError(); } catch (common::KilledException const &) { rccontrol.lock(cur_connection->GetThreadID()) << "Stopped by user. " << system::unlock; @@ -493,23 +493,23 @@ int handle_exceptions(THD *thd, Transaction *cur_connection, bool with_error) { } catch (common::FileException const &e) { rccontrol.lock(cur_connection->GetThreadID()) << "Error: " << e.what() << system::unlock; my_message(static_cast(common::ErrorCode::CANNOT_OPEN_FILE_OR_PIPE), - (std::string("StoneDB specific error: ") + e.what()).c_str(), MYF(0)); + (std::string("Tianmu specific error: ") + e.what()).c_str(), MYF(0)); throw ReturnMeToMySQLWithError(); } catch (common::Exception const &x) { rccontrol.lock(cur_connection->GetThreadID()) << "Error: " << x.what() << system::unlock; - my_message(ER_UNKNOWN_ERROR, "StoneDB other specific error", MYF(0)); + my_message(ER_UNKNOWN_ERROR, "Tianmu other specific error", MYF(0)); throw ReturnMeToMySQLWithError(); } catch (std::bad_alloc const &) { rccontrol.lock(cur_connection->GetThreadID()) << "Error: std::bad_alloc caught" << system::unlock; - my_message(ER_UNKNOWN_ERROR, (std::string("StoneDB out of memory error")).c_str(), MYF(0)); + my_message(ER_UNKNOWN_ERROR, (std::string("Tianmu out of memory error")).c_str(), MYF(0)); throw ReturnMeToMySQLWithError(); } return RETURN_QUERY_TO_MYSQL_ROUTE; } } // namespace core -} // namespace stonedb +} // namespace Tianmu -int st_select_lex_unit::optimize_for_stonedb() { +int st_select_lex_unit::optimize_for_tianmu() { // copied from sql_union.cpp from the beginning of st_select_lex_unit::exec() SELECT_LEX *lex_select_save = thd->lex->current_select(); SELECT_LEX *select_cursor = first_select(); @@ -620,7 +620,7 @@ int st_select_lex_unit::optimize_for_stonedb() { return FALSE; } -int st_select_lex_unit::optimize_after_stonedb() +int st_select_lex_unit::optimize_after_tianmu() { SELECT_LEX *lex_select_save = thd->lex->current_select(); for (SELECT_LEX *sl = first_select(); sl; sl = sl->next_select()) { diff --git a/storage/stonedb/core/engine_results.cpp b/storage/tianmu/core/engine_results.cpp similarity index 98% rename from storage/stonedb/core/engine_results.cpp rename to storage/tianmu/core/engine_results.cpp index d1b5cb46e2..b344005e92 100644 --- a/storage/stonedb/core/engine_results.cpp +++ b/storage/tianmu/core/engine_results.cpp @@ -23,7 +23,7 @@ #include "types/rc_item_types.h" #include "types/value_parser4txt.h" -namespace stonedb { +namespace Tianmu { namespace core { void scan_fields(List &fields, uint *&buf_lens, std::map &items_backup) { Item *item; @@ -382,7 +382,7 @@ void ResultSender::Finalize(TempTable *result_table) { << "\tClientPort:" << thd->peer_port << "\tUser:" << sctx.user().str << glob_serverInfo << "\tAffectRows:" << affect_rows << "\tResultRows:" << rows_sent << "\tDBName:" << thd->db().str << "\tCosttime(ms):" << cost_time << "\tSQL:" << thd->query().str << system::unlock; - STONEDB_LOG(LogCtl_Level::DEBUG, "Result: %" PRId64 " Costtime(ms): %" PRId64, rows_sent, cost_time); + TIANMU_LOG(LogCtl_Level::DEBUG, "Result: %" PRId64 " Costtime(ms): %" PRId64, rows_sent, cost_time); } void ResultSender::CleanUp() { restore_fields(fields, items_backup); } @@ -393,7 +393,7 @@ ResultSender::~ResultSender() { delete[] buf_lens; } ResultExportSender::ResultExportSender(THD *thd, Query_result *result, List &fields) : ResultSender(thd, result, fields) { - export_res = dynamic_cast(result); + export_res = dynamic_cast(result); DEBUG_ASSERT(export_res); } @@ -459,11 +459,11 @@ void ResultExportSender::Init(TempTable *t) { std::unique_ptr iop; - common::SDBError sdberror; + common::TIANMUError tianmu_error; export_res->send_result_set_metadata(fields, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF); - if ((sdberror = Engine::GetIOP(iop, *thd, *export_res->SqlExchange(), 0, NULL, true)) != common::ErrorCode::SUCCESS) + if ((tianmu_error = Engine::GetIOP(iop, *thd, *export_res->SqlExchange(), 0, NULL, true)) != common::ErrorCode::SUCCESS) throw common::Exception("Unable to get IOP"); List_iterator_fast li(fields); @@ -547,4 +547,4 @@ void ResultExportSender::SendRecord(const std::vectorPutRowEnd(); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/filter.cpp b/storage/tianmu/core/filter.cpp similarity index 99% rename from storage/stonedb/core/filter.cpp rename to storage/tianmu/core/filter.cpp index 5ca8b16822..22a9faa577 100644 --- a/storage/stonedb/core/filter.cpp +++ b/storage/tianmu/core/filter.cpp @@ -19,7 +19,7 @@ #include "common/assert.h" #include "core/tools.h" -namespace stonedb { +namespace Tianmu { namespace core { std::mutex HeapAllocator::mtx; TheFilterBlockOwner *the_filter_block_owner; @@ -127,7 +127,7 @@ void Filter::Construct(bool all_ones, bool shallow) { blocks[i] = NULL; } block_last_one[no_blocks - 1] = no_of_bits_in_last_block - 1; - // No idea how to create an allocator for the pool below to use SDB heap, + // No idea how to create an allocator for the pool below to use TIANMU heap, // due to static methods in allocator } ConstructPool(); @@ -868,4 +868,4 @@ void Filter::BlockAllocator::Dealloc(Block *b) { block_object_pool.free(b); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/filter.h b/storage/tianmu/core/filter.h similarity index 99% rename from storage/stonedb/core/filter.h rename to storage/tianmu/core/filter.h index ac334bbee4..322a40fc3a 100644 --- a/storage/stonedb/core/filter.h +++ b/storage/tianmu/core/filter.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_FILTER_H_ -#define STONEDB_CORE_FILTER_H_ +#ifndef TIANMU_CORE_FILTER_H_ +#define TIANMU_CORE_FILTER_H_ #pragma once #include @@ -28,7 +28,7 @@ #include "system/rc_system.h" #include "util/circ_buf.h" -namespace stonedb { +namespace Tianmu { namespace core { class HeapAllocator : public mm::TraceableObject { public: @@ -300,7 +300,7 @@ class Filter final : public mm::TraceableObject { 0, 1, 0, 2, 0, 1, 0, 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, }; - // No idea how to create an allocator for the pool below to use SDB heap, due + // No idea how to create an allocator for the pool below to use TIANMU heap, due // to static methods in allocator }; class BlockAllocator { @@ -477,6 +477,6 @@ class FilterOnesIteratorOrdered : public FilterOnesIterator { bool IteratorBpp() override; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_FILTER_H_ +#endif // TIANMU_CORE_FILTER_H_ diff --git a/storage/stonedb/core/filter_block.cpp b/storage/tianmu/core/filter_block.cpp similarity index 99% rename from storage/stonedb/core/filter_block.cpp rename to storage/tianmu/core/filter_block.cpp index fe290ecec6..474d53f78c 100644 --- a/storage/stonedb/core/filter_block.cpp +++ b/storage/tianmu/core/filter_block.cpp @@ -20,7 +20,7 @@ #include "core/filter.h" #include "core/tools.h" -namespace stonedb { +namespace Tianmu { namespace core { Filter::Block::Block(Filter *owner, int _no_obj, bool all_full) { @@ -292,4 +292,4 @@ void Filter::Block::Not() { no_set_bits = new_set_bits; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/filter_iterators.cpp b/storage/tianmu/core/filter_iterators.cpp similarity index 99% rename from storage/stonedb/core/filter_iterators.cpp rename to storage/tianmu/core/filter_iterators.cpp index c7853c9160..fd66162096 100644 --- a/storage/stonedb/core/filter_iterators.cpp +++ b/storage/tianmu/core/filter_iterators.cpp @@ -18,7 +18,7 @@ #include "core/filter.h" #include "core/pack_orderer.h" -namespace stonedb { +namespace Tianmu { namespace core { FilterOnesIterator::FilterOnesIterator() : buffer(max_ahead) { valid = false; @@ -419,4 +419,4 @@ void FilterOnesIteratorOrdered::NextPack() { valid = false; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/ftree.cpp b/storage/tianmu/core/ftree.cpp similarity index 94% rename from storage/stonedb/core/ftree.cpp rename to storage/tianmu/core/ftree.cpp index 7460b4f5dc..11f11f7aac 100644 --- a/storage/stonedb/core/ftree.cpp +++ b/storage/tianmu/core/ftree.cpp @@ -21,9 +21,9 @@ #include #include "system/rc_system.h" -#include "system/stonedb_file.h" +#include "system/tianmu_file.h" -namespace stonedb { +namespace Tianmu { namespace core { static const size_t BUF_SIZE_LIMIT = 1_GB; @@ -42,7 +42,7 @@ FTree::FTree(const FTree &ft) if (total_buf_size > 0 && (!mem || !len || !value_offset)) { Destroy(); - STONEDB_LOG(LogCtl_Level::ERROR, "FTree, out of memory."); + TIANMU_LOG(LogCtl_Level::ERROR, "FTree, out of memory."); throw common::OutOfMemoryException(); } @@ -54,7 +54,7 @@ FTree::FTree(const FTree &ft) if (ft.hash_table && !hash_table) { Destroy(); - STONEDB_LOG(LogCtl_Level::ERROR, "FTree, out of memory."); + TIANMU_LOG(LogCtl_Level::ERROR, "FTree, out of memory."); throw common::OutOfMemoryException(); } @@ -133,9 +133,9 @@ void FTree::Init(int width) { int FTree::Add(const char *str, size_t sz) { ASSERT(hdr.max_len > 0); - if (size_t(hdr.size) > stonedb_sysvar_lookup_max_size) { + if (size_t(hdr.size) > tianmu_sysvar_lookup_max_size) { throw common::OutOfMemoryException("Too many lookup values. Dictionary size is " + - std::to_string(stonedb_sysvar_lookup_max_size)); + std::to_string(tianmu_sysvar_lookup_max_size)); } int code = HashFind(str, sz, hdr.size); @@ -191,7 +191,7 @@ int FTree::ByteSize() { } void FTree::SaveData(const fs::path &p) { - system::StoneDBFile f; + system::TianmuFile f; f.OpenCreate(p); std::vector v(ByteSize()); @@ -208,9 +208,9 @@ void FTree::SaveData(const fs::path &p) { } int len_sum = (hdr.size > 0 ? value_offset[hdr.size - 1] + len[hdr.size - 1] : 0); std::memcpy(buf, mem, len_sum); - if (STONEDB_LOGCHECK(LogCtl_Level::DEBUG)) { + if (TIANMU_LOGCHECK(LogCtl_Level::DEBUG)) { if (CheckConsistency() != 0) { - STONEDB_LOG(LogCtl_Level::DEBUG, "FTree CheckConsistency fail"); + TIANMU_LOG(LogCtl_Level::DEBUG, "FTree CheckConsistency fail"); } } } @@ -238,7 +238,7 @@ void FTree::LoadData(const fs::path &p) { buf += sizeof(HDR); if (hdr.ver != DICT_FILE_VERSION) { - STONEDB_LOG(LogCtl_Level::ERROR, "bad dictionary version %d", hdr.ver); + TIANMU_LOG(LogCtl_Level::ERROR, "bad dictionary version %d", hdr.ver); return; } @@ -278,7 +278,7 @@ void FTree::LoadData(const fs::path &p) { void FTree::InitHash() { // Note: from the limitation below, we cannot use more than - // stonedb_sysvar_lookup_max_size + // tianmu_sysvar_lookup_max_size hash_size = int(hdr.size < 30 ? 97 : (hdr.size + 10) * 2.5); while (hash_size % 2 == 0 || hash_size % 3 == 0 || hash_size % 5 == 0 || hash_size % 7 == 0) hash_size++; dealloc(hash_table); @@ -335,4 +335,4 @@ int FTree::CheckConsistency() { return 0; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/ftree.h b/storage/tianmu/core/ftree.h similarity index 95% rename from storage/stonedb/core/ftree.h rename to storage/tianmu/core/ftree.h index 1ed38a99e1..d3276bf759 100644 --- a/storage/stonedb/core/ftree.h +++ b/storage/tianmu/core/ftree.h @@ -16,8 +16,8 @@ */ // Ftree - dictionary for strings -#ifndef STONEDB_CORE_FTREE_H_ -#define STONEDB_CORE_FTREE_H_ +#ifndef TIANMU_CORE_FTREE_H_ +#define TIANMU_CORE_FTREE_H_ #pragma once #include "core/bin_tools.h" @@ -25,7 +25,7 @@ #include "types/rc_data_types.h" #include "util/fs.h" -namespace stonedb { +namespace Tianmu { namespace core { class FTree final : public mm::TraceableObject { public: @@ -91,6 +91,6 @@ class FTree final : public mm::TraceableObject { HDR hdr{DICT_FILE_VERSION, 0, 0}; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_FTREE_H_ +#endif // TIANMU_CORE_FTREE_H_ diff --git a/storage/stonedb/core/group_distinct_cache.cpp b/storage/tianmu/core/group_distinct_cache.cpp similarity index 97% rename from storage/stonedb/core/group_distinct_cache.cpp rename to storage/tianmu/core/group_distinct_cache.cpp index 5a7adae09d..8ceb445e53 100644 --- a/storage/stonedb/core/group_distinct_cache.cpp +++ b/storage/tianmu/core/group_distinct_cache.cpp @@ -21,7 +21,7 @@ #include "system/configuration.h" -namespace stonedb { +namespace Tianmu { namespace core { GroupDistinctCache::GroupDistinctCache() : system::CacheableItem("JW", "GDC") { t = NULL; @@ -43,7 +43,7 @@ GroupDistinctCache::~GroupDistinctCache() { void GroupDistinctCache::Initialize() { DEBUG_ASSERT(no_obj > 0 && width > 0); - upper_byte_limit = stonedb_sysvar_distcache_size * 1_MB; // Default 64 MB - max size of buffer + upper_byte_limit = tianmu_sysvar_distcache_size * 1_MB; // Default 64 MB - max size of buffer buf_size = no_obj; if (no_obj > 32_GB) no_obj = 32_GB; // upper reasonable size: 32 bln rows (= up to 640 GB on disk) // this limitation should be in future released by actual disk limits @@ -174,4 +174,4 @@ void GroupDistinctCache::Omit(int64_t obj_to_omit) { cur_pos += width * obj_to_omit; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/group_distinct_cache.h b/storage/tianmu/core/group_distinct_cache.h similarity index 95% rename from storage/stonedb/core/group_distinct_cache.h rename to storage/tianmu/core/group_distinct_cache.h index 4ae7355700..00731483e6 100644 --- a/storage/stonedb/core/group_distinct_cache.h +++ b/storage/tianmu/core/group_distinct_cache.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_GROUP_DISTINCT_CACHE_H_ -#define STONEDB_CORE_GROUP_DISTINCT_CACHE_H_ +#ifndef TIANMU_CORE_GROUP_DISTINCT_CACHE_H_ +#define TIANMU_CORE_GROUP_DISTINCT_CACHE_H_ #pragma once #include "mm/traceable_object.h" #include "system/cacheable_item.h" -namespace stonedb { +namespace Tianmu { namespace core { /* * Functionality: @@ -80,6 +80,6 @@ class GroupDistinctCache : private system::CacheableItem, public mm::TraceableOb size_t buf_size; // buffer size in objects }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_GROUP_DISTINCT_CACHE_H_ +#endif // TIANMU_CORE_GROUP_DISTINCT_CACHE_H_ diff --git a/storage/stonedb/core/group_distinct_table.cpp b/storage/tianmu/core/group_distinct_table.cpp similarity index 99% rename from storage/stonedb/core/group_distinct_table.cpp rename to storage/tianmu/core/group_distinct_table.cpp index b6d2bd83c1..d1f6ae7406 100644 --- a/storage/stonedb/core/group_distinct_table.cpp +++ b/storage/tianmu/core/group_distinct_table.cpp @@ -20,7 +20,7 @@ #include "core/mi_iterator.h" #include "core/transaction.h" -namespace stonedb { +namespace Tianmu { namespace core { GroupDistinctTable::GroupDistinctTable(uint32_t power) : input_buffer(NULL), @@ -280,4 +280,4 @@ void GroupDistinctTable::Clear() // clear the tables no_of_occupied = 0; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/group_distinct_table.h b/storage/tianmu/core/group_distinct_table.h similarity index 96% rename from storage/stonedb/core/group_distinct_table.h rename to storage/tianmu/core/group_distinct_table.h index 4a72eac989..d22045b7e4 100644 --- a/storage/stonedb/core/group_distinct_table.h +++ b/storage/tianmu/core/group_distinct_table.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_GROUP_DISTINCT_TABLE_H_ -#define STONEDB_CORE_GROUP_DISTINCT_TABLE_H_ +#ifndef TIANMU_CORE_GROUP_DISTINCT_TABLE_H_ +#define TIANMU_CORE_GROUP_DISTINCT_TABLE_H_ #pragma once #include "core/bin_tools.h" @@ -24,7 +24,7 @@ #include "core/filter.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { enum class GDTResult { GBIMODE_AS_TEXT, // value successfully added to a table as a new one @@ -115,6 +115,6 @@ class GroupDistinctTable : public mm::TraceableObject { int64_t group_factor; // (g, v) -> f( g + group_factor * v ) }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_GROUP_DISTINCT_TABLE_H_ +#endif // TIANMU_CORE_GROUP_DISTINCT_TABLE_H_ diff --git a/storage/stonedb/core/group_table.cpp b/storage/tianmu/core/group_table.cpp similarity index 99% rename from storage/stonedb/core/group_table.cpp rename to storage/tianmu/core/group_table.cpp index 9d479f4ada..d74868dbb5 100644 --- a/storage/stonedb/core/group_table.cpp +++ b/storage/tianmu/core/group_table.cpp @@ -23,7 +23,7 @@ #include "core/value_matching_table.h" #include "system/fet.h" -namespace stonedb { +namespace Tianmu { namespace core { GroupTable::GroupTable(uint32_t power) { initialized = false; @@ -336,7 +336,7 @@ void GroupTable::Initialize(int64_t max_no_groups, bool parallel_allowed) { max_group_code = encoder[1]->MaxCode() * 256 + encoder[0]->MaxCode(); // wider than one-byte encoders are hard to // interpret, because of endianess swap - // STONEDB_LOG(LogCtl_Level::INFO, "primary_total_size(mem_available) %d, total_width %d, + // TIANMU_LOG(LogCtl_Level::INFO, "primary_total_size(mem_available) %d, total_width %d, // declared_max_no_groups %d", primary_total_size, total_width, // declared_max_no_groups); @@ -547,7 +547,7 @@ bool GroupTable::PutAggregatedValue(int col, int64_t row, MIIterator &mit, int64 } factor = 1; // ignore repetitions for distinct } - STONEDBAggregator *cur_aggr = aggregator[col]; + TIANMUAggregator *cur_aggr = aggregator[col]; if (factor == common::NULL_VALUE_64 && cur_aggr->FactorNeeded()) throw common::NotImplementedException("Aggregation overflow."); if (as_string) { @@ -642,4 +642,4 @@ void GroupTable::InvalidateAggregationStatistics() { } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/group_table.h b/storage/tianmu/core/group_table.h similarity index 96% rename from storage/stonedb/core/group_table.h rename to storage/tianmu/core/group_table.h index 38b0e3d160..92432a6224 100644 --- a/storage/stonedb/core/group_table.h +++ b/storage/tianmu/core/group_table.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_GROUP_TABLE_H_ -#define STONEDB_CORE_GROUP_TABLE_H_ +#ifndef TIANMU_CORE_GROUP_TABLE_H_ +#define TIANMU_CORE_GROUP_TABLE_H_ #pragma once #include "core/aggregator_advanced.h" @@ -28,7 +28,7 @@ #include "core/temp_table.h" #include "core/value_matching_table.h" -namespace stonedb { +namespace Tianmu { namespace core { // GroupTable - a tool for storing values and counters @@ -145,7 +145,7 @@ class GroupTable : public mm::TraceableObject { // for aggregators GT_Aggregation AttrOper(int col) { return operation[col]; } - STONEDBAggregator *AttrAggregator(int col) { return aggregator[col]; } + TIANMUAggregator *AttrAggregator(int col) { return aggregator[col]; } bool AttrDistinct(int col) { return distinct[col]; } int64_t UpperApproxOfGroups() { return declared_max_no_groups; } // iteration through resulting rows @@ -213,7 +213,7 @@ class GroupTable : public mm::TraceableObject { std::vector operation; // Note: these tables will be created in Initialize() std::vector distinct; std::vector vc; - std::vector aggregator; // a table of actual aggregators + std::vector aggregator; // a table of actual aggregators std::vector encoder; // encoders for grouping columns // "distinct" part @@ -230,6 +230,6 @@ class GroupTable : public mm::TraceableObject { int64_t max_total_size; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_GROUP_TABLE_H_ +#endif // TIANMU_CORE_GROUP_TABLE_H_ diff --git a/storage/stonedb/core/groupby_wrapper.cpp b/storage/tianmu/core/groupby_wrapper.cpp similarity index 99% rename from storage/stonedb/core/groupby_wrapper.cpp rename to storage/tianmu/core/groupby_wrapper.cpp index d2ce4556c7..c4bfaff995 100644 --- a/storage/stonedb/core/groupby_wrapper.cpp +++ b/storage/tianmu/core/groupby_wrapper.cpp @@ -19,7 +19,7 @@ #include "core/rc_attr.h" -namespace stonedb { +namespace Tianmu { namespace core { GroupByWrapper::GroupByWrapper(int a_size, bool distinct, Transaction *conn, uint32_t power) : distinct_watch(power), m_conn(conn), gt(power), just_distinct(distinct) { @@ -239,7 +239,7 @@ void GroupByWrapper::AddAggregatedColumn(int orig_attr_no, TempTable::Attr &a, i ? GBInputMode::GBIMODE_AS_TEXT : GBInputMode::GBIMODE_AS_INT64); - STONEDB_LOG(LogCtl_Level::DEBUG, + TIANMU_LOG(LogCtl_Level::DEBUG, "attr_no %d, input_mode[attr_no] %d, a.alias %s, a.si.separator " "%s, direction %d, ag_type %d, ag_size %d", attr_no, input_mode[attr_no], a.alias, a.si.separator.c_str(), a.si.order, ag_type, ag_size); @@ -695,4 +695,4 @@ bool DistinctWrapper::AnyOmitted() { return false; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/groupby_wrapper.h b/storage/tianmu/core/groupby_wrapper.h similarity index 98% rename from storage/stonedb/core/groupby_wrapper.h rename to storage/tianmu/core/groupby_wrapper.h index f7ab213427..aaffb51be2 100644 --- a/storage/stonedb/core/groupby_wrapper.h +++ b/storage/tianmu/core/groupby_wrapper.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_GROUPBY_WRAPPER_H_ -#define STONEDB_CORE_GROUPBY_WRAPPER_H_ +#ifndef TIANMU_CORE_GROUPBY_WRAPPER_H_ +#define TIANMU_CORE_GROUPBY_WRAPPER_H_ #pragma once #include "core/group_distinct_cache.h" @@ -26,7 +26,7 @@ #include "system/rc_system.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { // a class for remembering the status of distinct aggregations (rows omitted) class DistinctWrapper { @@ -215,6 +215,6 @@ class GroupByWrapper final { bool just_distinct; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_GROUPBY_WRAPPER_H_ +#endif // TIANMU_CORE_GROUPBY_WRAPPER_H_ diff --git a/storage/stonedb/core/hash_table.cpp b/storage/tianmu/core/hash_table.cpp similarity index 99% rename from storage/stonedb/core/hash_table.cpp rename to storage/tianmu/core/hash_table.cpp index 4403a3e58b..bb18dedec8 100644 --- a/storage/stonedb/core/hash_table.cpp +++ b/storage/tianmu/core/hash_table.cpp @@ -23,7 +23,7 @@ #include "core/transaction.h" #include "system/fet.h" -namespace stonedb { +namespace Tianmu { namespace core { namespace { const int kMaxHashConflicts = 128; @@ -248,4 +248,4 @@ int64_t HashTable::Finder::GetNextRow() { return row_to_return; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/hash_table.h b/storage/tianmu/core/hash_table.h similarity index 95% rename from storage/stonedb/core/hash_table.h rename to storage/tianmu/core/hash_table.h index 3383bfec36..3baa980a4b 100644 --- a/storage/stonedb/core/hash_table.h +++ b/storage/tianmu/core/hash_table.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_HASH_TABLE_H_ -#define STONEDB_CORE_HASH_TABLE_H_ +#ifndef TIANMU_CORE_HASH_TABLE_H_ +#define TIANMU_CORE_HASH_TABLE_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "core/bin_tools.h" #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace core { class HashTable : public mm::TraceableObject { public: @@ -90,6 +90,6 @@ class HashTable::Finder { int64_t current_iterate_step_ = 0; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_HASH_TABLE_H_ +#endif // TIANMU_CORE_HASH_TABLE_H_ diff --git a/storage/stonedb/core/index_table.cpp b/storage/tianmu/core/index_table.cpp similarity index 94% rename from storage/stonedb/core/index_table.cpp rename to storage/tianmu/core/index_table.cpp index b28b9d73a2..7d9519bc8d 100644 --- a/storage/stonedb/core/index_table.cpp +++ b/storage/tianmu/core/index_table.cpp @@ -21,7 +21,7 @@ #include "core/transaction.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace core { IndexTable::IndexTable(int64_t _size, int64_t _orig_size, [[maybe_unused]] int mem_modifier) : system::CacheableItem("JW", "INT"), m_conn(current_tx) { @@ -49,7 +49,7 @@ IndexTable::IndexTable(int64_t _size, int64_t _orig_size, [[maybe_unused]] int m buf = (unsigned char *)alloc(buffer_size_in_bytes, mm::BLOCK_TYPE::BLOCK_TEMPORARY, true); if (!buf) { Unlock(); - STONEDB_LOG(LogCtl_Level::ERROR, "Could not allocate memory for IndexTable, size :%u", buffer_size_in_bytes); + TIANMU_LOG(LogCtl_Level::ERROR, "Could not allocate memory for IndexTable, size :%u", buffer_size_in_bytes); throw common::OutOfMemoryException(); } std::memset(buf, 0, buffer_size_in_bytes); @@ -79,7 +79,7 @@ IndexTable::IndexTable(IndexTable &sec) if (!buf) { sec.Unlock(); Unlock(); - STONEDB_LOG(LogCtl_Level::ERROR, "Could not allocate memory for IndexTable(sec)!"); + TIANMU_LOG(LogCtl_Level::ERROR, "Could not allocate memory for IndexTable(sec)!"); throw common::OutOfMemoryException(); } int64_t used_size = size; @@ -104,7 +104,7 @@ void IndexTable::LoadBlock(int b) { if (buf == NULL) { // possible after block caching on disk buf = (unsigned char *)alloc(buffer_size_in_bytes, mm::BLOCK_TYPE::BLOCK_TEMPORARY, true); if (!buf) { - STONEDB_LOG(LogCtl_Level::ERROR, "Could not allocate memory for IndexTable(LoadBlock)."); + TIANMU_LOG(LogCtl_Level::ERROR, "Could not allocate memory for IndexTable(LoadBlock)."); throw common::OutOfMemoryException(); } } else if (block_changed) @@ -157,4 +157,4 @@ void IndexTable::SetByFilter(Filter *f, uint32_t power) // add all positions wh } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/index_table.h b/storage/tianmu/core/index_table.h similarity index 96% rename from storage/stonedb/core/index_table.h rename to storage/tianmu/core/index_table.h index 79faeb78c3..1e1d3228bb 100644 --- a/storage/stonedb/core/index_table.h +++ b/storage/tianmu/core/index_table.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_INDEX_TABLE_H_ -#define STONEDB_CORE_INDEX_TABLE_H_ +#ifndef TIANMU_CORE_INDEX_TABLE_H_ +#define TIANMU_CORE_INDEX_TABLE_H_ #pragma once #include #include "mm/traceable_object.h" #include "system/cacheable_item.h" -namespace stonedb { +namespace Tianmu { namespace core { class Filter; class Transaction; @@ -131,6 +131,6 @@ class IndexTable : private system::CacheableItem, public mm::TraceableObject { Transaction *m_conn; // external pointer }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_INDEX_TABLE_H_ \ No newline at end of file +#endif // TIANMU_CORE_INDEX_TABLE_H_ \ No newline at end of file diff --git a/storage/stonedb/core/item_sdbfield.cpp b/storage/tianmu/core/item_tianmu_field.cpp similarity index 63% rename from storage/stonedb/core/item_sdbfield.cpp rename to storage/tianmu/core/item_tianmu_field.cpp index a722a88e4e..b6096b72d9 100644 --- a/storage/stonedb/core/item_sdbfield.cpp +++ b/storage/tianmu/core/item_tianmu_field.cpp @@ -15,16 +15,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "item_sdbfield.h" +#include "item_tianmu_field.h" #include "common/assert.h" #include "core/compilation_tools.h" #include "core/quick_math.h" #include "core/transaction.h" -namespace stonedb { +namespace Tianmu { namespace core { -Item_sdbfield::Item_sdbfield(Item_field *ifield, VarID varID) +Item_tianmufield::Item_tianmufield(Item_field *ifield, VarID varID) : Item_field(current_tx->Thd(), ifield), ifield(ifield), buf(NULL), ivalue(NULL) { this->varID.push_back(varID); if (ifield->type() == Item::SUM_FUNC_ITEM) { @@ -32,24 +32,24 @@ Item_sdbfield::Item_sdbfield(Item_field *ifield, VarID varID) aggregation_result = ifield->result_type(); } else was_aggregation = false; - std::sprintf(fullname, "sdbfield of %p", (void *)ifield); + std::sprintf(fullname, "tianmufield of %p", (void *)ifield); isBufOwner = false; } -Item_sdbfield::~Item_sdbfield() { - // if(ivalue != NULL) delete ivalue; // done by MySQL not STONEDB, for each Item +Item_tianmufield::~Item_tianmufield() { + // if(ivalue != NULL) delete ivalue; // done by MySQL not TIANMU, for each Item // subclass ClearBuf(); } -void Item_sdbfield::ClearBuf() { +void Item_tianmufield::ClearBuf() { if (isBufOwner) { delete buf; buf = NULL; } } -void Item_sdbfield::SetBuf(ValueOrNull *&b) { +void Item_tianmufield::SetBuf(ValueOrNull *&b) { if (buf == NULL) { isBufOwner = true; buf = new ValueOrNull; @@ -57,19 +57,19 @@ void Item_sdbfield::SetBuf(ValueOrNull *&b) { b = buf; } -void Item_sdbfield::SetType(DataType t) { +void Item_tianmufield::SetType(DataType t) { if (ivalue != NULL) { - // delete ivalue; // done by MySQL not STONEDB, for each Item subclass + // delete ivalue; // done by MySQL not TIANMU, for each Item subclass ivalue = NULL; } - sdbtype = t; - switch (sdbtype.valtype) { + tianmu_type = t; + switch (tianmu_type.valtype) { case DataType::ValueType::VT_FIXED: - if (sdbtype.IsInt()) + if (tianmu_type.IsInt()) ivalue = new Item_int(static_cast(0)); else - ivalue = new Item_sdbdecimal(sdbtype); + ivalue = new Item_tianmudecimal(tianmu_type); ivalue->unsigned_flag = ifield->unsigned_flag; break; @@ -82,45 +82,45 @@ void Item_sdbfield::SetType(DataType t) { break; case DataType::ValueType::VT_DATETIME: - switch (sdbtype.attrtype) { + switch (tianmu_type.attrtype) { case common::CT::DATETIME: - ivalue = new Item_sdbdatetime(); + ivalue = new Item_tianmudatetime(); break; case common::CT::TIMESTAMP: - ivalue = new Item_sdbtimestamp(); + ivalue = new Item_tianmutimestamp(); break; case common::CT::DATE: - ivalue = new Item_sdbdate(); + ivalue = new Item_tianmudate(); break; case common::CT::TIME: - ivalue = new Item_sdbtime(); + ivalue = new Item_tianmutime(); break; case common::CT::YEAR: - ivalue = new Item_sdbyear(sdbtype.precision); + ivalue = new Item_tianmuyear(tianmu_type.precision); break; default: - STONEDB_ERROR( + TIANMU_ERROR( "Incorrect date/time data type passed to " - "Item_sdbfield::SetType()"); + "Item_tianmufield::SetType()"); break; } break; default: - STONEDB_ERROR("Incorrect data type passed to Item_sdbfield::SetType()"); + TIANMU_ERROR("Incorrect data type passed to Item_tianmufield::SetType()"); break; } } -const ValueOrNull Item_sdbfield::GetCurrentValue() { return *buf; } +const ValueOrNull Item_tianmufield::GetCurrentValue() { return *buf; } -void Item_sdbfield::FeedValue() { - switch (sdbtype.valtype) { +void Item_tianmufield::FeedValue() { + switch (tianmu_type.valtype) { case DataType::ValueType::VT_FIXED: - if (sdbtype.IsInt()) + if (tianmu_type.IsInt()) ((Item_int *)ivalue)->value = buf->Get64(); else - ((Item_sdbdecimal *)ivalue)->Set(buf->Get64()); + ((Item_tianmudecimal *)ivalue)->Set(buf->Get64()); break; case DataType::ValueType::VT_FLOAT: @@ -132,39 +132,39 @@ void Item_sdbfield::FeedValue() { break; case DataType::ValueType::VT_DATETIME: - ((Item_sdbdatetime_base *)ivalue)->Set(buf->Get64(), sdbtype.attrtype); + ((Item_tianmudatetime_base *)ivalue)->Set(buf->Get64(), tianmu_type.attrtype); break; default: - STONEDB_ERROR("Unrecognized type in Item_sdbfield::FeedValue()"); + TIANMU_ERROR("Unrecognized type in Item_tianmufield::FeedValue()"); } } -double Item_sdbfield::val_real() { +double Item_tianmufield::val_real() { // DBUG_ASSERT(fixed == 1); if ((null_value = buf->null)) return 0.0; FeedValue(); return ivalue->val_real(); } -longlong Item_sdbfield::val_int() { +longlong Item_tianmufield::val_int() { // DBUG_ASSERT(fixed == 1); if ((null_value = buf->null)) return 0; FeedValue(); return ivalue->val_int(); } -my_decimal *Item_sdbfield::val_decimal(my_decimal *decimal_value) { +my_decimal *Item_tianmufield::val_decimal(my_decimal *decimal_value) { if ((null_value = buf->null)) return 0; FeedValue(); return ivalue->val_decimal(decimal_value); } -String *Item_sdbfield::val_str(String *str) { +String *Item_tianmufield::val_str(String *str) { // DBUG_ASSERT(fixed == 1); if ((null_value = buf->null)) return 0; // acceleration - if (sdbtype.valtype == DataType::ValueType::VT_STRING) { + if (tianmu_type.valtype == DataType::ValueType::VT_STRING) { str->copy(buf->sp, buf->len, ifield->collation.collation); return str; } @@ -173,38 +173,38 @@ String *Item_sdbfield::val_str(String *str) { return str; } -bool Item_sdbfield::get_date(MYSQL_TIME *ltime, uint fuzzydate) { +bool Item_tianmufield::get_date(MYSQL_TIME *ltime, uint fuzzydate) { if ((null_value = buf->null) || ((!(fuzzydate & TIME_FUZZY_DATE) && - (sdbtype.attrtype == common::CT::DATETIME || sdbtype.attrtype == common::CT::DATE) && buf->x == 0))) + (tianmu_type.attrtype == common::CT::DATETIME || tianmu_type.attrtype == common::CT::DATE) && buf->x == 0))) return 1; // like in Item_field::get_date - return 1 on null value. FeedValue(); return ivalue->get_date(ltime, fuzzydate); } -bool Item_sdbfield::get_time(MYSQL_TIME *ltime) { - if ((null_value = buf->null) || ((sdbtype.attrtype == common::CT::DATETIME || sdbtype.attrtype == common::CT::DATE) && +bool Item_tianmufield::get_time(MYSQL_TIME *ltime) { + if ((null_value = buf->null) || ((tianmu_type.attrtype == common::CT::DATETIME || tianmu_type.attrtype == common::CT::DATE) && buf->x == 0)) // zero date is illegal return 1; // like in Item_field::get_time - return 1 on null value. FeedValue(); return ivalue->get_time(ltime); } -bool Item_sdbfield::get_timeval(struct timeval *tm, int *warnings) { +bool Item_tianmufield::get_timeval(struct timeval *tm, int *warnings) { MYSQL_TIME ltime; if (get_time(<ime)) return true; if (datetime_to_timeval(current_thd, <ime, tm, warnings)) return true; return false; } -bool Item_sdbfield::operator==(Item_sdbfield const &o) const { return (varID == o.varID); } +bool Item_tianmufield::operator==(Item_tianmufield const &o) const { return (varID == o.varID); } -Item_sdbdecimal::Item_sdbdecimal(DataType t) : Item_decimal(0, false) { +Item_tianmudecimal::Item_tianmudecimal(DataType t) : Item_decimal(0, false) { scale = t.fixscale; scaleCoef = QuickMath::power10i(scale); } -void Item_sdbdecimal::Set(int64_t val) { +void Item_tianmudecimal::Set(int64_t val) { std::fill(decimal_value.buf, decimal_value.buf + decimal_value.len, 0); if (val) { int2my_decimal((uint)-1, val, 0, &decimal_value); @@ -215,23 +215,23 @@ void Item_sdbdecimal::Set(int64_t val) { decimal_value.frac = scale; } -my_decimal *Item_sdbdatetime_base::val_decimal(my_decimal *d) { +my_decimal *Item_tianmudatetime_base::val_decimal(my_decimal *d) { int2my_decimal((uint)-1, val_int(), 0, d); return d; } -bool Item_sdbdatetime_base::get_time(MYSQL_TIME *ltime) { +bool Item_tianmudatetime_base::get_time(MYSQL_TIME *ltime) { std::memset(ltime, 0, sizeof(*ltime)); dt.Store(ltime, MYSQL_TIMESTAMP_TIME); return 0; } -longlong Item_sdbdatetime::val_int() { +longlong Item_tianmudatetime::val_int() { return dt.year * 10000000000LL + dt.month * 100000000 + dt.day * 1000000 + dt.hour * 10000 + dt.minute * 100 + dt.second; } -String *Item_sdbdatetime::val_str(String *s) { +String *Item_tianmudatetime::val_str(String *s) { MYSQL_TIME ltime; get_date(<ime, 0); s->alloc(19); @@ -239,7 +239,7 @@ String *Item_sdbdatetime::val_str(String *s) { return s; } -bool Item_sdbdatetime::get_date(MYSQL_TIME *ltime, [[maybe_unused]] uint fuzzydate) { +bool Item_tianmudatetime::get_date(MYSQL_TIME *ltime, [[maybe_unused]] uint fuzzydate) { // Maybe we should check against zero date? // Then 'fuzzydate' would be used. // See Field_timestamp::get_date(...) @@ -248,21 +248,21 @@ bool Item_sdbdatetime::get_date(MYSQL_TIME *ltime, [[maybe_unused]] uint fuzzyda return 0; } -bool Item_sdbdatetime::get_time(MYSQL_TIME *ltime) { +bool Item_tianmudatetime::get_time(MYSQL_TIME *ltime) { std::memset(ltime, 0, sizeof(*ltime)); // safety dt.Store(ltime, MYSQL_TIMESTAMP_DATETIME); return false; } -longlong Item_sdbdate::val_int() { return dt.year * 10000 + dt.month * 100 + dt.day; } -String *Item_sdbdate::val_str(String *s) { +longlong Item_tianmudate::val_int() { return dt.year * 10000 + dt.month * 100 + dt.day; } +String *Item_tianmudate::val_str(String *s) { MYSQL_TIME ltime; get_date(<ime, 0); s->alloc(19); make_date((Date_time_format *)0, <ime, s); return s; } -bool Item_sdbdate::get_date(MYSQL_TIME *ltime, [[maybe_unused]] uint fuzzydate) { +bool Item_tianmudate::get_date(MYSQL_TIME *ltime, [[maybe_unused]] uint fuzzydate) { // Maybe we should check against zero date? // Then 'fuzzydate' would be used. // See Field_timestamp::get_date(...) @@ -272,14 +272,14 @@ bool Item_sdbdate::get_date(MYSQL_TIME *ltime, [[maybe_unused]] uint fuzzydate) return 0; } -bool Item_sdbdate::get_time(MYSQL_TIME *ltime) { +bool Item_tianmudate::get_time(MYSQL_TIME *ltime) { std::memset(ltime, 0, sizeof(*ltime)); dt.Store(ltime, MYSQL_TIMESTAMP_DATE); return false; } -longlong Item_sdbtime::val_int() { return dt.hour * 10000 + dt.minute * 100 + dt.second; } -String *Item_sdbtime::val_str(String *s) { +longlong Item_tianmutime::val_int() { return dt.hour * 10000 + dt.minute * 100 + dt.second; } +String *Item_tianmutime::val_str(String *s) { MYSQL_TIME ltime; get_time(<ime); s->alloc(19); @@ -287,7 +287,7 @@ String *Item_sdbtime::val_str(String *s) { return s; } -bool Item_sdbtime::get_date(MYSQL_TIME *ltime, [[maybe_unused]] uint fuzzydate) { +bool Item_tianmutime::get_date(MYSQL_TIME *ltime, [[maybe_unused]] uint fuzzydate) { // Maybe we should check against zero date? // Then 'fuzzydate' would be used. // See Field_timestamp::get_date(...) @@ -298,17 +298,17 @@ bool Item_sdbtime::get_date(MYSQL_TIME *ltime, [[maybe_unused]] uint fuzzydate) return 0; } -longlong Item_sdbyear::val_int() { return length == 4 ? dt.year : dt.year % 100; } -String *Item_sdbyear::val_str(String *s) { +longlong Item_tianmuyear::val_int() { return length == 4 ? dt.year : dt.year % 100; } +String *Item_tianmuyear::val_str(String *s) { s->alloc(length + 1); s->length(length); s->set_charset(&my_charset_bin); // Safety std::sprintf((char *)s->ptr(), length == 2 ? "%02d" : "%04d", (int)val_int()); return s; } -bool Item_sdbyear::get_date(MYSQL_TIME *ltime, [[maybe_unused]] uint fuzzydate) { +bool Item_tianmuyear::get_date(MYSQL_TIME *ltime, [[maybe_unused]] uint fuzzydate) { std::memset(ltime, 0, sizeof(*ltime)); return 1; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/item_sdbfield.h b/storage/tianmu/core/item_tianmu_field.h similarity index 75% rename from storage/stonedb/core/item_sdbfield.h rename to storage/tianmu/core/item_tianmu_field.h index 5f5989d3c5..f57e3b9b60 100644 --- a/storage/stonedb/core/item_sdbfield.h +++ b/storage/tianmu/core/item_tianmu_field.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_ITEM_SDBFIELD_H_ -#define STONEDB_CORE_ITEM_SDBFIELD_H_ +#ifndef TIANMU_CORE_ITEM_TIANMUFIELD_H_ +#define TIANMU_CORE_ITEM_TIANMUFIELD_H_ #pragma once #include @@ -26,7 +26,7 @@ #include "core/value_or_null.h" #include "core/var_id.h" -namespace stonedb { +namespace Tianmu { namespace core { // damn it... should be C linkage. // this is not exported yet in msyql 5.6 @@ -36,12 +36,12 @@ static inline int my_decimal_shift(uint mask, my_decimal *res, int shift) { return check_result_and_overflow(mask, decimal_shift((decimal_t *)res, shift), res); } -class Item_sdbfield : public Item_field { +class Item_tianmufield : public Item_field { public: - std::vector varID; // SDB identifiers of the variable/field/column - // represented by 'ifield' for each sdbfield usage - Item_sdbfield(Item_field *ifield, VarID varID); - virtual ~Item_sdbfield(); + std::vector varID; // TIANMU identifiers of the variable/field/column + // represented by 'ifield' for each tianmufield usage + Item_tianmufield(Item_field *ifield, VarID varID); + virtual ~Item_tianmufield(); Item_field *OriginalItem() { return ifield; } void SetBuf(ValueOrNull *&b); @@ -51,12 +51,12 @@ class Item_sdbfield : public Item_field { // Implementation of MySQL Item interface static_assert(sizeof(Type) >= 2, "invalid type size"); - enum class enumSDBFiledItem { - SDBFIELD_ITEM = 12345 + enum class enumTIANMUFiledItem { + TIANMUFIELD_ITEM = 12345 }; // WARNING: it is risky. We are assuming sizeof(enum) >= 2 in a superclass // (Item) - static Type get_sdbitem_type() { return (Type)enumSDBFiledItem::SDBFIELD_ITEM; } - Type type() const override { return (Type)enumSDBFiledItem::SDBFIELD_ITEM; } + static Type get_tianmuitem_type() { return (Type)enumTIANMUFiledItem::TIANMUFIELD_ITEM; } + Type type() const override { return (Type)enumTIANMUFiledItem::TIANMUFIELD_ITEM; } bool is_null() override { return buf->IsNull(); } bool is_null_result() override { return buf->IsNull(); } double val_real() override; @@ -89,7 +89,7 @@ class Item_sdbfield : public Item_field { enum_field_types field_type() const override { return ifield->field_type(); } bool const_item() const override { return false; } const char *full_name() const override { return fullname; } - bool operator==(Item_sdbfield const &) const; + bool operator==(Item_tianmufield const &) const; bool IsAggregation() { return was_aggregation; } const ValueOrNull GetCurrentValue(); @@ -100,35 +100,35 @@ class Item_sdbfield : public Item_field { // } private: - // Translate SDB value stored in 'buf' into MySQL value stored in 'ivalue' + // Translate TIANMU value stored in 'buf' into MySQL value stored in 'ivalue' void FeedValue(); Item_field *ifield; // for recovery of original item tree structure - // Type of values coming in from SDB - DataType sdbtype; + // Type of values coming in from TIANMU + DataType tianmu_type; - // SDB buffer where current field value will be searched for + // TIANMU buffer where current field value will be searched for ValueOrNull *buf; //! Indicates whether 'buf' field is owned (was allocated) by this object bool isBufOwner; // MySQL buffer (constant value) keeping the current value of this field. - // Actual Item subclass of this object depends on what type comes in from SDB + // Actual Item subclass of this object depends on what type comes in from TIANMU Item *ivalue; - bool was_aggregation; // this sdbfield replaces an aggregation + bool was_aggregation; // this tianmufield replaces an aggregation Item_result aggregation_result; char fullname[32]; - Item_sdbfield(Item_sdbfield const &); - Item_sdbfield &operator=(Item_sdbfield const &); + Item_tianmufield(Item_tianmufield const &); + Item_tianmufield &operator=(Item_tianmufield const &); }; // This subclass is created only to get access to protected field // 'decimal_value' of Item_decimal. -class Item_sdbdecimal : public Item_decimal { +class Item_tianmudecimal : public Item_decimal { public: - Item_sdbdecimal(DataType t); + Item_tianmudecimal(DataType t); void Set(int64_t val); @@ -137,9 +137,9 @@ class Item_sdbdecimal : public Item_decimal { int64_t scaleCoef; }; -//! Base class for STONEDB's Item classes to store date/time values of columns +//! Base class for TIANMU's Item classes to store date/time values of columns //! occuring in a complex expression -class Item_sdbdatetime_base : public Item { +class Item_tianmudatetime_base : public Item { protected: types::DT dt; common::CT at; @@ -155,40 +155,40 @@ class Item_sdbdatetime_base : public Item { bool get_time(MYSQL_TIME *ltime) override; }; -class Item_sdbdatetime : public Item_sdbdatetime_base { +class Item_tianmudatetime : public Item_tianmudatetime_base { longlong val_int() override; String *val_str(String *s) override; bool get_date(MYSQL_TIME *ltime, uint fuzzydate) override; bool get_time(MYSQL_TIME *ltime) override; }; -class Item_sdbtimestamp : public Item_sdbdatetime {}; +class Item_tianmutimestamp : public Item_tianmudatetime {}; -class Item_sdbdate : public Item_sdbdatetime_base { +class Item_tianmudate : public Item_tianmudatetime_base { longlong val_int() override; String *val_str(String *s) override; bool get_date(MYSQL_TIME *ltime, uint fuzzydate) override; bool get_time(MYSQL_TIME *ltime) override; }; -class Item_sdbtime : public Item_sdbdatetime_base { +class Item_tianmutime : public Item_tianmudatetime_base { longlong val_int() override; String *val_str(String *s) override; bool get_date(MYSQL_TIME *ltime, uint fuzzydate) override; }; -class Item_sdbyear : public Item_sdbdatetime_base { +class Item_tianmuyear : public Item_tianmudatetime_base { //! Is it 4- or 2-digit year (2009 or 09). //! This info is taken from MySQL. int length; public: - Item_sdbyear(int len) : length(len) { DEBUG_ASSERT(length == 2 || length == 4); } + Item_tianmuyear(int len) : length(len) { DEBUG_ASSERT(length == 2 || length == 4); } longlong val_int() override; String *val_str(String *s) override; bool get_date(MYSQL_TIME *ltime, uint fuzzydate) override; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_ITEM_SDBFIELD_H_ +#endif // TIANMU_CORE_ITEM_TIANMUFIELD_H_ diff --git a/storage/stonedb/core/join_thread_table.cpp b/storage/tianmu/core/join_thread_table.cpp similarity index 99% rename from storage/stonedb/core/join_thread_table.cpp rename to storage/tianmu/core/join_thread_table.cpp index f651db4180..76c354ccab 100644 --- a/storage/stonedb/core/join_thread_table.cpp +++ b/storage/tianmu/core/join_thread_table.cpp @@ -20,7 +20,7 @@ #include "base/util/spinlock.h" #include "common/assert.h" -namespace stonedb { +namespace Tianmu { namespace core { //------------------------JoinThreadTable::Finder------------------------------------ JoinThreadTable::Finder::Finder(JoinThreadTable *thread_table, std::string *key_buffer) @@ -190,4 +190,4 @@ JoinThreadTableManager *JoinThreadTableManager::CreateSharedTableManager(uint32_ } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/join_thread_table.h b/storage/tianmu/core/join_thread_table.h similarity index 97% rename from storage/stonedb/core/join_thread_table.h rename to storage/tianmu/core/join_thread_table.h index 6634f56da6..a13aae9b30 100644 --- a/storage/stonedb/core/join_thread_table.h +++ b/storage/tianmu/core/join_thread_table.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_JOIN_THREAD_TABLE_H_ -#define STONEDB_CORE_JOIN_THREAD_TABLE_H_ +#ifndef TIANMU_CORE_JOIN_THREAD_TABLE_H_ +#define TIANMU_CORE_JOIN_THREAD_TABLE_H_ #pragma once #include @@ -27,7 +27,7 @@ #include "core/hash_table.h" #include "core/temp_table.h" -namespace stonedb { +namespace Tianmu { namespace core { // To avoid loading TempTable's data from multithreads, we should prelock packs // of TempTable before invoke LockPackForUse. @@ -172,6 +172,6 @@ class JoinThreadTableManager { }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_JOIN_THREAD_TABLE_H_ +#endif // TIANMU_CORE_JOIN_THREAD_TABLE_H_ diff --git a/storage/stonedb/core/joiner.cpp b/storage/tianmu/core/joiner.cpp similarity index 94% rename from storage/stonedb/core/joiner.cpp rename to storage/tianmu/core/joiner.cpp index 214bbf98cb..639eae76f8 100644 --- a/storage/stonedb/core/joiner.cpp +++ b/storage/tianmu/core/joiner.cpp @@ -25,7 +25,7 @@ #include "vc/const_column.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { TwoDimensionalJoiner::TwoDimensionalJoiner(MultiIndex *_mind, // multi-index to be updated TempTable *_table, JoinTips &_tips) @@ -43,7 +43,7 @@ JoinAlgType TwoDimensionalJoiner::ChooseJoinAlgorithm([[maybe_unused]] MultiInde JoinAlgType join_alg = JoinAlgType::JTYPE_GENERAL; if (cond[0].IsType_JoinSimple() && cond[0].op == common::Operator::O_EQ) { - if ((cond.Size() == 1) && !stonedb_sysvar_force_hashjoin) + if ((cond.Size() == 1) && !tianmu_sysvar_force_hashjoin) join_alg = JoinAlgType::JTYPE_MAP; // available types checked inside else join_alg = JoinAlgType::JTYPE_HASH; @@ -72,13 +72,13 @@ std::unique_ptr TwoDimensionalJoiner::CreateJoiner(JoinAlg case JoinAlgType::JTYPE_SORT: return std::unique_ptr(new JoinerSort(&mind, table, tips)); case JoinAlgType::JTYPE_MAP: - return std::unique_ptr(stonedb_sysvar_parallel_mapjoin + return std::unique_ptr(tianmu_sysvar_parallel_mapjoin ? (new JoinerParallelMapped(&mind, table, tips)) : (new JoinerMapped(&mind, table, tips))); case JoinAlgType::JTYPE_GENERAL: return std::unique_ptr(new JoinerGeneral(&mind, table, tips)); default: - STONEDB_ERROR("Join algorithm not implemented"); + TIANMU_ERROR("Join algorithm not implemented"); } return std::unique_ptr(); } @@ -101,4 +101,4 @@ JoinTips::JoinTips(const JoinTips &sec) { null_only = sec.null_only; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/joiner.h b/storage/tianmu/core/joiner.h similarity index 96% rename from storage/stonedb/core/joiner.h rename to storage/tianmu/core/joiner.h index 066a391888..05510d6257 100644 --- a/storage/stonedb/core/joiner.h +++ b/storage/tianmu/core/joiner.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_JOINER_H_ -#define STONEDB_CORE_JOINER_H_ +#ifndef TIANMU_CORE_JOINER_H_ +#define TIANMU_CORE_JOINER_H_ #pragma once #include "core/condition.h" #include "core/descriptor.h" #include "core/mi_iterator.h" -namespace stonedb { +namespace Tianmu { namespace core { class TempTable; @@ -97,6 +97,6 @@ class JoinerGeneral : public TwoDimensionalJoiner { DimensionVector &outer_dims, int64_t &tuples_in_output, int64_t output_limit); }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_JOINER_H_ +#endif // TIANMU_CORE_JOINER_H_ diff --git a/storage/stonedb/core/joiner_general.cpp b/storage/tianmu/core/joiner_general.cpp similarity index 99% rename from storage/stonedb/core/joiner_general.cpp rename to storage/tianmu/core/joiner_general.cpp index bdcf2b7349..5432ad9a94 100644 --- a/storage/stonedb/core/joiner_general.cpp +++ b/storage/tianmu/core/joiner_general.cpp @@ -22,7 +22,7 @@ #include "core/transaction.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { void JoinerGeneral::ExecuteJoinConditions(Condition &cond) { MEASURE_FET("JoinerGeneral::ExecuteJoinConditions(...)"); @@ -198,4 +198,4 @@ void JoinerGeneral::ExecuteOuterJoinLoop(Condition &cond, MINewContents &new_min } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/joiner_hash.cpp b/storage/tianmu/core/joiner_hash.cpp similarity index 98% rename from storage/stonedb/core/joiner_hash.cpp rename to storage/tianmu/core/joiner_hash.cpp index 6261db0946..0b9927f77d 100644 --- a/storage/stonedb/core/joiner_hash.cpp +++ b/storage/tianmu/core/joiner_hash.cpp @@ -28,7 +28,7 @@ #include "util/thread_pool.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { JoinerHash::JoinerHash(MultiIndex *_mind, TempTable *_table, JoinTips &_tips) : TwoDimensionalJoiner(_mind, _table, _tips) { @@ -574,10 +574,10 @@ int64_t JoinerHash::SubmitOuterMatched(MIIterator &mit, MINewContents &new_mind) } int64_t JoinerHash::NewMatchDim(MINewContents *new_mind1, MIUpdatingIterator *task_mit1, Transaction *ci, - JoinerHashTable *hash_table, int *join_tuple, int stonedb_sysvar_jointhreadpool) { + JoinerHashTable *hash_table, int *join_tuple, int tianmu_sysvar_jointhreadpool) { JoinerHashTable &tmp_jhash = *hash_table; - STONEDB_LOG(LogCtl_Level::INFO, "NewMatchDim start, taskid %d, stonedb_sysvar_jointhreadpool %d", - task_mit1->GetTaskId(), stonedb_sysvar_jointhreadpool); + TIANMU_LOG(LogCtl_Level::INFO, "NewMatchDim start, taskid %d, tianmu_sysvar_jointhreadpool %d", + task_mit1->GetTaskId(), tianmu_sysvar_jointhreadpool); common::SetMySQLTHD(ci->Thd()); current_tx = ci; for (int i = 0; i < cond_hashed; i++) { @@ -651,8 +651,8 @@ int64_t JoinerHash::NewMatchDim(MINewContents *new_mind1, MIUpdatingIterator *ta no_obj=mit.OrigSize(i); } int packs_no = (int)((no_obj + (1 << p_power) - 1) >> mind->ValueOfPower()); - int mod = packs_no%stonedb_sysvar_jointhreadpool; - int num = packs_no/stonedb_sysvar_jointhreadpool; + int mod = packs_no%tianmu_sysvar_jointhreadpool; + int num = packs_no/tianmu_sysvar_jointhreadpool; //benq: why recalculate the matching row? consider make it a one matching_row = 65536*(mod +task_mit1->GetTaskId()*num); } @@ -674,7 +674,7 @@ int64_t JoinerHash::NewMatchDim(MINewContents *new_mind1, MIUpdatingIterator *ta types::BString local_max = vc2[i]->GetMaxString(task_mit); if (!local_min.IsNull() && !local_max.IsNull() && tmp_jhash.ImpossibleValues(i, local_min, local_max)) { omit_this_packrow = true; - STONEDB_LOG(LogCtl_Level::DEBUG, "JoinerHash::test omit"); + TIANMU_LOG(LogCtl_Level::DEBUG, "JoinerHash::test omit"); break; } } @@ -720,7 +720,7 @@ int64_t JoinerHash::NewMatchDim(MINewContents *new_mind1, MIUpdatingIterator *ta } } if (no_of_matching_rows > 65536 || no_of_matching_rows < 0) - STONEDB_LOG(LogCtl_Level::DEBUG, "no_of_matching_rows %d", no_of_matching_rows); + TIANMU_LOG(LogCtl_Level::DEBUG, "no_of_matching_rows %d", no_of_matching_rows); joined_tuples += no_of_matching_rows; omit_this_packrow = true; } @@ -796,7 +796,7 @@ int64_t JoinerHash::NewMatchDim(MINewContents *new_mind1, MIUpdatingIterator *ta matching_row++; } if (outer_nulls_only) joined_tuples = 0; // outer tuples added later - STONEDB_LOG(LogCtl_Level::DEBUG, "JoinerHash::test %d,matching_row %d", joined_tuples, matching_row); + TIANMU_LOG(LogCtl_Level::DEBUG, "JoinerHash::test %d,matching_row %d", joined_tuples, matching_row); *join_tuple = joined_tuples; return joined_tuples; } @@ -822,4 +822,4 @@ int64_t JoinerHash::SubmitOuterTraversed(MINewContents &new_mind) { return outer_added; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/joiner_hash.h b/storage/tianmu/core/joiner_hash.h similarity index 96% rename from storage/stonedb/core/joiner_hash.h rename to storage/tianmu/core/joiner_hash.h index b427fc5479..9c68cf296d 100644 --- a/storage/stonedb/core/joiner_hash.h +++ b/storage/tianmu/core/joiner_hash.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_JOINER_HASH_H_ -#define STONEDB_CORE_JOINER_HASH_H_ +#ifndef TIANMU_CORE_JOINER_HASH_H_ +#define TIANMU_CORE_JOINER_HASH_H_ #pragma once #include "core/joiner.h" #include "core/joiner_hash_table.h" -namespace stonedb { +namespace Tianmu { namespace core { class JoinerHash : public TwoDimensionalJoiner { /* @@ -57,7 +57,7 @@ class JoinerHash : public TwoDimensionalJoiner { int64_t &outer_tuples); // new_mind is used only for outer joins int64_t MatchDim(MINewContents &new_mind, MIIterator &mit); int64_t NewMatchDim(MINewContents *new_mind, MIUpdatingIterator *task_mit, Transaction *ci, - JoinerHashTable *hash_table, int *join_tuple, int stonedb_sysvar_jointhreadpool); + JoinerHashTable *hash_table, int *join_tuple, int tianmu_sysvar_jointhreadpool); void ExecuteJoin(); @@ -110,6 +110,6 @@ class JoinerHash : public TwoDimensionalJoiner { void SubmitJoinedTuple(int64_t hash_row, MIIterator &mit, MINewContents &new_mind); }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_JOINER_HASH_H_ +#endif // TIANMU_CORE_JOINER_HASH_H_ diff --git a/storage/stonedb/core/joiner_hash_table.cpp b/storage/tianmu/core/joiner_hash_table.cpp similarity index 99% rename from storage/stonedb/core/joiner_hash_table.cpp rename to storage/tianmu/core/joiner_hash_table.cpp index df4073e8aa..df063befb5 100644 --- a/storage/stonedb/core/joiner_hash_table.cpp +++ b/storage/tianmu/core/joiner_hash_table.cpp @@ -20,7 +20,7 @@ #include "core/tools.h" #include "core/transaction.h" -namespace stonedb { +namespace Tianmu { namespace core { #define MAX_HASH_CONFLICTS 128 @@ -256,4 +256,4 @@ bool JoinerHashTable::ImpossibleValues(int col, types::BString &local_min, types return encoder[col].ImpossibleValues(local_min, local_max); } } // namespace core -} // namespace stonedb \ No newline at end of file +} // namespace Tianmu \ No newline at end of file diff --git a/storage/stonedb/core/joiner_hash_table.h b/storage/tianmu/core/joiner_hash_table.h similarity index 97% rename from storage/stonedb/core/joiner_hash_table.h rename to storage/tianmu/core/joiner_hash_table.h index bd3cc4ab3b..f614dfbb0e 100644 --- a/storage/stonedb/core/joiner_hash_table.h +++ b/storage/tianmu/core/joiner_hash_table.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_JOINER_HASH_TABLE_H_ -#define STONEDB_CORE_JOINER_HASH_TABLE_H_ +#ifndef TIANMU_CORE_JOINER_HASH_TABLE_H_ +#define TIANMU_CORE_JOINER_HASH_TABLE_H_ #pragma once #include "core/bin_tools.h" @@ -25,7 +25,7 @@ #include "mm/traceable_object.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { /* JoinerHashTable - a tool for storing values and counters, implementing @@ -176,6 +176,6 @@ class JoinerHashTable : public mm::TraceableObject { int64_t current_iterate_step; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_JOINER_HASH_TABLE_H_ +#endif // TIANMU_CORE_JOINER_HASH_TABLE_H_ diff --git a/storage/stonedb/core/joiner_mapped.cpp b/storage/tianmu/core/joiner_mapped.cpp similarity index 99% rename from storage/stonedb/core/joiner_mapped.cpp rename to storage/tianmu/core/joiner_mapped.cpp index f323c461dc..875b6ac905 100644 --- a/storage/stonedb/core/joiner_mapped.cpp +++ b/storage/tianmu/core/joiner_mapped.cpp @@ -25,7 +25,7 @@ #include "util/log_ctl.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { JoinerMapped::JoinerMapped(MultiIndex *_mind, TempTable *_table, JoinTips &_tips) : TwoDimensionalJoiner(_mind, _table, _tips) { @@ -513,4 +513,4 @@ bool MultiMapsFunction::Init(vcolumn::VirtualColumn *vc, MIIterator &mit) { return true; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/joiner_mapped.h b/storage/tianmu/core/joiner_mapped.h similarity index 97% rename from storage/stonedb/core/joiner_mapped.h rename to storage/tianmu/core/joiner_mapped.h index 080ae35ae2..df753421da 100644 --- a/storage/stonedb/core/joiner_mapped.h +++ b/storage/tianmu/core/joiner_mapped.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_JOINER_MAPPED_H_ -#define STONEDB_CORE_JOINER_MAPPED_H_ +#ifndef TIANMU_CORE_JOINER_MAPPED_H_ +#define TIANMU_CORE_JOINER_MAPPED_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "core/joiner.h" #include "core/multi_index_builder.h" -namespace stonedb { +namespace Tianmu { namespace core { class JoinerMapFunction; @@ -149,6 +149,6 @@ class MultiMapsFunction : public JoinerMapFunction { std::vector> keys_value_maps; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_JOINER_MAPPED_H_ +#endif // TIANMU_CORE_JOINER_MAPPED_H_ diff --git a/storage/stonedb/core/joiner_sort.cpp b/storage/tianmu/core/joiner_sort.cpp similarity index 99% rename from storage/stonedb/core/joiner_sort.cpp rename to storage/tianmu/core/joiner_sort.cpp index 05eb70d5cf..d6ba987030 100644 --- a/storage/stonedb/core/joiner_sort.cpp +++ b/storage/tianmu/core/joiner_sort.cpp @@ -23,7 +23,7 @@ #include "core/transaction.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { JoinerSort::~JoinerSort() { delete outer_filter; } @@ -534,4 +534,4 @@ int64_t JoinerSortWrapper::GetOuterIndex(int cache_position, return ind_value; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/joiner_sort.h b/storage/tianmu/core/joiner_sort.h similarity index 97% rename from storage/stonedb/core/joiner_sort.h rename to storage/tianmu/core/joiner_sort.h index 185998b708..1a195662ac 100644 --- a/storage/stonedb/core/joiner_sort.h +++ b/storage/tianmu/core/joiner_sort.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_JOINER_SORT_H_ -#define STONEDB_CORE_JOINER_SORT_H_ +#ifndef TIANMU_CORE_JOINER_SORT_H_ +#define TIANMU_CORE_JOINER_SORT_H_ #pragma once #include "core/column_bin_encoder.h" @@ -23,7 +23,7 @@ #include "mm/traceable_object.h" #include "system/cacheable_item.h" -namespace stonedb { +namespace Tianmu { namespace core { class JoinerSortWrapper; @@ -151,6 +151,6 @@ class JoinerSortWrapper : public mm::TraceableObject { bool watch_matched; // true if we need to watch which matched tuples are used }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_JOINER_SORT_H_ +#endif // TIANMU_CORE_JOINER_SORT_H_ diff --git a/storage/stonedb/core/joner_hash.h b/storage/tianmu/core/joner_hash.h similarity index 96% rename from storage/stonedb/core/joner_hash.h rename to storage/tianmu/core/joner_hash.h index d3dbda7c88..6dd0cb22aa 100644 --- a/storage/stonedb/core/joner_hash.h +++ b/storage/tianmu/core/joner_hash.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_JONER_HASH_H_ -#define STONEDB_CORE_JONER_HASH_H_ +#ifndef TIANMU_CORE_JONER_HASH_H_ +#define TIANMU_CORE_JONER_HASH_H_ #pragma once #include "core/joiner.h" #include "core/joiner_hash_table.h" -namespace stonedb { +namespace Tianmu { namespace core { class JoinerHash : public TwoDimensionalJoiner { /* @@ -57,7 +57,7 @@ class JoinerHash : public TwoDimensionalJoiner { int64_t &outer_tuples); // new_mind is used only for outer joins int64_t MatchDim(MINewContents &new_mind, MIIterator &mit); int64_t NewMatchDim(MINewContents *new_mind, MIUpdatingIterator *task_mit, Transaction *ci, - JoinerHashTable *hash_table, int *join_tuple, int stonedb_sysvar_jointhreadpool); + JoinerHashTable *hash_table, int *join_tuple, int tianmu_sysvar_jointhreadpool); void ExecuteJoin(); @@ -110,6 +110,6 @@ class JoinerHash : public TwoDimensionalJoiner { void SubmitJoinedTuple(int64_t hash_row, MIIterator &mit, MINewContents &new_mind); }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_JONER_HASH_H_ +#endif // TIANMU_CORE_JONER_HASH_H_ diff --git a/storage/stonedb/core/just_a_table.cpp b/storage/tianmu/core/just_a_table.cpp similarity index 97% rename from storage/stonedb/core/just_a_table.cpp rename to storage/tianmu/core/just_a_table.cpp index f982c3c1fd..2f2435ff5e 100644 --- a/storage/stonedb/core/just_a_table.cpp +++ b/storage/tianmu/core/just_a_table.cpp @@ -22,7 +22,7 @@ #include "core/filter.h" #include "core/temp_table.h" -namespace stonedb { +namespace Tianmu { namespace core { ValueOrNull JustATable::GetComplexValue(const int64_t obj, const int attr) { if (obj == common::NULL_VALUE_64 || IsNull(obj, attr)) return ValueOrNull(); @@ -49,4 +49,4 @@ ValueOrNull JustATable::GetComplexValue(const int64_t obj, const int attr) { throw common::Exception("Unrecognized data type in JustATable::GetComplexValue"); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/just_a_table.h b/storage/tianmu/core/just_a_table.h similarity index 93% rename from storage/stonedb/core/just_a_table.h rename to storage/tianmu/core/just_a_table.h index ebc7554767..a377c3c66c 100644 --- a/storage/stonedb/core/just_a_table.h +++ b/storage/tianmu/core/just_a_table.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_JUST_A_TABLE_H_ -#define STONEDB_CORE_JUST_A_TABLE_H_ +#ifndef TIANMU_CORE_JUST_A_TABLE_H_ +#define TIANMU_CORE_JUST_A_TABLE_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "core/mysql_expression.h" -namespace stonedb { +namespace Tianmu { namespace types { class BString; } // namespace types @@ -65,6 +65,6 @@ class JustATable : public std::enable_shared_from_this { }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_JUST_A_TABLE_H_ +#endif // TIANMU_CORE_JUST_A_TABLE_H_ diff --git a/storage/stonedb/core/mi_iterator.cpp b/storage/tianmu/core/mi_iterator.cpp similarity index 99% rename from storage/stonedb/core/mi_iterator.cpp rename to storage/tianmu/core/mi_iterator.cpp index c488f2db10..4f028a783e 100644 --- a/storage/stonedb/core/mi_iterator.cpp +++ b/storage/tianmu/core/mi_iterator.cpp @@ -19,7 +19,7 @@ #include "core/pack_orderer.h" -namespace stonedb { +namespace Tianmu { namespace core { std::vector null_order; // use null_order in constructor if ordering not desired @@ -558,4 +558,4 @@ void MIIterator::RewindToRow(int64_t row) { } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/mi_iterator.h b/storage/tianmu/core/mi_iterator.h similarity index 98% rename from storage/stonedb/core/mi_iterator.h rename to storage/tianmu/core/mi_iterator.h index 06463a7aed..2c45867eb6 100644 --- a/storage/stonedb/core/mi_iterator.h +++ b/storage/tianmu/core/mi_iterator.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_MI_ITERATOR_H_ -#define STONEDB_CORE_MI_ITERATOR_H_ +#ifndef TIANMU_CORE_MI_ITERATOR_H_ +#define TIANMU_CORE_MI_ITERATOR_H_ #pragma once #include "core/multi_index.h" -namespace stonedb { +namespace Tianmu { namespace core { class PackOrderer; @@ -386,6 +386,6 @@ class MIInpackIterator : public MIIterator { void GeneralIncrement(); }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_MI_ITERATOR_H_ +#endif // TIANMU_CORE_MI_ITERATOR_H_ diff --git a/storage/stonedb/core/mi_new_contents.cpp b/storage/tianmu/core/mi_new_contents.cpp similarity index 99% rename from storage/stonedb/core/mi_new_contents.cpp rename to storage/tianmu/core/mi_new_contents.cpp index 1c91dd05d4..a03eab9b5e 100644 --- a/storage/stonedb/core/mi_new_contents.cpp +++ b/storage/tianmu/core/mi_new_contents.cpp @@ -22,7 +22,7 @@ #include "core/mi_rough_sorter.h" #include "core/multi_index.h" -namespace stonedb { +namespace Tianmu { namespace core { MINewContents::MINewContents(MultiIndex *m, JoinTips &tips) : mind(m), t_new(NULL), optimized_dim_stay(-1), f_opt(NULL), t_opt(NULL) { @@ -312,4 +312,4 @@ bool MINewContents::NoMoreTuplesPossible() { optimized_dim_stay == ignore_repetitions_dim && f_opt->NumOfOnes() >= f_opt_max_ones; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/mi_new_contents.h b/storage/tianmu/core/mi_new_contents.h similarity index 96% rename from storage/stonedb/core/mi_new_contents.h rename to storage/tianmu/core/mi_new_contents.h index e4dd57e24a..ea0326a34e 100644 --- a/storage/stonedb/core/mi_new_contents.h +++ b/storage/tianmu/core/mi_new_contents.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_MI_NEW_CONTENTS_H_ -#define STONEDB_CORE_MI_NEW_CONTENTS_H_ +#ifndef TIANMU_CORE_MI_NEW_CONTENTS_H_ +#define TIANMU_CORE_MI_NEW_CONTENTS_H_ #pragma once #include "core/dimension_group.h" -namespace stonedb { +namespace Tianmu { namespace core { class Filter; class IndexTable; @@ -89,6 +89,6 @@ class MINewContents final { // positions already passed }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_MI_NEW_CONTENTS_H_ +#endif // TIANMU_CORE_MI_NEW_CONTENTS_H_ diff --git a/storage/stonedb/core/mi_rough_sorter.cpp b/storage/tianmu/core/mi_rough_sorter.cpp similarity index 99% rename from storage/stonedb/core/mi_rough_sorter.cpp rename to storage/tianmu/core/mi_rough_sorter.cpp index 2aabd21b34..0a9df46626 100644 --- a/storage/stonedb/core/mi_rough_sorter.cpp +++ b/storage/tianmu/core/mi_rough_sorter.cpp @@ -14,7 +14,7 @@ #include "mi_rough_sorter.h" -namespace stonedb { +namespace Tianmu { namespace core { MINewContentsRSorter::MINewContentsRSorter(MultiIndex *_m, IndexTable **t_new, int min_block_shift) { @@ -171,4 +171,4 @@ MINewContentsRSorterWorker::MINewContentsRSorterWorker(int _bound_queue_size, MI MINewContentsRSorterWorker::~MINewContentsRSorterWorker() { delete[] bound_queue; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/mi_rough_sorter.h b/storage/tianmu/core/mi_rough_sorter.h similarity index 97% rename from storage/stonedb/core/mi_rough_sorter.h rename to storage/tianmu/core/mi_rough_sorter.h index a9326d1d07..73d6c1ab5f 100644 --- a/storage/stonedb/core/mi_rough_sorter.h +++ b/storage/tianmu/core/mi_rough_sorter.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_MI_ROUGH_SORTER_H_ -#define STONEDB_CORE_MI_ROUGH_SORTER_H_ +#ifndef TIANMU_CORE_MI_ROUGH_SORTER_H_ +#define TIANMU_CORE_MI_ROUGH_SORTER_H_ #pragma once #include "core/multi_index.h" -namespace stonedb { +namespace Tianmu { namespace core { class MINewContentsRSorterWorker; @@ -163,6 +163,6 @@ class MINewContentsRSorterWorker { MINewContentsRSorter *rough_sorter; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_MI_ROUGH_SORTER_H_ +#endif // TIANMU_CORE_MI_ROUGH_SORTER_H_ diff --git a/storage/stonedb/core/mi_step_iterator.cpp b/storage/tianmu/core/mi_step_iterator.cpp similarity index 97% rename from storage/stonedb/core/mi_step_iterator.cpp rename to storage/tianmu/core/mi_step_iterator.cpp index 9080f02e87..02425cd46e 100644 --- a/storage/stonedb/core/mi_step_iterator.cpp +++ b/storage/tianmu/core/mi_step_iterator.cpp @@ -17,7 +17,7 @@ #include "mi_step_iterator.h" -namespace stonedb { +namespace Tianmu { namespace core { // MIStepIterator MIStepIterator::MIStepIterator(int start, int step, const MIIterator &sec) : MIIterator(sec), step_(step) { @@ -62,4 +62,4 @@ MIIterator &MIRowsStepIterator::Increment() { } } // namespace core -} // namespace stonedb \ No newline at end of file +} // namespace Tianmu \ No newline at end of file diff --git a/storage/stonedb/core/mi_step_iterator.h b/storage/tianmu/core/mi_step_iterator.h similarity index 89% rename from storage/stonedb/core/mi_step_iterator.h rename to storage/tianmu/core/mi_step_iterator.h index 39e55c529c..68594bc912 100644 --- a/storage/stonedb/core/mi_step_iterator.h +++ b/storage/tianmu/core/mi_step_iterator.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_MI_STEP_ITERATOR_H_ -#define STONEDB_CORE_MI_STEP_ITERATOR_H_ +#ifndef TIANMU_CORE_MI_STEP_ITERATOR_H_ +#define TIANMU_CORE_MI_STEP_ITERATOR_H_ #pragma once #include "core/mi_iterator.h" -namespace stonedb { +namespace Tianmu { namespace core { class MIStepIterator : public MIIterator { public: @@ -52,6 +52,6 @@ class MIRowsStepIterator : public MIIterator { }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_MI_STEP_ITERATOR_H_ \ No newline at end of file +#endif // TIANMU_CORE_MI_STEP_ITERATOR_H_ \ No newline at end of file diff --git a/storage/stonedb/core/mi_updating_iterator.cpp b/storage/tianmu/core/mi_updating_iterator.cpp similarity index 99% rename from storage/stonedb/core/mi_updating_iterator.cpp rename to storage/tianmu/core/mi_updating_iterator.cpp index c7f262a5a2..9b034c1777 100644 --- a/storage/stonedb/core/mi_updating_iterator.cpp +++ b/storage/tianmu/core/mi_updating_iterator.cpp @@ -17,7 +17,7 @@ #include "mi_updating_iterator.h" -namespace stonedb { +namespace Tianmu { namespace core { MIUpdatingIterator::MIUpdatingIterator(MultiIndex *_mind, DimensionVector &dimensions) : MIIterator(_mind, dimensions), changed(false), multi_filter_pos(0), multi_filter_pack_start(0) { @@ -159,4 +159,4 @@ void MIUpdatingIterator::OrPackFilter(int pack, Filter *f) // make OR f_old->Or(*f, pack); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/mi_updating_iterator.h b/storage/tianmu/core/mi_updating_iterator.h similarity index 96% rename from storage/stonedb/core/mi_updating_iterator.h rename to storage/tianmu/core/mi_updating_iterator.h index db9ea99fcf..0cb13494be 100644 --- a/storage/stonedb/core/mi_updating_iterator.h +++ b/storage/tianmu/core/mi_updating_iterator.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_MI_UPDATING_ITERATOR_H_ -#define STONEDB_CORE_MI_UPDATING_ITERATOR_H_ +#ifndef TIANMU_CORE_MI_UPDATING_ITERATOR_H_ +#define TIANMU_CORE_MI_UPDATING_ITERATOR_H_ #pragma once #include "core/mi_iterator.h" -namespace stonedb { +namespace Tianmu { namespace core { /*! \brief Used for iteration on chosen dimensions in a MultiIndex and for * @@ -116,6 +116,6 @@ class MIUpdatingIterator : public MIIterator { // in multidimensional filter (0..no_obj-1) }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_MI_UPDATING_ITERATOR_H_ +#endif // TIANMU_CORE_MI_UPDATING_ITERATOR_H_ diff --git a/storage/stonedb/core/multi_index.cpp b/storage/tianmu/core/multi_index.cpp similarity index 99% rename from storage/stonedb/core/multi_index.cpp rename to storage/tianmu/core/multi_index.cpp index 6a9f6d9b35..b471ae08e6 100644 --- a/storage/stonedb/core/multi_index.cpp +++ b/storage/tianmu/core/multi_index.cpp @@ -23,7 +23,7 @@ #include "core/mi_new_contents.h" #include "core/tools.h" -namespace stonedb { +namespace Tianmu { namespace core { #define MATERIAL_TUPLES_LIMIT 150000000000LL // = ~1 TB of cache needed for one dimension #define MATERIAL_TUPLES_WARNING 2500000000LL // = 10-20 GB of cache for one dimension @@ -450,4 +450,4 @@ std::string MultiIndex::Display() { return s; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/multi_index.h b/storage/tianmu/core/multi_index.h similarity index 98% rename from storage/stonedb/core/multi_index.h rename to storage/tianmu/core/multi_index.h index 99a0654b09..964d00509e 100644 --- a/storage/stonedb/core/multi_index.h +++ b/storage/tianmu/core/multi_index.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_MULTI_INDEX_H_ -#define STONEDB_CORE_MULTI_INDEX_H_ +#ifndef TIANMU_CORE_MULTI_INDEX_H_ +#define TIANMU_CORE_MULTI_INDEX_H_ #pragma once #include "core/bin_tools.h" @@ -24,7 +24,7 @@ #include "core/filter.h" #include "core/index_table.h" -namespace stonedb { +namespace Tianmu { namespace core { class MIIterator; @@ -183,6 +183,6 @@ class MultiIndex { // updating iterator exists }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_MULTI_INDEX_H_ +#endif // TIANMU_CORE_MULTI_INDEX_H_ diff --git a/storage/stonedb/core/multi_index_builder.cpp b/storage/tianmu/core/multi_index_builder.cpp similarity index 99% rename from storage/stonedb/core/multi_index_builder.cpp rename to storage/tianmu/core/multi_index_builder.cpp index 9d37a8cedc..7dd2f6732d 100644 --- a/storage/stonedb/core/multi_index_builder.cpp +++ b/storage/tianmu/core/multi_index_builder.cpp @@ -22,7 +22,7 @@ #include "core/mi_rough_sorter.h" #include "core/multi_index.h" -namespace stonedb { +namespace Tianmu { namespace core { MultiIndexBuilder::BuildItem::BuildItem(MultiIndexBuilder *builder) : builder_(builder) { @@ -189,4 +189,4 @@ void MultiIndexBuilder::Commit(int64_t joined_tuples, bool count_only) { } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/multi_index_builder.h b/storage/tianmu/core/multi_index_builder.h similarity index 93% rename from storage/stonedb/core/multi_index_builder.h rename to storage/tianmu/core/multi_index_builder.h index 874d173117..302ced291d 100644 --- a/storage/stonedb/core/multi_index_builder.h +++ b/storage/tianmu/core/multi_index_builder.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_MULTI_INDEX_BUILDER_H_ -#define STONEDB_CORE_MULTI_INDEX_BUILDER_H_ +#ifndef TIANMU_CORE_MULTI_INDEX_BUILDER_H_ +#define TIANMU_CORE_MULTI_INDEX_BUILDER_H_ #pragma once #include @@ -30,7 +30,7 @@ #include "core/mi_rough_sorter.h" #include "core/multi_index.h" -namespace stonedb { +namespace Tianmu { namespace core { class JoinTips; @@ -93,6 +93,6 @@ class MultiIndexBuilder { std::list> build_items_; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_MULTI_INDEX_BUILDER_H_ +#endif // TIANMU_CORE_MULTI_INDEX_BUILDER_H_ diff --git a/storage/stonedb/core/mysql_expression.cpp b/storage/tianmu/core/mysql_expression.cpp similarity index 80% rename from storage/stonedb/core/mysql_expression.cpp rename to storage/tianmu/core/mysql_expression.cpp index 0107a926e4..531b49b2a0 100644 --- a/storage/stonedb/core/mysql_expression.cpp +++ b/storage/tianmu/core/mysql_expression.cpp @@ -24,7 +24,7 @@ #include "core/transaction.h" #include "types/value_parser4txt.h" -namespace stonedb { +namespace Tianmu { namespace core { MysqlExpression::MysqlExpression(Item *item, Item2VarID &item2varid) { PrintItemTree("MysqlExpression constructed from item tree:", item); @@ -72,7 +72,7 @@ bool MysqlExpression::HandledResultType(Item *item) { bool MysqlExpression::HandledFieldType(Item_result type) { // Here, we don't have to worry about precision/scale of decimals, - // since all values that come to us were previously stored in SDB on int64_t, + // since all values that come to us were previously stored in TIANMU on int64_t, // so we'll cope with them return (type == INT_RESULT) || (type == REAL_RESULT) || (type == DECIMAL_RESULT) || (type == STRING_RESULT); } @@ -97,11 +97,11 @@ bool MysqlExpression::SanityAggregationCheck(Item *item, std::set &field case Item::VARBIN_ITEM: return true; - case static_cast(Item_sdbfield::enumSDBFiledItem::SDBFIELD_ITEM): + case static_cast(Item_tianmufield::enumTIANMUFiledItem::TIANMUFIELD_ITEM): if (has_aggregation) { - if (Query::IsAggregationItem(((Item_sdbfield *)item)->OriginalItem())) *has_aggregation = true; + if (Query::IsAggregationItem(((Item_tianmufield *)item)->OriginalItem())) *has_aggregation = true; } - fields.insert(((Item_sdbfield *)item)->OriginalItem()); + fields.insert(((Item_tianmufield *)item)->OriginalItem()); return true; case Item::FIELD_ITEM: if (((Item_field *)item)->field && !HandledFieldType(item->result_type())) return false; @@ -156,21 +156,21 @@ bool MysqlExpression::SanityAggregationCheck(Item *item, std::set &field } } -Item_sdbfield *MysqlExpression::GetSdbfieldItem(Item_field *ifield) { +Item_tianmufield *MysqlExpression::GetTianmufieldItem(Item_field *ifield) { auto key = item2varid->find(ifield); DEBUG_ASSERT(key != item2varid->end()); - auto it = sdbfields_cache.find(key->second); - Item_sdbfield *sdbfield = NULL; - if (it != sdbfields_cache.end()) { - sdbfield = *it->second.begin(); - sdbfield->varID.push_back(key->second); + auto it = tianmu_fields_cache.find(key->second); + Item_tianmufield *tianmufield = NULL; + if (it != tianmu_fields_cache.end()) { + tianmufield = *it->second.begin(); + tianmufield->varID.push_back(key->second); } else { - sdbfield = new Item_sdbfield(ifield, key->second); - std::set s_tmp; - s_tmp.insert(sdbfield); - sdbfields_cache.insert(make_pair(key->second, s_tmp)); + tianmufield = new Item_tianmufield(ifield, key->second); + std::set s_tmp; + s_tmp.insert(tianmufield); + tianmu_fields_cache.insert(make_pair(key->second, s_tmp)); } - return (sdbfield); + return (tianmufield); } void MysqlExpression::RemoveUnusedVarID(Item *root) { @@ -178,9 +178,9 @@ void MysqlExpression::RemoveUnusedVarID(Item *root) { case Item::FIELD_ITEM: case Item::SUM_FUNC_ITEM: break; - case (Item::Type)Item_sdbfield::enumSDBFiledItem::SDBFIELD_ITEM: { - Item_sdbfield *sdbfield = static_cast(root); - sdbfield->varID.pop_back(); + case (Item::Type)Item_tianmufield::enumTIANMUFiledItem::TIANMUFIELD_ITEM: { + Item_tianmufield *tianmufield = static_cast(root); + tianmufield->varID.pop_back(); } break; case Item::FUNC_ITEM: { @@ -215,7 +215,7 @@ void MysqlExpression::RemoveUnusedVarID(Item *root) { break; default: - STONEDB_ERROR( + TIANMU_ERROR( "Unexpected type of item passed to " "MysqlExpression::IncrementUsageCounter()"); } @@ -232,28 +232,28 @@ Item *MysqlExpression::TransformTree(Item *root, TransformDirection dir) { if (dir == TransformDirection::BACKWARD) // already transformed (DAG case) return root; // dir == FORWARD - Item_sdbfield *sdbfield = GetSdbfieldItem(static_cast(root)); - vars.insert(sdbfield->varID[0]); + Item_tianmufield *tianmufield = GetTianmufieldItem(static_cast(root)); + vars.insert(tianmufield->varID[0]); - return sdbfield; + return tianmufield; } case Item::SUM_FUNC_ITEM: { if (dir == TransformDirection::BACKWARD) // already transformed (DAG case) return root; // dir == FORWARD - Item_sdbfield *sdbsum = GetSdbfieldItem(static_cast(root)); - vars.insert(sdbsum->varID[0]); - // Item_sdbsum* sdbsum = new Item_sdbsum(aggregation, + Item_tianmufield *tianmusum = GetTianmufieldItem(static_cast(root)); + vars.insert(tianmusum->varID[0]); + // Item_tianmusum* tianmusum = new Item_tianmusum(aggregation, // (*item2varid)[aggregation]); - return sdbsum; + return tianmusum; } - case (Item::Type)Item_sdbfield::enumSDBFiledItem::SDBFIELD_ITEM: { - Item_sdbfield *sdbfield = static_cast(root); + case (Item::Type)Item_tianmufield::enumTIANMUFiledItem::TIANMUFIELD_ITEM: { + Item_tianmufield *tianmufield = static_cast(root); if (dir == TransformDirection::FORWARD) { // already transformed (DAG case) - Item_field *ifield = sdbfield->OriginalItem(); - // if(!(sdbfield->varID == (*item2varid)[ifield])) { + Item_field *ifield = tianmufield->OriginalItem(); + // if(!(tianmufield->varID == (*item2varid)[ifield])) { // char err[256]; - // VarID v1 = sdbfield->varID; + // VarID v1 = tianmufield->varID; // VarID v2 = (*item2varid)[ifield]; // std::sprintf(err, "Internal error. The same table field occurs twice // in two expressions " @@ -264,19 +264,19 @@ Item *MysqlExpression::TransformTree(Item *root, TransformDirection dir) { // //std::fprintf(stderr, "Error in MysqlExpression::TransformTree(): // %s\n", err); throw common::Exception(err); //} - std::set s_tmp; - s_tmp.insert(sdbfield); - sdbfields_cache.insert(std::make_pair((*item2varid)[ifield], s_tmp)); + std::set s_tmp; + s_tmp.insert(tianmufield); + tianmu_fields_cache.insert(std::make_pair((*item2varid)[ifield], s_tmp)); vars.insert((*item2varid)[ifield]); - sdbfield->varID.push_back((*item2varid)[ifield]); - // sdbfields_cache.insert(std::make_pair(sdbfield->varID, sdbfield)); + tianmufield->varID.push_back((*item2varid)[ifield]); + // tianmu_fields_cache.insert(std::make_pair(tianmufield->varID, tianmufield)); return root; } // dir == BACKWARD - // delete sdbfield; // done by MySQL not STONEDB, for each Item subclass - sdbfield->ClearBuf(); - return sdbfield->OriginalItem(); + // delete tianmufield; // done by MySQL not TIANMU, for each Item subclass + tianmufield->ClearBuf(); + return tianmufield->OriginalItem(); } case Item::FUNC_ITEM: { @@ -339,7 +339,7 @@ Item *MysqlExpression::TransformTree(Item *root, TransformDirection dir) { return root; default: - STONEDB_ERROR("Unexpected type of item passed to MysqlExpression::TransformTree()"); + TIANMU_ERROR("Unexpected type of item passed to MysqlExpression::TransformTree()"); return root; } } @@ -348,14 +348,14 @@ MysqlExpression::SetOfVars &MysqlExpression::GetVars() { return vars; } void MysqlExpression::SetBufsOrParams(var_buf_t *bufs) { DEBUG_ASSERT(bufs); - for (auto &it : sdbfields_cache) { + for (auto &it : tianmu_fields_cache) { auto buf_set = bufs->find(it.first); if (buf_set != bufs->end()) { - // for each sdbitem* in the vector it->second put its buffer to + // for each tianmuitem* in the vector it->second put its buffer to // buf_set.second - for (auto &sdbfield : it.second) { + for (auto &tianmufield : it.second) { ValueOrNull *von; - sdbfield->SetBuf(von); + tianmufield->SetBuf(von); buf_set->second.push_back(value_or_null_info_t(ValueOrNull(), von)); } } @@ -363,19 +363,19 @@ void MysqlExpression::SetBufsOrParams(var_buf_t *bufs) { } DataType MysqlExpression::EvalType(TypOfVars *tv) { - // set types of variables (_sdbfieldsCache) + // set types of variables (_tianmufieldsCache) if (tv) { DataType fieldtype; - auto sdbfield_set = sdbfields_cache.begin(); - while (sdbfield_set != sdbfields_cache.end()) { - auto it = tv->find(sdbfield_set->first); + auto tianmufield_set = tianmu_fields_cache.begin(); + while (tianmufield_set != tianmu_fields_cache.end()) { + auto it = tv->find(tianmufield_set->first); if (it != tv->end()) { - for (auto &sdbfield : sdbfield_set->second) { + for (auto &tianmufield : tianmufield_set->second) { fieldtype = it->second; - sdbfield->SetType(fieldtype); + tianmufield->SetType(fieldtype); } } - sdbfield_set++; + tianmufield_set++; } } @@ -393,23 +393,23 @@ DataType MysqlExpression::EvalType(TypOfVars *tv) { break; case STRING_RESULT: // GA: in case of time item->max_length can contain // invalid value - if ((item->type() != Item_sdbfield::get_sdbitem_type() && item->field_type() == MYSQL_TYPE_TIME) || - (item->type() == Item_sdbfield::get_sdbitem_type() && - static_cast(item)->IsAggregation() == false && item->field_type() == MYSQL_TYPE_TIME)) + if ((item->type() != Item_tianmufield::get_tianmuitem_type() && item->field_type() == MYSQL_TYPE_TIME) || + (item->type() == Item_tianmufield::get_tianmuitem_type() && + static_cast(item)->IsAggregation() == false && item->field_type() == MYSQL_TYPE_TIME)) type = DataType(common::CT::TIME, 17, 0, item->collation); - else if ((item->type() != Item_sdbfield::get_sdbitem_type() && item->field_type() == MYSQL_TYPE_TIMESTAMP) || - (item->type() == Item_sdbfield::get_sdbitem_type() && - static_cast(item)->IsAggregation() == false && + else if ((item->type() != Item_tianmufield::get_tianmuitem_type() && item->field_type() == MYSQL_TYPE_TIMESTAMP) || + (item->type() == Item_tianmufield::get_tianmuitem_type() && + static_cast(item)->IsAggregation() == false && item->field_type() == MYSQL_TYPE_TIMESTAMP)) type = DataType(common::CT::TIMESTAMP, 17, 0, item->collation); - else if ((item->type() != Item_sdbfield::get_sdbitem_type() && item->field_type() == MYSQL_TYPE_DATETIME) || - (item->type() == Item_sdbfield::get_sdbitem_type() && - static_cast(item)->IsAggregation() == false && + else if ((item->type() != Item_tianmufield::get_tianmuitem_type() && item->field_type() == MYSQL_TYPE_DATETIME) || + (item->type() == Item_tianmufield::get_tianmuitem_type() && + static_cast(item)->IsAggregation() == false && item->field_type() == MYSQL_TYPE_DATETIME)) type = DataType(common::CT::DATETIME, 17, 0, item->collation); - else if ((item->type() != Item_sdbfield::get_sdbitem_type() && item->field_type() == MYSQL_TYPE_DATE) || - (item->type() == Item_sdbfield::get_sdbitem_type() && - static_cast(item)->IsAggregation() == false && item->field_type() == MYSQL_TYPE_DATE)) + else if ((item->type() != Item_tianmufield::get_tianmuitem_type() && item->field_type() == MYSQL_TYPE_DATE) || + (item->type() == Item_tianmufield::get_tianmuitem_type() && + static_cast(item)->IsAggregation() == false && item->field_type() == MYSQL_TYPE_DATE)) type = DataType(common::CT::DATE, 17, 0, item->collation); else // type = DataType(common::CT::STRING, item->max_length, 0, @@ -435,9 +435,9 @@ DataType MysqlExpression::EvalType(TypOfVars *tv) { MysqlExpression::StringType MysqlExpression::GetStringType() { if (mysql_type == STRING_RESULT) { - if ((item->type() != Item_sdbfield::get_sdbitem_type() && item->field_type() == MYSQL_TYPE_TIME) || - (item->type() == Item_sdbfield::get_sdbitem_type() && - static_cast(item)->IsAggregation() == false && item->field_type() == MYSQL_TYPE_TIME)) + if ((item->type() != Item_tianmufield::get_tianmuitem_type() && item->field_type() == MYSQL_TYPE_TIME) || + (item->type() == Item_tianmufield::get_tianmuitem_type() && + static_cast(item)->IsAggregation() == false && item->field_type() == MYSQL_TYPE_TIME)) return StringType::STRING_TIME; else return StringType::STRING_NORMAL; @@ -467,8 +467,8 @@ void MysqlExpression::CheckDecimalError(int err) { if (err > E_DEC_TRUNCATED) throw common::Exception( "Numeric result of an expression is too large and cannot be handled by " - "stonedb. " - "Please use an explicit cast to a data type handled by stonedb, " + "tianmu. " + "Please use an explicit cast to a data type handled by tianmu, " "e.g. CAST( AS DECIMAL(18,6))."); } @@ -553,13 +553,13 @@ std::shared_ptr MysqlExpression::ItemInt2ValueOrNull(Item *item) { return val; } -bool SameSDBField(Item_sdbfield *const &l, Item_sdbfield *const &r) { +bool SameTIANMUField(Item_tianmufield *const &l, Item_tianmufield *const &r) { return (!(l || r)) || (l && r && ((*l) == (*r))); } -bool SameSDBFieldSet(MysqlExpression::sdbfields_cache_t::value_type const &l, - MysqlExpression::sdbfields_cache_t::value_type const &r) { - return l.second.size() == r.second.size() && equal(l.second.begin(), l.second.end(), r.second.begin(), SameSDBField); +bool SameTIANMUFieldSet(MysqlExpression::tianmu_fields_cache_t::value_type const &l, + MysqlExpression::tianmu_fields_cache_t::value_type const &r) { + return l.second.size() == r.second.size() && equal(l.second.begin(), l.second.end(), r.second.begin(), SameTIANMUField); } bool operator==(Item const &, Item const &); @@ -638,9 +638,9 @@ bool operator==(Item const &l_, Item const &r_) { } } } break; - case static_cast(Item_sdbfield::enumSDBFiledItem::SDBFIELD_ITEM): { - Item_sdbfield const *l = static_cast(&l_); - Item_sdbfield const *r = static_cast(&r_); + case static_cast(Item_tianmufield::enumTIANMUFiledItem::TIANMUFIELD_ITEM): { + Item_tianmufield const *l = static_cast(&l_); + Item_tianmufield const *r = static_cast(&r_); same = (*l == *r); } break; case (Item::REF_ITEM): { @@ -669,8 +669,8 @@ bool operator==(Item const &l_, Item const &r_) { bool MysqlExpression::operator==(MysqlExpression const &other) const { return ((mysql_type == other.mysql_type) && (decimal_precision == other.decimal_precision) && (decimal_scale == other.decimal_scale) && (deterministic == other.deterministic) && - (*item == *(other.item)) && (sdbfields_cache.size() == other.sdbfields_cache.size()) && vars == other.vars && - equal(sdbfields_cache.begin(), sdbfields_cache.end(), other.sdbfields_cache.begin(), SameSDBFieldSet)); + (*item == *(other.item)) && (tianmu_fields_cache.size() == other.tianmu_fields_cache.size()) && vars == other.vars && + equal(tianmu_fields_cache.begin(), tianmu_fields_cache.end(), other.tianmu_fields_cache.begin(), SameTIANMUFieldSet)); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/mysql_expression.h b/storage/tianmu/core/mysql_expression.h similarity index 88% rename from storage/stonedb/core/mysql_expression.h rename to storage/tianmu/core/mysql_expression.h index 63e91ee505..038d188efb 100644 --- a/storage/stonedb/core/mysql_expression.h +++ b/storage/tianmu/core/mysql_expression.h @@ -14,29 +14,29 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_MYSQL_EXPRESSION_H_ -#define STONEDB_CORE_MYSQL_EXPRESSION_H_ +#ifndef TIANMU_CORE_MYSQL_EXPRESSION_H_ +#define TIANMU_CORE_MYSQL_EXPRESSION_H_ #pragma once #include #include #include "common/common_definitions.h" -#include "core/item_sdbfield.h" +#include "core/item_tianmu_field.h" #include "core/value_or_null.h" #include "core/var_id.h" -namespace stonedb { +namespace Tianmu { namespace core { -class Item_sdbfield; +class Item_tianmufield; // Wrapper for MySQL expression tree class MysqlExpression { public: - // map which tells how to replace Item_field's with Item_sdbfield + // map which tells how to replace Item_field's with Item_tianmufield using Item2VarID = std::map; using TypOfVars = std::map; // map of types of variables - using sdbfields_cache_t = std::map>; + using tianmu_fields_cache_t = std::map>; using value_or_null_info_t = std::pair; using var_buf_t = std::map>; using SetOfVars = std::set; // set of IDs of variables occuring in @@ -59,7 +59,7 @@ class MysqlExpression { void RemoveUnusedVarID() { RemoveUnusedVarID(item); } Item *GetItem() { return item; } - const sdbfields_cache_t &GetSDBItems() { return sdbfields_cache; } + const tianmu_fields_cache_t &GetTIANMUItems() { return tianmu_fields_cache; } bool IsDeterministic() { return deterministic; } /*! \brief Tests if other MysqlExpression is same as this one. * @@ -89,7 +89,7 @@ class MysqlExpression { static bool HandledResultType(Item *item); static bool HandledFieldType(Item_result type); - Item_sdbfield *GetSdbfieldItem(Item_field *); + Item_tianmufield *GetTianmufieldItem(Item_field *); enum class TransformDirection { FORWARD, BACKWARD }; @@ -106,12 +106,12 @@ class MysqlExpression { Item_result mysql_type; uint decimal_precision, decimal_scale; Item2VarID *item2varid; - sdbfields_cache_t sdbfields_cache; - SetOfVars vars; // variable IDs in the expression, same as in sdbfields_cache; + tianmu_fields_cache_t tianmu_fields_cache; + SetOfVars vars; // variable IDs in the expression, same as in tianmu_fields_cache; // filled in TransformTree bool deterministic; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_MYSQL_EXPRESSION_H_ +#endif // TIANMU_CORE_MYSQL_EXPRESSION_H_ diff --git a/storage/stonedb/core/object_cache.h b/storage/tianmu/core/object_cache.h similarity index 92% rename from storage/stonedb/core/object_cache.h rename to storage/tianmu/core/object_cache.h index f84746adc0..769ebf2c0d 100644 --- a/storage/stonedb/core/object_cache.h +++ b/storage/tianmu/core/object_cache.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_OBJECT_CACHE_H_ -#define STONEDB_CORE_OBJECT_CACHE_H_ +#ifndef TIANMU_CORE_OBJECT_CACHE_H_ +#define TIANMU_CORE_OBJECT_CACHE_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace core { template > class ObjectCache final { @@ -68,6 +68,6 @@ class ObjectCache final { } }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_OBJECT_CACHE_H_ +#endif // TIANMU_CORE_OBJECT_CACHE_H_ diff --git a/storage/stonedb/core/pack.cpp b/storage/tianmu/core/pack.cpp similarity index 93% rename from storage/stonedb/core/pack.cpp rename to storage/tianmu/core/pack.cpp index 35fd40131c..ff7458c519 100644 --- a/storage/stonedb/core/pack.cpp +++ b/storage/tianmu/core/pack.cpp @@ -21,7 +21,7 @@ #include "core/data_cache.h" #include "core/tools.h" -namespace stonedb { +namespace Tianmu { namespace core { Pack::Pack(DPN *dpn, PackCoordinate pc, ColumnShare *s) : s(s), dpn(dpn) { NULLS_SIZE = (1 << s->pss) / 8; @@ -44,17 +44,17 @@ Pack::Pack(const Pack &ap, const PackCoordinate &pc) : mm::TraceableObject(ap), } int64_t Pack::GetValInt([[maybe_unused]] int n) const { - STONEDB_ERROR("Not implemented"); + TIANMU_ERROR("Not implemented"); return 0; } double Pack::GetValDouble([[maybe_unused]] int n) const { - STONEDB_ERROR("Not implemented"); + TIANMU_ERROR("Not implemented"); return 0; } types::BString Pack::GetValueBinary([[maybe_unused]] int n) const { - STONEDB_ERROR("Not implemented"); + TIANMU_ERROR("Not implemented"); return 0; } @@ -66,4 +66,4 @@ bool Pack::ShouldNotCompress() const { return (dpn->nr < (1U << s->pss)) || (s->ColType().GetFmt() == common::PackFmt::NOCOMPRESS); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/pack.h b/storage/tianmu/core/pack.h similarity index 96% rename from storage/stonedb/core/pack.h rename to storage/tianmu/core/pack.h index 81d01d5591..3f93b08d60 100644 --- a/storage/stonedb/core/pack.h +++ b/storage/tianmu/core/pack.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_PACK_H_ -#define STONEDB_CORE_PACK_H_ +#ifndef TIANMU_CORE_PACK_H_ +#define TIANMU_CORE_PACK_H_ #pragma once #include "core/dpn.h" @@ -23,7 +23,7 @@ #include "mm/traceable_object.h" #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace system { class Stream; } // namespace system @@ -118,6 +118,6 @@ class Pack : public mm::TraceableObject { std::unique_ptr nulls; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_PACK_H_ +#endif // TIANMU_CORE_PACK_H_ diff --git a/storage/stonedb/core/pack_guardian.cpp b/storage/tianmu/core/pack_guardian.cpp similarity index 98% rename from storage/stonedb/core/pack_guardian.cpp rename to storage/tianmu/core/pack_guardian.cpp index 2119337200..c7aeedc004 100644 --- a/storage/stonedb/core/pack_guardian.cpp +++ b/storage/tianmu/core/pack_guardian.cpp @@ -22,7 +22,7 @@ #include "core/rc_attr.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { void VCPackGuardian::Initialize(int no_th) { UnlockAll(); @@ -114,4 +114,4 @@ void VCPackGuardian::UnlockAll() { } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/pack_guardian.h b/storage/tianmu/core/pack_guardian.h similarity index 91% rename from storage/stonedb/core/pack_guardian.h rename to storage/tianmu/core/pack_guardian.h index 6d4e2162e9..70341c22b1 100644 --- a/storage/stonedb/core/pack_guardian.h +++ b/storage/tianmu/core/pack_guardian.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_PACK_GUARDIAN_H_ -#define STONEDB_CORE_PACK_GUARDIAN_H_ +#ifndef TIANMU_CORE_PACK_GUARDIAN_H_ +#define TIANMU_CORE_PACK_GUARDIAN_H_ #pragma once #include #include -namespace stonedb { +namespace Tianmu { namespace vcolumn { class VirtualColumn; } // namespace vcolumn @@ -52,6 +52,6 @@ class VCPackGuardian final { std::mutex mx_thread; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_PACK_GUARDIAN_H_ +#endif // TIANMU_CORE_PACK_GUARDIAN_H_ diff --git a/storage/stonedb/core/pack_int.cpp b/storage/tianmu/core/pack_int.cpp similarity index 98% rename from storage/stonedb/core/pack_int.cpp rename to storage/tianmu/core/pack_int.cpp index 054fda9743..48a6cc9cfa 100644 --- a/storage/stonedb/core/pack_int.cpp +++ b/storage/tianmu/core/pack_int.cpp @@ -25,17 +25,17 @@ #include "core/value.h" #include "loader/value_cache.h" #include "mm/mm_guard.h" -#include "system/stonedb_file.h" +#include "system/tianmu_file.h" #include "core/pack_int.h" -namespace stonedb { +namespace Tianmu { namespace core { PackInt::PackInt(DPN *dpn, PackCoordinate pc, ColumnShare *s) : Pack(dpn, pc, s) { is_real = ATI::IsRealType(s->ColType().GetTypeName()); if (dpn->NotTrivial()) { - system::StoneDBFile f; + system::TianmuFile f; f.OpenReadOnly(s->DataFile()); f.Seek(dpn->addr, SEEK_SET); LoadDataFromFile(&f); @@ -453,7 +453,7 @@ void PackInt::LoadValuesFixed(const loader::ValueCache *vc, const std::optional< std::fill_n((uint8_t *)data.ptr, new_nr, delta); break; default: - STONEDB_ERROR("bad value type in pakcN"); + TIANMU_ERROR("bad value type in pakcN"); break; } } @@ -575,7 +575,7 @@ void PackInt::Save() { } s->alloc_seg(dpn); - system::StoneDBFile f; + system::TianmuFile f; f.OpenCreate(s->DataFile()); f.Seek(dpn->addr, SEEK_SET); if (ShouldNotCompress()) @@ -702,7 +702,7 @@ std::pair PackInt::Compress() { compress::BitstreamCompressor bsc; CprsErr res = bsc.Compress((char *)comp_null_buf.get(), null_buf_size, (char *)nulls.get(), dpn->nr, dpn->nn); if (comp_null_buf[cnbl] != 0xBA) { - STONEDB_LOG(LogCtl_Level::ERROR, "buffer overrun by BitstreamCompressor (N f)."); + TIANMU_LOG(LogCtl_Level::ERROR, "buffer overrun by BitstreamCompressor (N f)."); ASSERT(0, "ERROR: buffer overrun by BitstreamCompressor (N f)."); } if (res == CprsErr::CPRS_SUCCESS) @@ -736,4 +736,4 @@ std::pair PackInt::Compress() { return std::make_pair(std::move(ptr), buffer_size); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/pack_int.h b/storage/tianmu/core/pack_int.h similarity index 94% rename from storage/stonedb/core/pack_int.h rename to storage/tianmu/core/pack_int.h index ef0cd22cbe..3f682d751d 100644 --- a/storage/stonedb/core/pack_int.h +++ b/storage/tianmu/core/pack_int.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_PACK_INT_H_ -#define STONEDB_CORE_PACK_INT_H_ +#ifndef TIANMU_CORE_PACK_INT_H_ +#define TIANMU_CORE_PACK_INT_H_ #pragma once #include "core/pack.h" #include "core/value.h" -namespace stonedb { +namespace Tianmu { namespace system { class Stream; @@ -98,7 +98,7 @@ class PackInt final : public Pack { data.pint8[n] = v; return; default: - STONEDB_ERROR("bad value type in pakcN"); + TIANMU_ERROR("bad value type in pakcN"); } } void SetVal64(uint n, const Value &v) { @@ -136,7 +136,7 @@ class PackInt final : public Pack { case 1: return pint8[n]; default: - STONEDB_ERROR("bad value type in pakcN"); + TIANMU_ERROR("bad value type in pakcN"); } } bool empty() const { return ptr == nullptr; } @@ -154,6 +154,6 @@ class PackInt final : public Pack { } data = {}; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_PACK_INT_H_ +#endif // TIANMU_CORE_PACK_INT_H_ diff --git a/storage/stonedb/core/pack_orderer.cpp b/storage/tianmu/core/pack_orderer.cpp similarity index 99% rename from storage/stonedb/core/pack_orderer.cpp rename to storage/tianmu/core/pack_orderer.cpp index 9ff18d4c0b..6c80f16876 100644 --- a/storage/stonedb/core/pack_orderer.cpp +++ b/storage/tianmu/core/pack_orderer.cpp @@ -19,7 +19,7 @@ #include "core/mi_iterator.h" -namespace stonedb { +namespace Tianmu { namespace core { float PackOrderer::basic_sorted_percentage = 10.0; // ordering on just sorted_percentage% of packs @@ -346,4 +346,4 @@ void PackOrderer::RewindToMatch(vcolumn::VirtualColumn *vc, MIIterator &mit) { prevndx[curvc] = curndx[curvc]; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/pack_orderer.h b/storage/tianmu/core/pack_orderer.h similarity index 96% rename from storage/stonedb/core/pack_orderer.h rename to storage/tianmu/core/pack_orderer.h index bdc37b9225..5c5277eb77 100644 --- a/storage/stonedb/core/pack_orderer.h +++ b/storage/tianmu/core/pack_orderer.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_PACK_ORDERER_H_ -#define STONEDB_CORE_PACK_ORDERER_H_ +#ifndef TIANMU_CORE_PACK_ORDERER_H_ +#define TIANMU_CORE_PACK_ORDERER_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "common/common_definitions.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { class PackOrderer { public: @@ -135,6 +135,6 @@ class PackOrderer { int64_t packs_passed; // how many packs are already processed }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_PACK_ORDERER_H_ \ No newline at end of file +#endif // TIANMU_CORE_PACK_ORDERER_H_ \ No newline at end of file diff --git a/storage/stonedb/core/pack_str.cpp b/storage/tianmu/core/pack_str.cpp similarity index 99% rename from storage/stonedb/core/pack_str.cpp rename to storage/tianmu/core/pack_str.cpp index f128390425..e6101f0dc0 100644 --- a/storage/stonedb/core/pack_str.cpp +++ b/storage/tianmu/core/pack_str.cpp @@ -31,11 +31,11 @@ #include "core/value.h" #include "loader/value_cache.h" #include "mm/mm_guard.h" -#include "system/stonedb_file.h" +#include "system/tianmu_file.h" #include "system/stream.h" #include "system/txt_utils.h" -namespace stonedb { +namespace Tianmu { namespace core { PackStr::PackStr(DPN *dpn, PackCoordinate pc, ColumnShare *s) : Pack(dpn, pc, s) { auto t = s->ColType().GetTypeName(); @@ -51,7 +51,7 @@ PackStr::PackStr(DPN *dpn, PackCoordinate pc, ColumnShare *s) : Pack(dpn, pc, s) std::memset(data.lens, 0, data.len_mode * (1 << s->pss)); if (!dpn->NullOnly()) { - system::StoneDBFile f; + system::TianmuFile f; f.OpenReadOnly(s->DataFile()); f.Seek(dpn->addr, SEEK_SET); LoadDataFromFile(&f); @@ -295,7 +295,7 @@ std::pair PackStr::Compress() { compress::BitstreamCompressor bsc; CprsErr res = bsc.Compress(comp_null_buf.get(), comp_null_buf_size, (char *)nulls.get(), dpn->nr, dpn->nn); if (comp_null_buf[cnbl] != char(0xBA)) { - STONEDB_ERROR("buffer overrun by BitstreamCompressor!"); + TIANMU_ERROR("buffer overrun by BitstreamCompressor!"); } if (res == CprsErr::CPRS_SUCCESS) SetModeNullsCompressed(); @@ -461,7 +461,7 @@ void PackStr::Save() { UniquePtr compressed_buf; if (!ShouldNotCompress()) { if (data.sum_len > common::MAX_CMPR_SIZE) { - STONEDB_LOG(LogCtl_Level::WARN, + TIANMU_LOG(LogCtl_Level::WARN, "pack (%d-%d-%d) size %ld exceeds supported compression " "size, will not be compressed!", pc_table(GetCoordinate().co.pack), pc_column(GetCoordinate().co.pack), pc_dp(GetCoordinate().co.pack), @@ -480,7 +480,7 @@ void PackStr::Save() { dpn->len = NULLS_SIZE + data.sum_len + (data.len_mode * (1 << s->pss)); } s->alloc_seg(dpn); - system::StoneDBFile f; + system::TianmuFile f; f.OpenCreate(s->DataFile()); f.Seek(dpn->addr, SEEK_SET); if (IsModeCompressionApplied()) { @@ -714,4 +714,4 @@ bool PackStr::IsNotMatched(int row, const std::unordered_set &ids) { return ids.find(ids_array_[row]) == ids.end(); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/pack_str.h b/storage/tianmu/core/pack_str.h similarity index 96% rename from storage/stonedb/core/pack_str.h rename to storage/tianmu/core/pack_str.h index f29971dc52..1a7c462d15 100644 --- a/storage/stonedb/core/pack_str.h +++ b/storage/tianmu/core/pack_str.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_PACK_STR_H_ -#define STONEDB_CORE_PACK_STR_H_ +#ifndef TIANMU_CORE_PACK_STR_H_ +#define TIANMU_CORE_PACK_STR_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "core/pack.h" #include "marisa.h" -namespace stonedb { +namespace Tianmu { namespace loader { class ValueCache; @@ -149,6 +149,6 @@ class PackStr final : public Pack { int GetCompressBufferSize(size_t size); }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_PACK_STR_H_ +#endif // TIANMU_CORE_PACK_STR_H_ diff --git a/storage/stonedb/core/parallel_hash_join.cpp b/storage/tianmu/core/parallel_hash_join.cpp similarity index 97% rename from storage/stonedb/core/parallel_hash_join.cpp rename to storage/tianmu/core/parallel_hash_join.cpp index eff3e43220..19eaaf6fd6 100644 --- a/storage/stonedb/core/parallel_hash_join.cpp +++ b/storage/tianmu/core/parallel_hash_join.cpp @@ -30,7 +30,7 @@ #include "util/thread_pool.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { namespace { const int kJoinSplittedMinPacks = 5; @@ -43,14 +43,14 @@ int EvaluateTraversedFragments(int packs_count) { int EvaluateMatchedFragmentsWithPacks(int packs_count) { int needed_fragments = (packs_count + kJoinSplittedMinPacks) / kJoinSplittedMinPacks; - int max_fragments = stonedb_sysvar_query_threads ? stonedb_sysvar_query_threads : std::thread::hardware_concurrency(); + int max_fragments = tianmu_sysvar_query_threads ? tianmu_sysvar_query_threads : std::thread::hardware_concurrency(); int fragments = std::min(needed_fragments, max_fragments); return std::max(fragments, 1); } int EvaluateMatchedFragmentsWithRows([[maybe_unused]] uint32_t pack_power, int64_t split_unit, int64_t rows_count) { int needed_fragments = (rows_count + split_unit) / split_unit; - int max_fragments = stonedb_sysvar_query_threads ? stonedb_sysvar_query_threads : std::thread::hardware_concurrency(); + int max_fragments = tianmu_sysvar_query_threads ? tianmu_sysvar_query_threads : std::thread::hardware_concurrency(); int fragments = std::min(needed_fragments, max_fragments); return std::max(fragments, 1); } @@ -556,10 +556,10 @@ int64_t ParallelHashJoiner::TraverseDim(MIIterator &mit, int64_t *outer_tuples) traversed_rows += res.get(i); } catch (std::exception &e) { no_except = false; - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { no_except = false; - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } if (!no_except) { throw common::Exception("Parallel hash join failed."); @@ -571,7 +571,7 @@ int64_t ParallelHashJoiner::TraverseDim(MIIterator &mit, int64_t *outer_tuples) << system::unlock; for (auto ¶ms : traverse_task_params) { - if (params.too_many_conflicts && !stonedb_sysvar_join_disable_switch_side) { + if (params.too_many_conflicts && !tianmu_sysvar_join_disable_switch_side) { if (!force_switching_sides_ && !too_many_conflicts_) too_many_conflicts_ = true; } @@ -628,7 +628,7 @@ int64_t ParallelHashJoiner::AsyncTraverseDim(TraverseTaskParams *params) { // current row } - if (!force_switching_sides_ && params->too_many_conflicts && !stonedb_sysvar_join_disable_switch_side) + if (!force_switching_sides_ && params->too_many_conflicts && !tianmu_sysvar_join_disable_switch_side) break; // and exit the function if (watch_traversed_) params->traversed_hash_table->outer_filter()->Set(hash_row); @@ -702,7 +702,7 @@ bool ParallelHashJoiner::CreateMatchingTasks(MIIterator &mit, int64_t rows_count if (packs_count > kJoinSplittedMinPacks) { // Splitting using packs. - int split_count = (stonedb_sysvar_join_parallel > 1) ? stonedb_sysvar_join_parallel + int split_count = (tianmu_sysvar_join_parallel > 1) ? tianmu_sysvar_join_parallel : EvaluateMatchedFragmentsWithPacks(packs_count); int packs_per_fragment = (packs_count + kJoinSplittedMinPacks) / split_count; for (int index = 0; index < split_count; ++index) { @@ -715,7 +715,7 @@ bool ParallelHashJoiner::CreateMatchingTasks(MIIterator &mit, int64_t rows_count task_iterators->push_back(iter); } *splitting_type = "packs"; - } else if (stonedb_sysvar_join_splitrows > 0) { + } else if (tianmu_sysvar_join_splitrows > 0) { // Splitting using rows. uint64_t origin_size = rows_count; for (int index = 0; index < mind->NumOfDimensions(); index++) { @@ -725,8 +725,8 @@ bool ParallelHashJoiner::CreateMatchingTasks(MIIterator &mit, int64_t rows_count } int64_t rows_unit = (1 << pack_power_) / 4; - int split_count = (stonedb_sysvar_join_splitrows > 1) - ? stonedb_sysvar_join_splitrows + int split_count = (tianmu_sysvar_join_splitrows > 1) + ? tianmu_sysvar_join_splitrows : EvaluateMatchedFragmentsWithRows(pack_power_, rows_unit, origin_size); int64_t rows_per_fragment = (origin_size + rows_unit) / split_count; for (int index = 0; index < split_count; ++index) { @@ -792,10 +792,10 @@ int64_t ParallelHashJoiner::MatchDim(MIIterator &mit) { matched_rows += res.get(i); } catch (std::exception &e) { no_except = false; - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { no_except = false; - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } if (!no_except) { throw common::Exception("Parallel hash join failed."); @@ -1173,8 +1173,8 @@ int64_t ParallelHashJoiner::SubmitOuterMatched(MIIterator &miter) { std::unique_ptr CreateHashJoiner(MultiIndex *multi_index, TempTable *temp_table, JoinTips &join_tips) { TwoDimensionalJoiner *joiner = nullptr; - if (stonedb_sysvar_join_parallel > 0) { - if (stonedb_sysvar_async_join_setting.is_enabled() && GetTaskExecutor()) { + if (tianmu_sysvar_join_parallel > 0) { + if (tianmu_sysvar_async_join_setting.is_enabled() && GetTaskExecutor()) { joiner = new ProxyHashJoiner(multi_index, temp_table, join_tips); } else { joiner = new ParallelHashJoiner(multi_index, temp_table, join_tips); @@ -1185,4 +1185,4 @@ std::unique_ptr CreateHashJoiner(MultiIndex *multi_index, return std::unique_ptr(joiner); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/parallel_hash_join.h b/storage/tianmu/core/parallel_hash_join.h similarity index 98% rename from storage/stonedb/core/parallel_hash_join.h rename to storage/tianmu/core/parallel_hash_join.h index efa2afd281..152542b79c 100644 --- a/storage/stonedb/core/parallel_hash_join.h +++ b/storage/tianmu/core/parallel_hash_join.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_PARALLEL_HASH_JOIN_H_ -#define STONEDB_CORE_PARALLEL_HASH_JOIN_H_ +#ifndef TIANMU_CORE_PARALLEL_HASH_JOIN_H_ +#define TIANMU_CORE_PARALLEL_HASH_JOIN_H_ #pragma once #include @@ -27,7 +27,7 @@ #include "core/joiner.h" #include "core/multi_index_builder.h" -namespace stonedb { +namespace Tianmu { namespace core { class MITaskIterator { public: @@ -229,6 +229,6 @@ class ParallelHashJoiner : public TwoDimensionalJoiner { std::unique_ptr CreateHashJoiner(MultiIndex *multi_index, TempTable *temp_table, JoinTips &join_tips); } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_PARALLEL_HASH_JOIN_H_ +#endif // TIANMU_CORE_PARALLEL_HASH_JOIN_H_ diff --git a/storage/stonedb/core/parameterized_filter.cpp b/storage/tianmu/core/parameterized_filter.cpp similarity index 99% rename from storage/stonedb/core/parameterized_filter.cpp rename to storage/tianmu/core/parameterized_filter.cpp index 13d5323f2f..6fad840e89 100644 --- a/storage/stonedb/core/parameterized_filter.cpp +++ b/storage/tianmu/core/parameterized_filter.cpp @@ -33,7 +33,7 @@ #include "vc/single_column.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { ParameterizedFilter::ParameterizedFilter(uint32_t power, CondType filter_type) : rough_mind(NULL), filter_type(filter_type) { @@ -177,8 +177,8 @@ double ParameterizedFilter::EvaluateConditionNonJoinWeight(Descriptor &d, bool f eval = d.tree->root->EvaluateConditionWeight(this, for_or); } else { // expressions and other types, incl. joins (to be calculated // separately) - if (d.IsType_STONEDBExpression()) - return log(1 + double(d.attr.vc->NumOfTuples())) + 2; // +2 as a penalty for STONEDB complex expression + if (d.IsType_TIANMUExpression()) + return log(1 + double(d.attr.vc->NumOfTuples())) + 2; // +2 as a penalty for TIANMU complex expression eval = 99999; } return eval; @@ -1257,7 +1257,7 @@ void ParameterizedFilter::ApplyDescriptor(int desc_number, int64_t limit) << "EvaluateOnIndex done, desc number " << desc_number << system::unlock; } else { int poolsize = rceng->query_thread_pool.size(); - if ((stonedb_sysvar_threadpoolsize > 0) && (packs_no / poolsize > 0) && !desc.IsType_Subquery() && + if ((tianmu_sysvar_threadpoolsize > 0) && (packs_no / poolsize > 0) && !desc.IsType_Subquery() && !desc.ExsitTmpTable()) { int step = 0; int task_num = 0; @@ -1388,4 +1388,4 @@ void ParameterizedFilter::TaskProcessPacks(MIUpdatingIterator *taskIterator, Tra taskIterator->Commit(false); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/parameterized_filter.h b/storage/tianmu/core/parameterized_filter.h similarity index 95% rename from storage/stonedb/core/parameterized_filter.h rename to storage/tianmu/core/parameterized_filter.h index 4c2c9176a5..2e15f308d7 100644 --- a/storage/stonedb/core/parameterized_filter.h +++ b/storage/tianmu/core/parameterized_filter.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_PARAMETERIZED_FILTER_H_ -#define STONEDB_CORE_PARAMETERIZED_FILTER_H_ +#ifndef TIANMU_CORE_PARAMETERIZED_FILTER_H_ +#define TIANMU_CORE_PARAMETERIZED_FILTER_H_ #pragma once #include "core/condition.h" @@ -23,7 +23,7 @@ #include "core/joiner.h" #include "core/multi_index.h" -namespace stonedb { +namespace Tianmu { namespace core { class TempTable; class RoughMultiIndex; @@ -88,6 +88,6 @@ class ParameterizedFilter final { void AssignInternal(const ParameterizedFilter &pf); }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_PARAMETERIZED_FILTER_H_ +#endif // TIANMU_CORE_PARAMETERIZED_FILTER_H_ diff --git a/storage/stonedb/core/physical_column.h b/storage/tianmu/core/physical_column.h similarity index 98% rename from storage/stonedb/core/physical_column.h rename to storage/tianmu/core/physical_column.h index 2b2bfbe039..5529b58c81 100644 --- a/storage/stonedb/core/physical_column.h +++ b/storage/tianmu/core/physical_column.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_PHYSICAL_COLUMN_H_ -#define STONEDB_CORE_PHYSICAL_COLUMN_H_ +#ifndef TIANMU_CORE_PHYSICAL_COLUMN_H_ +#define TIANMU_CORE_PHYSICAL_COLUMN_H_ #pragma once #include "core/column.h" @@ -23,7 +23,7 @@ #include "core/mysql_expression.h" #include "types/text_stat.h" -namespace stonedb { +namespace Tianmu { namespace core { //! A column in a table. Values contained in it exist physically on disk and/or @@ -290,6 +290,6 @@ class PhysicalColumn : public Column { }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_PHYSICAL_COLUMN_H_ +#endif // TIANMU_CORE_PHYSICAL_COLUMN_H_ diff --git a/storage/stonedb/core/proxy_hash_joiner.cpp b/storage/tianmu/core/proxy_hash_joiner.cpp similarity index 95% rename from storage/stonedb/core/proxy_hash_joiner.cpp rename to storage/tianmu/core/proxy_hash_joiner.cpp index 797ab7ddec..8e1bfd3fad 100644 --- a/storage/stonedb/core/proxy_hash_joiner.cpp +++ b/storage/tianmu/core/proxy_hash_joiner.cpp @@ -35,7 +35,7 @@ #include "system/fet.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { namespace stdexp = std::experimental; @@ -57,11 +57,11 @@ class MIIteratorPoller { slice_type_ = "none"; if (slice_capability_.type != MIIterator::SliceCapability::Type::kDisable) { if (slice_capability_.type == MIIterator::SliceCapability::Type::kLinear) { - if (stonedb_sysvar_async_join_setting.pack_per_step > 0) - slice_type_ = base::sprint("per %d packs", stonedb_sysvar_async_join_setting.pack_per_step); + if (tianmu_sysvar_async_join_setting.pack_per_step > 0) + slice_type_ = base::sprint("per %d packs", tianmu_sysvar_async_join_setting.pack_per_step); else { - DEBUG_ASSERT(stonedb_sysvar_async_join_setting.rows_per_step > 0); - slice_type_ = base::sprint("per %d rows", stonedb_sysvar_async_join_setting.rows_per_step); + DEBUG_ASSERT(tianmu_sysvar_async_join_setting.rows_per_step > 0); + slice_type_ = base::sprint("per %d rows", tianmu_sysvar_async_join_setting.rows_per_step); } } else { slice_type_ = "fixed"; @@ -80,12 +80,12 @@ class MIIteratorPoller { size_t step = 1; int64_t sentry_pos = slice_capability_.slices.size(); if (slice_capability_.type == MIIterator::SliceCapability::Type::kLinear) { - DEBUG_ASSERT(stonedb_sysvar_async_join_setting.pack_per_step > 0 || - stonedb_sysvar_async_join_setting.rows_per_step > 0); + DEBUG_ASSERT(tianmu_sysvar_async_join_setting.pack_per_step > 0 || + tianmu_sysvar_async_join_setting.rows_per_step > 0); // Preferred iterating by pack. - if (stonedb_sysvar_async_join_setting.pack_per_step > 0) { - pack_iter.reset(new MIPackStepIterator(cur_pos_, stonedb_sysvar_async_join_setting.pack_per_step, *miter_)); - step = stonedb_sysvar_async_join_setting.pack_per_step; + if (tianmu_sysvar_async_join_setting.pack_per_step > 0) { + pack_iter.reset(new MIPackStepIterator(cur_pos_, tianmu_sysvar_async_join_setting.pack_per_step, *miter_)); + step = tianmu_sysvar_async_join_setting.pack_per_step; // Get actual pack, because RewindToPack of MIIterator will skip the // un-hitted package. for (auto index : boost::irange(0, pack_iter->NumOfDimensions())) { @@ -95,14 +95,14 @@ class MIIteratorPoller { } } } else { - DEBUG_ASSERT(stonedb_sysvar_async_join_setting.rows_per_step > 0); + DEBUG_ASSERT(tianmu_sysvar_async_join_setting.rows_per_step > 0); sentry_pos = origin_size_; pack_iter.reset( - new MIRowsStepIterator(cur_pos_, stonedb_sysvar_async_join_setting.rows_per_step, origin_size_, *miter_)); + new MIRowsStepIterator(cur_pos_, tianmu_sysvar_async_join_setting.rows_per_step, origin_size_, *miter_)); if (pack_iter->IsValid()) { - step = stonedb_sysvar_async_join_setting.rows_per_step; + step = tianmu_sysvar_async_join_setting.rows_per_step; // Get actual pack, because RewindToPack of MIIterator will skip the // un-hitted package. for (auto index : boost::irange(0, pack_iter->NumOfDimensions())) { @@ -115,7 +115,7 @@ class MIIteratorPoller { } } else { DEBUG_ASSERT(slice_capability_.type == MIIterator::SliceCapability::Type::kFixed); - pack_iter.reset(new MIStepIterator(cur_pos_, stonedb_sysvar_async_join_setting.pack_per_step, *miter_)); + pack_iter.reset(new MIStepIterator(cur_pos_, tianmu_sysvar_async_join_setting.pack_per_step, *miter_)); } // Get next pack. @@ -414,8 +414,8 @@ class ProxyHashJoiner::Action { // Create hash tables. int hash_table_count = base::smp::count - 1; // Don't occupy the base main thread. - if (stonedb_sysvar_async_join_setting.traverse_slices > 0) - hash_table_count = std::min(hash_table_count, stonedb_sysvar_async_join_setting.traverse_slices); + if (tianmu_sysvar_async_join_setting.traverse_slices > 0) + hash_table_count = std::min(hash_table_count, tianmu_sysvar_async_join_setting.traverse_slices); HashTable::CreateParams hash_table_create_params; hash_table_create_params.keys_length = std::move(hash_table_key_size); hash_table_create_params.tuples_length = std::move(hash_table_tuple_size); @@ -423,7 +423,7 @@ class ProxyHashJoiner::Action { hash_table_create_params.easy_roughable = false; tables_manager_.reset(JoinThreadTableManager::CreateSharedTableManager( pack_power_, hash_table_count, hash_table_create_params, std::move(column_encoder), watch_traversed_, - force_switching_sides_ || stonedb_sysvar_join_disable_switch_side)); + force_switching_sides_ || tianmu_sysvar_join_disable_switch_side)); } template @@ -748,8 +748,8 @@ class ProxyHashJoiner::Action { base::future<> MatchDim(int64_t wait_matched_rows) { size_t slice_count = base::smp::count - 1; // Don't occupy the base main thread. - if (stonedb_sysvar_async_join_setting.match_slices > 0) - slice_count = std::min(slice_count, stonedb_sysvar_async_join_setting.match_slices); + if (tianmu_sysvar_async_join_setting.match_slices > 0) + slice_count = std::min(slice_count, tianmu_sysvar_async_join_setting.match_slices); std::shared_ptr miter(new MIIterator(mind_, matched_dims_)); std::shared_ptr miter_poller(new MIIteratorPoller(miter)); @@ -894,4 +894,4 @@ void ProxyHashJoiner::ExecuteJoinConditions(Condition &cond) { } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/proxy_hash_joiner.h b/storage/tianmu/core/proxy_hash_joiner.h similarity index 88% rename from storage/stonedb/core/proxy_hash_joiner.h rename to storage/tianmu/core/proxy_hash_joiner.h index 18e5195907..4949e94f3f 100644 --- a/storage/stonedb/core/proxy_hash_joiner.h +++ b/storage/tianmu/core/proxy_hash_joiner.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_PROXY_HASH_JOINER_H_ -#define STONEDB_CORE_PROXY_HASH_JOINER_H_ +#ifndef TIANMU_CORE_PROXY_HASH_JOINER_H_ +#define TIANMU_CORE_PROXY_HASH_JOINER_H_ #pragma once #include #include "core/joiner.h" -namespace stonedb { +namespace Tianmu { namespace core { class ProxyHashJoiner : public TwoDimensionalJoiner { public: @@ -39,6 +39,6 @@ class ProxyHashJoiner : public TwoDimensionalJoiner { bool force_switching_sides_ = false; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_PROXY_HASH_JOINER_H_ \ No newline at end of file +#endif // TIANMU_CORE_PROXY_HASH_JOINER_H_ \ No newline at end of file diff --git a/storage/stonedb/core/query.cpp b/storage/tianmu/core/query.cpp similarity index 98% rename from storage/stonedb/core/query.cpp rename to storage/tianmu/core/query.cpp index 37edfc7e06..4810d3c727 100644 --- a/storage/stonedb/core/query.cpp +++ b/storage/tianmu/core/query.cpp @@ -36,7 +36,7 @@ #include "vc/subselect_column.h" #include "vc/type_cast_column.h" -namespace stonedb { +namespace Tianmu { namespace core { Query::~Query() { for (auto it : gc_expressions) delete it; @@ -126,8 +126,8 @@ bool Query::HasAggregation(Item *item) { List_iterator_fast li(*args); Item *item; while (!has && (item = li++)) has = HasAggregation(item); - } else if (i->type() == Item_sdbfield::get_sdbitem_type()) - if (static_cast(i)->IsAggregation()) has = true; + } else if (i->type() == Item_tianmufield::get_tianmuitem_type()) + if (static_cast(i)->IsAggregation()) has = true; return has; } @@ -183,7 +183,7 @@ std::pair Query::VirtualColumnAlreadyExists(const TabID &tmp_table, co } bool Query::IsFieldItem(Item *item) { - return (item->type() == Item::FIELD_ITEM || item->type() == Item_sdbfield::get_sdbitem_type()); + return (item->type() == Item::FIELD_ITEM || item->type() == Item_tianmufield::get_tianmuitem_type()); } bool Query::IsAggregationOverFieldItem(Item *item) { @@ -258,11 +258,11 @@ const std::string Query::GetItemName(Item *item) { return "REAL"; case Item::DECIMAL_ITEM: return "DECIMAL"; - case static_cast(Item_sdbfield::enumSDBFiledItem::SDBFIELD_ITEM): - Item_sdbfield *sdb = static_cast(item); - size_t cur_var_id = sdbitems_cur_var_ids[sdb]++; - if (cur_var_id >= sdb->varID.size()) cur_var_id = 0; - std::sprintf(buf, "SDB_FIELD(T:%d,A:%d)", sdb->varID[cur_var_id].tab, sdb->varID[cur_var_id].col); + case static_cast(Item_tianmufield::enumTIANMUFiledItem::TIANMUFIELD_ITEM): + Item_tianmufield *tianmu = static_cast(item); + size_t cur_var_id = tianmuitems_cur_var_ids[tianmu]++; + if (cur_var_id >= tianmu->varID.size()) cur_var_id = 0; + std::sprintf(buf, "TIANMU_FIELD(T:%d,A:%d)", tianmu->varID[cur_var_id].tab, tianmu->varID[cur_var_id].col); return buf; } return "UNKNOWN"; @@ -467,7 +467,7 @@ vcolumn::VirtualColumn *Query::CreateColumnFromExpression(std::vectorIsDeterministic()) { if (IsFieldItem(exprs[0]->GetItem())) { // a special case when a naked column is a parameter - // without this column type would be a seen by mysql, not STONEDB. + // without this column type would be a seen by mysql, not TIANMU. // e.g. timestamp would be string 19 TabID tab; AttrID col; @@ -525,7 +525,7 @@ bool Query::IsParameterFromWhere(const TabID ¶ms_table) { const char *Query::GetTableName(Item_field *ifield) { const char *table_name = NULL; - if (ifield->cached_table && !ifield->cached_table->is_view() && !ifield->cached_table->is_view_or_derived())//STONEDB UPGRADE + if (ifield->cached_table && !ifield->cached_table->is_view() && !ifield->cached_table->is_view_or_derived())//TIANMU UPGRADE if (ifield->cached_table->referencing_view) table_name = ifield->cached_table->referencing_view->table_name; else @@ -558,7 +558,7 @@ void Query::GetPrecisionScale(Item *item, int &precision, int &scale, bool max_s } TempTable *Query::Preexecute(CompiledQuery &qu, ResultSender *sender, [[maybe_unused]] bool display_now) { - if (STONEDB_LOGCHECK(LogCtl_Level::DEBUG)) { + if (TIANMU_LOGCHECK(LogCtl_Level::DEBUG)) { qu.Print(this); } std::vector conds(qu.NumOfConds()); @@ -1029,9 +1029,9 @@ int Query::Item2CQTerm(Item *an_arg, CQTerm &term, const TabID &tmp_table, CondT tab_id2expression.insert(std::make_pair(tmp_table, std::make_pair(vc.n, expr))); } } else if (IsAggregationItem(an_arg)) { - DEBUG_ASSERT(expr->GetItem()->type() == Item_sdbfield::get_sdbitem_type()); + DEBUG_ASSERT(expr->GetItem()->type() == Item_tianmufield::get_tianmuitem_type()); int col_num = - ((Item_sdbfield *)expr->GetItem())->varID[((Item_sdbfield *)expr->GetItem())->varID.size() - 1].col; + ((Item_tianmufield *)expr->GetItem())->varID[((Item_tianmufield *)expr->GetItem())->varID.size() - 1].col; auto phys_vc = VirtualColumnAlreadyExists(tmp_table, tmp_table, AttrID(-col_num - 1)); if (phys_vc.first == common::NULL_VALUE_32) { phys_vc.first = tmp_table.n; @@ -1821,4 +1821,4 @@ int Query::BuildCondsIfPossible(Item *conds, CondID &cond_id, const TabID &tmp_t return RCBASE_QUERY_ROUTE; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/query.h b/storage/tianmu/core/query.h similarity index 96% rename from storage/stonedb/core/query.h rename to storage/tianmu/core/query.h index a113977bfa..8ef6db85bb 100644 --- a/storage/stonedb/core/query.h +++ b/storage/tianmu/core/query.h @@ -14,16 +14,16 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_QUERY_H_ -#define STONEDB_CORE_QUERY_H_ +#ifndef TIANMU_CORE_QUERY_H_ +#define TIANMU_CORE_QUERY_H_ #pragma once #include "core/column_type.h" -#include "core/item_sdbfield.h" +#include "core/item_tianmu_field.h" #include "core/joiner.h" #include "core/mysql_expression.h" -namespace stonedb { +namespace Tianmu { namespace core { #define RETURN_QUERY_TO_MYSQL_ROUTE 0 #define RCBASE_QUERY_ROUTE 1 @@ -83,7 +83,7 @@ class Query final { std::vector gc_expressions; std::multimap, std::pair> phys2virt; std::multimap> tab_id2subselect; - std::map sdbitems_cur_var_ids; + std::map tianmuitems_cur_var_ids; std::vector> ta; // table aliases - sometimes point to TempTables (maybe to the // same one), sometimes to RCTables @@ -270,7 +270,7 @@ class Query final { /*! \brief Creates MysqlExpression object that wraps expression tree of MySQL * not containing aggregations. All Item_field items are substituted with - * Item_sdbfield items \param item - root of MySQL expression tree to be + * Item_tianmufield items \param item - root of MySQL expression tree to be * wrapped \param tmp_table - alias of TempTable which is checked if it * contains aggregation fields (should not) \param expr - expression to store * the result tree \param in_aggregation - the expression is used in WHERE @@ -286,12 +286,12 @@ class Query final { // /*! \brief Creates MysqlExpression object that wraps full expression // tree of MySQL. All // Item_field items are - // * substituted with Item_sdbfield items. In case of aggregation it is + // * substituted with Item_tianmufield items. In case of aggregation it is // substituted with its // whole subtree by a single - // * Item_sdbfield, however, there is an AddColumn step added to + // * Item_tianmufield, however, there is an AddColumn step added to // compilation with this - // aggregation and Item_sdbfield refers to the + // aggregation and Item_tianmufield refers to the // * column created by this step. // * \param item - root of MySQL expression tree to be wrapped // * \param tmp_table - alias of TempTable to which AddColumn is added in @@ -371,6 +371,6 @@ class Query final { bool IsParameterFromWhere(const TabID ¶ms_table); }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_QUERY_H_ +#endif // TIANMU_CORE_QUERY_H_ diff --git a/storage/stonedb/core/query_compile.cpp b/storage/tianmu/core/query_compile.cpp similarity index 95% rename from storage/stonedb/core/query_compile.cpp rename to storage/tianmu/core/query_compile.cpp index 25b2a6acc6..20ec6e512e 100644 --- a/storage/stonedb/core/query_compile.cpp +++ b/storage/tianmu/core/query_compile.cpp @@ -25,7 +25,7 @@ #include "core/query.h" #include "core/transaction.h" -namespace stonedb { +namespace Tianmu { namespace core { int TableUnmysterify(TABLE_LIST *tab, const char *&database_name, const char *&table_name, const char *&table_alias, const char *&table_path) { @@ -51,24 +51,24 @@ int JudgeErrors(SELECT_LEX *sl) { /* gone with mysql5.6 if(sl->join && sl->join->procedure) { - my_message(ER_SYNTAX_ERROR, "StoneDB specific error: No PROCEDURE + my_message(ER_SYNTAX_ERROR, "Tianmu specific error: No PROCEDURE syntax supported", MYF(0)); throw ReturnMeToMySQLWithError(); } */ if (sl->offset_limit) if (sl->offset_limit->type() != Item::INT_ITEM /*|| sl->offset_limit->val_int()*/) { - my_message(ER_SYNTAX_ERROR, "StoneDB specific error: Only numerical OFFSET supported", MYF(0)); + my_message(ER_SYNTAX_ERROR, "Tianmu specific error: Only numerical OFFSET supported", MYF(0)); throw ReturnMeToMySQLWithError(); } if (sl->select_limit) if (sl->select_limit->type() != Item::INT_ITEM) { - my_message(ER_SYNTAX_ERROR, "StoneDB specific error: Only numerical LIMIT supported", MYF(0)); + my_message(ER_SYNTAX_ERROR, "Tianmu specific error: Only numerical LIMIT supported", MYF(0)); throw ReturnMeToMySQLWithError(); } if (sl->olap == ROLLUP_TYPE) { - /*my_message(ER_SYNTAX_ERROR, "StoneDB specific error: WITH ROLLUP not + /*my_message(ER_SYNTAX_ERROR, "Tianmu specific error: WITH ROLLUP not supported", MYF(0)); throw ReturnMeToMySQLWithError();*/ return RETURN_QUERY_TO_MYSQL_ROUTE; } @@ -110,16 +110,16 @@ int Query::FieldUnmysterify(Item *item, const char *&database_name, const char * Item_field *ifield; switch (static_cast(item->type())) { - case static_cast(Item_sdbfield::enumSDBFiledItem::SDBFIELD_ITEM): - ifield = dynamic_cast(item)->OriginalItem(); + case static_cast(Item_tianmufield::enumTIANMUFiledItem::TIANMUFIELD_ITEM): + ifield = dynamic_cast(item)->OriginalItem(); if (IsAggregationItem(ifield)) { Item_sum *is = (Item_sum *)ifield; if (is->get_arg_count() > 1) return RETURN_QUERY_TO_MYSQL_ROUTE; Item *tmp_item = UnRef(is->get_arg(0)); if (tmp_item->type() == Item::FIELD_ITEM) ifield = (Item_field *)tmp_item; - else if (static_cast(tmp_item->type()) == static_cast(Item_sdbfield::enumSDBFiledItem::SDBFIELD_ITEM)) - ifield = dynamic_cast(tmp_item)->OriginalItem(); + else if (static_cast(tmp_item->type()) == static_cast(Item_tianmufield::enumTIANMUFiledItem::TIANMUFIELD_ITEM)) + ifield = dynamic_cast(tmp_item)->OriginalItem(); else { return RETURN_QUERY_TO_MYSQL_ROUTE; } @@ -138,10 +138,10 @@ int Query::FieldUnmysterify(Item *item, const char *&database_name, const char * if (tmp_item->type() == Item::FIELD_ITEM) ifield = (Item_field *)tmp_item; else if (static_cast(tmp_item->type()) == - static_cast(Item_sdbfield::enumSDBFiledItem::SDBFIELD_ITEM)) /* *CAUTION* comparision of + static_cast(Item_tianmufield::enumTIANMUFiledItem::TIANMUFIELD_ITEM)) /* *CAUTION* comparision of enumerators from different enums */ - ifield = dynamic_cast(tmp_item)->OriginalItem(); + ifield = dynamic_cast(tmp_item)->OriginalItem(); else return RETURN_QUERY_TO_MYSQL_ROUTE; break; @@ -202,20 +202,20 @@ int Query::FieldUnmysterify(Item *item, const char *&database_name, const char * bool Query::FieldUnmysterify(Item *item, TabID &tab, AttrID &col) { Item_field *ifield; - if (item->type() == Item_sdbfield::get_sdbitem_type()) { - ifield = dynamic_cast(item)->OriginalItem(); + if (item->type() == Item_tianmufield::get_tianmuitem_type()) { + ifield = dynamic_cast(item)->OriginalItem(); if (IsAggregationItem(ifield)) { Item_sum *is = (Item_sum *)ifield; if (is->get_arg_count() > 1) return RETURN_QUERY_TO_MYSQL_ROUTE; Item *tmp_item = UnRef(is->get_arg(0)); if (tmp_item->type() == Item::FIELD_ITEM) ifield = (Item_field *)tmp_item; - else if (tmp_item->type() == Item_sdbfield::get_sdbitem_type()) - ifield = dynamic_cast(tmp_item)->OriginalItem(); + else if (tmp_item->type() == Item_tianmufield::get_tianmuitem_type()) + ifield = dynamic_cast(tmp_item)->OriginalItem(); else if (tmp_item->type() == Item::FUNC_ITEM) { - Item_sdbfield *sdbi = dynamic_cast(item); - tab.n = sdbi->varID[0].tab; - col.n = sdbi->varID[0].tab; + Item_tianmufield *tianmui = dynamic_cast(item); + tab.n = tianmui->varID[0].tab; + col.n = tianmui->varID[0].tab; return true; } else return false; @@ -229,15 +229,15 @@ bool Query::FieldUnmysterify(Item *item, TabID &tab, AttrID &col) { dir = ((Item_func_group_concat *)item)->direction(); } - // only pass 1 group 1 order by case, which is the only case StoneDB + // only pass 1 group 1 order by case, which is the only case Tianmu // supported if (dir == 0 || is->get_arg_count() != 2) return false; } Item *tmp_item = UnRef(is->get_arg(0)); if (tmp_item->type() == Item::FIELD_ITEM) ifield = (Item_field *)tmp_item; - else if (tmp_item->type() == Item_sdbfield::get_sdbitem_type()) - ifield = dynamic_cast(tmp_item)->OriginalItem(); + else if (tmp_item->type() == Item_tianmufield::get_tianmuitem_type()) + ifield = dynamic_cast(tmp_item)->OriginalItem(); else return false; } else if (item->type() == Item::FIELD_ITEM) @@ -414,9 +414,9 @@ int Query::AddFields(List &fields, TabID const &tmp_table, bool const grou item = UnRef(item); continue; } - // if ((UnRef(item)->type() == Item_sdbfield::enumSDBFiledItem::SDBFIELD_ITEM + // if ((UnRef(item)->type() == Item_tianmufield::enumTIANMUFiledItem::TIANMUFIELD_ITEM //|| - // UnRef(item)->type() == Item_sdbfield::FIELD_ITEM ) && + // UnRef(item)->type() == Item_tianmufield::FIELD_ITEM ) && // IsLocalColumn(UnRef(item), tmp_table) //) // AddColumnForPhysColumn(UnRef(item), tmp_table, @@ -426,8 +426,8 @@ int Query::AddFields(List &fields, TabID const &tmp_table, bool const grou // // // } else if (IsAggregationItem(item) && (((Item_sum *)item)->get_arg(0))->type() == Item::REF_ITEM && - (UnRef(((Item_sum *)item)->get_arg(0))->type() == Item_sdbfield::get_sdbitem_type() || - (UnRef(((Item_sum *)item)->get_arg(0))->type() == Item_sdbfield::FIELD_ITEM)) && + (UnRef(((Item_sum *)item)->get_arg(0))->type() == Item_tianmufield::get_tianmuitem_type() || + (UnRef(((Item_sum *)item)->get_arg(0))->type() == Item_tianmufield::FIELD_ITEM)) && IsLocalColumn(UnRef(((Item_sum *)item)->get_arg(0)), tmp_table)) // AGGR on REF to FIELD_ITEM AddColumnForPhysColumn(UnRef(((Item_sum *)item)->get_arg(0)), tmp_table, oper, distinct, false, @@ -487,7 +487,7 @@ int Query::AddGroupByFields(ORDER *group_by, const TabID &tmp_table) { for (; group_by; group_by = group_by->next) { if (group_by->direction != ORDER::ORDER_ASC) { my_message(ER_SYNTAX_ERROR, - "StoneDB specific error: Using DESC after GROUP BY clause not " + "Tianmu specific error: Using DESC after GROUP BY clause not " "allowed. Use " "ORDER BY to order the result", MYF(0)); @@ -655,7 +655,7 @@ Query::WrapStatus Query::WrapMysqlExpression(Item *item, const TabID &tmp_table, } AttrID col, at; TabID tab; - // find [tab] and [col] which identify column in SDB + // find [tab] and [col] which identify column in TIANMU if (!FieldUnmysterify(it, tab, col)) return WrapStatus::FAILURE; if (!cq->ExistsInTempTable(tab, tmp_table)) { bool is_group_by; @@ -747,9 +747,9 @@ int Query::AddColumnForPhysColumn(Item *item, const TabID &tmp_table, const comm // temp_table DEBUG_ASSERT(cq->ExistsInTempTable(tab, tmp_table)); - if (item->type() == Item_sdbfield::get_sdbitem_type() && - IsAggregationItem(dynamic_cast(item)->OriginalItem())) - return ((Item_sdbfield *)item)->varID[0].col; + if (item->type() == Item_tianmufield::get_tianmuitem_type() && + IsAggregationItem(dynamic_cast(item)->OriginalItem())) + return ((Item_tianmufield *)item)->varID[0].col; vc = VirtualColumnAlreadyExists(tmp_table, tab, col); if (vc.first == common::NULL_VALUE_32) { @@ -983,12 +983,12 @@ int Query::Compile(CompiledQuery *compiled_query, SELECT_LEX *selects_list, SELE TABLE_LIST *tables = sl->leaf_tables ? sl->leaf_tables : (TABLE_LIST *)sl->table_list.first; for (TABLE_LIST *table_ptr = tables; table_ptr; table_ptr = table_ptr->next_leaf) { if (!table_ptr->is_view_or_derived()) { - if (!Engine::IsSDBTable(table_ptr->table)) throw CompilationError(); + if (!Engine::IsTIANMUTable(table_ptr->table)) throw CompilationError(); std::string path = TablePath(table_ptr); if (path2num.find(path) == path2num.end()) { path2num[path] = NumOfTabs(); AddTable(m_conn->GetTableByPath(path)); - STONEDB_LOG(LogCtl_Level::DEBUG, "add query table: %s", path.c_str()); + TIANMU_LOG(LogCtl_Level::DEBUG, "add query table: %s", path.c_str()); } } } @@ -1088,4 +1088,4 @@ bool Query::IsLOJ(List *join) { return false; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/query_operator.h b/storage/tianmu/core/query_operator.h similarity index 93% rename from storage/stonedb/core/query_operator.h rename to storage/tianmu/core/query_operator.h index cc3b599d74..37fffcfcbf 100644 --- a/storage/stonedb/core/query_operator.h +++ b/storage/tianmu/core/query_operator.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_QUERY_OPERATOR_H_ -#define STONEDB_CORE_QUERY_OPERATOR_H_ +#ifndef TIANMU_CORE_QUERY_OPERATOR_H_ +#define TIANMU_CORE_QUERY_OPERATOR_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace core { /** The base object representation of a Query common::Operator. @@ -59,6 +59,6 @@ class QueryOperator { std::string string_rep; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_QUERY_OPERATOR_H_ +#endif // TIANMU_CORE_QUERY_OPERATOR_H_ diff --git a/storage/stonedb/core/quick_math.cpp b/storage/tianmu/core/quick_math.cpp similarity index 97% rename from storage/stonedb/core/quick_math.cpp rename to storage/tianmu/core/quick_math.cpp index 2173230982..a6fabbf788 100644 --- a/storage/stonedb/core/quick_math.cpp +++ b/storage/tianmu/core/quick_math.cpp @@ -17,7 +17,7 @@ #include "quick_math.h" -namespace stonedb { +namespace Tianmu { namespace core { const double QuickMath::logof2 = log(2.0); double QuickMath::tab_nlog2n[QuickMath::MAX_NLOG2N + 1]; @@ -46,4 +46,4 @@ uint QuickMath::precision10(uint64_t n) { QuickMath ___math___(1); // force initialization of static members } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/quick_math.h b/storage/tianmu/core/quick_math.h similarity index 94% rename from storage/stonedb/core/quick_math.h rename to storage/tianmu/core/quick_math.h index f0574ea702..2582631b58 100644 --- a/storage/stonedb/core/quick_math.h +++ b/storage/tianmu/core/quick_math.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_QUICK_MATH_H_ -#define STONEDB_CORE_QUICK_MATH_H_ +#ifndef TIANMU_CORE_QUICK_MATH_H_ +#define TIANMU_CORE_QUICK_MATH_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "common/common_definitions.h" #include "core/bin_tools.h" -namespace stonedb { +namespace Tianmu { namespace core { // Precomputed values of some mathematical formulas, used to speed up // computations @@ -78,6 +78,6 @@ class QuickMath { static uint precision2(uint64_t n) { return GetBitLen(n); } }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_QUICK_MATH_H_ +#endif // TIANMU_CORE_QUICK_MATH_H_ diff --git a/storage/stonedb/core/rc_attr.cpp b/storage/tianmu/core/rc_attr.cpp similarity index 96% rename from storage/stonedb/core/rc_attr.cpp rename to storage/tianmu/core/rc_attr.cpp index 893ab186f2..bf3b754bb6 100644 --- a/storage/stonedb/core/rc_attr.cpp +++ b/storage/tianmu/core/rc_attr.cpp @@ -32,12 +32,12 @@ #include "loader/load_parser.h" #include "loader/value_cache.h" #include "system/fet.h" -#include "system/stonedb_file.h" +#include "system/tianmu_file.h" #include "types/rc_data_types.h" #include "util/fs.h" #include "util/log_ctl.h" -namespace stonedb { +namespace Tianmu { namespace core { RCAttr::RCAttr(Transaction *tx, common::TX_ID xid, int a_num, int t_num, ColumnShare *share) : m_version(xid), m_tx(tx), m_tid(t_num), m_cid(a_num), m_share(share) { @@ -62,7 +62,7 @@ RCAttr::RCAttr(Transaction *tx, common::TX_ID xid, int a_num, int t_num, ColumnS case FilterType::BLOOM: return std::make_shared(Path() / common::COL_FILTER_DIR, v); default: - STONEDB_ERROR("bad type"); + TIANMU_ERROR("bad type"); } }; } @@ -82,7 +82,7 @@ void RCAttr::Create(const fs::path &dir, const AttributeTypeInfo &ati, uint8_t p ati.Scale(), // scale }; - system::StoneDBFile fmeta; + system::TianmuFile fmeta; fmeta.OpenCreateEmpty(dir / common::COL_META_FILE); fmeta.WriteExact(&meta, sizeof(meta)); fmeta.Flush(); @@ -114,7 +114,7 @@ void RCAttr::Create(const fs::path &dir, const AttributeTypeInfo &ati, uint8_t p // create version directory fs::create_directory(dir / common::COL_VERSION_DIR); - system::StoneDBFile fattr; + system::TianmuFile fattr; fattr.OpenCreateEmpty(dir / common::COL_VERSION_DIR / common::TX_ID(0).ToString()); fattr.WriteExact(&hdr, sizeof(hdr)); @@ -132,7 +132,7 @@ void RCAttr::Create(const fs::path &dir, const AttributeTypeInfo &ati, uint8_t p dpn.xmax = common::MAX_XID; dpn.addr = DPN_INVALID_ADDR; - system::StoneDBFile fdn; + system::TianmuFile fdn; fdn.OpenCreateEmpty(dir / common::COL_DN_FILE); for (common::PACK_INDEX i = 0; i < no_pack - 1; i++) fdn.WriteExact(&dpn, sizeof(dpn)); @@ -156,7 +156,7 @@ void RCAttr::Create(const fs::path &dir, const AttributeTypeInfo &ati, uint8_t p void RCAttr::LoadVersion(common::TX_ID xid) { auto fname = Path() / common::COL_VERSION_DIR / xid.ToString(); - system::StoneDBFile fattr; + system::TianmuFile fattr; fattr.OpenReadOnly(fname); fattr.ReadExact(&hdr, sizeof(hdr)); @@ -301,12 +301,12 @@ bool RCAttr::SaveVersion() { } auto fname = Path() / common::COL_VERSION_DIR / m_tx->GetID().ToString(); - system::StoneDBFile fattr; + system::TianmuFile fattr; fattr.OpenCreate(fname); fattr.WriteExact(&hdr, sizeof(hdr)); fattr.WriteExact(&m_idx[0], sizeof(decltype(m_idx)::value_type) * hdr.np); - if (stonedb_sysvar_sync_buffers) fattr.Flush(); + if (tianmu_sysvar_sync_buffers) fattr.Flush(); return true; } @@ -612,8 +612,8 @@ types::BString RCAttr::DecodeValue_S(int64_t code) { // 1-level code value for a given 0-level (text) value // if new_val, then add to dictionary if not present -int RCAttr::EncodeValue_T(const types::BString &rcbs, bool new_val, common::ErrorCode *sdbrc) { - if (sdbrc) *sdbrc = common::ErrorCode::SUCCESS; +int RCAttr::EncodeValue_T(const types::BString &rcbs, bool new_val, common::ErrorCode *tianmu_rc) { + if (tianmu_rc) *tianmu_rc = common::ErrorCode::SUCCESS; if (rcbs.IsNull()) return common::NULL_VALUE_32; if (ATI::IsStringType(TypeName())) { DEBUG_ASSERT(GetPackType() == common::PackType::INT); @@ -644,8 +644,8 @@ int RCAttr::EncodeValue_T(const types::BString &rcbs, bool new_val, common::Erro ASSERT(0, "Wrong data type!"); } else { types::RCNum rcn; - common::ErrorCode tmp_sdbrc = types::RCNum::Parse(rcbs, rcn, TypeName()); - if (sdbrc) *sdbrc = tmp_sdbrc; + common::ErrorCode tmp_tianmu_rc = types::RCNum::Parse(rcbs, rcn, TypeName()); + if (tianmu_rc) *tianmu_rc = tmp_tianmu_rc; return (int)(int64_t)rcn; } return common::NULL_VALUE_32; @@ -654,13 +654,13 @@ int RCAttr::EncodeValue_T(const types::BString &rcbs, bool new_val, common::Erro // transform a types::RCNum value into 1-level code, take into account // the precision etc. no changes for REAL; rounded=true iff v has greater // precision than the column and the returned result is rounded down -int64_t RCAttr::EncodeValue64(types::RCDataType *v, bool &rounded, common::ErrorCode *sdbrc) { +int64_t RCAttr::EncodeValue64(types::RCDataType *v, bool &rounded, common::ErrorCode *tianmu_rc) { rounded = false; - if (sdbrc) *sdbrc = common::ErrorCode::SUCCESS; + if (tianmu_rc) *tianmu_rc = common::ErrorCode::SUCCESS; if (!v || v->IsNull()) return common::NULL_VALUE_64; if ((Type().IsLookup() && v->Type() != common::CT::NUM)) { - return EncodeValue_T(v->ToBString(), false, sdbrc); + return EncodeValue_T(v->ToBString(), false, tianmu_rc); } else if (ATI::IsDateTimeType(TypeName()) || ATI::IsDateTimeNType(TypeName())) { return ((types::RCDateTime *)v)->GetInt64(); } @@ -701,8 +701,8 @@ int64_t RCAttr::EncodeValue64(types::RCDataType *v, bool &rounded, common::Error return vv; } -int64_t RCAttr::EncodeValue64(const types::RCValueObject &v, bool &rounded, common::ErrorCode *sdbrc) { - return EncodeValue64(v.Get(), rounded, sdbrc); +int64_t RCAttr::EncodeValue64(const types::RCValueObject &v, bool &rounded, common::ErrorCode *tianmu_rc) { + return EncodeValue64(v.Get(), rounded, tianmu_rc); } size_t RCAttr::GetPrefixLength(int pack) { @@ -737,11 +737,11 @@ void RCAttr::LockPackForUse(common::PACK_INDEX pn) { sp = rceng->cache.GetOrFetchObject(get_pc(pn), this); } catch (std::exception &e) { dpn->SetPackPtr(0); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); throw e; } catch (...) { dpn->SetPackPtr(0); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); throw; } @@ -1173,7 +1173,7 @@ Pack *RCAttr::get_pack(size_t i) { return reinterpret_cast(get_dpn(i).Ge Pack *RCAttr::get_pack(size_t i) const { return reinterpret_cast(get_dpn(i).GetPackPtr() & tag_mask); } std::shared_ptr RCAttr::GetFilter_Hist() { - if (!stonedb_sysvar_enable_histogram_cmap_bloom) { + if (!tianmu_sysvar_enable_histogram_cmap_bloom) { return nullptr; } @@ -1190,7 +1190,7 @@ std::shared_ptr RCAttr::GetFilter_Hist() { } std::shared_ptr RCAttr::GetFilter_CMap() { - if (!stonedb_sysvar_enable_histogram_cmap_bloom) { + if (!tianmu_sysvar_enable_histogram_cmap_bloom) { return nullptr; } @@ -1205,7 +1205,7 @@ std::shared_ptr RCAttr::GetFilter_CMap() { } std::shared_ptr RCAttr::GetFilter_Bloom() { - if (!stonedb_sysvar_enable_histogram_cmap_bloom) { + if (!tianmu_sysvar_enable_histogram_cmap_bloom) { return nullptr; } @@ -1236,7 +1236,7 @@ void RCAttr::UpdateIfIndex(uint64_t row, uint64_t col, const Value &v) { std::string_view okey(vold.val, vold.size()); common::ErrorCode rc = tab->UpdateIndex(current_tx, nkey, okey, row); if (rc == common::ErrorCode::DUPP_KEY || rc == common::ErrorCode::FAILED) { - STONEDB_LOG(LogCtl_Level::DEBUG, "Duplicate entry: %s for primary key", vnew.data()); + TIANMU_LOG(LogCtl_Level::DEBUG, "Duplicate entry: %s for primary key", vnew.data()); throw common::DupKeyException("Duplicate entry: " + vnew + " for primary key"); } } else { // common::PackType::INT @@ -1246,10 +1246,10 @@ void RCAttr::UpdateIfIndex(uint64_t row, uint64_t col, const Value &v) { std::string_view okey(reinterpret_cast(&vold), sizeof(int64_t)); common::ErrorCode rc = tab->UpdateIndex(current_tx, nkey, okey, row); if (rc == common::ErrorCode::DUPP_KEY || rc == common::ErrorCode::FAILED) { - STONEDB_LOG(LogCtl_Level::DEBUG, "Duplicate entry :%" PRId64 " for primary key", vnew); + TIANMU_LOG(LogCtl_Level::DEBUG, "Duplicate entry :%" PRId64 " for primary key", vnew); throw common::DupKeyException("Duplicate entry: " + std::to_string(vnew) + " for primary key"); } } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/rc_attr.h b/storage/tianmu/core/rc_attr.h similarity index 98% rename from storage/stonedb/core/rc_attr.h rename to storage/tianmu/core/rc_attr.h index 5db30275d4..407a091b94 100644 --- a/storage/stonedb/core/rc_attr.h +++ b/storage/tianmu/core/rc_attr.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_RC_ATTR_H_ -#define STONEDB_CORE_RC_ATTR_H_ +#ifndef TIANMU_CORE_RC_ATTR_H_ +#define TIANMU_CORE_RC_ATTR_H_ #pragma once #include @@ -42,7 +42,7 @@ #include "types/rc_num.h" #include "util/fs.h" -namespace stonedb { +namespace Tianmu { namespace core { class Transaction; class Filter; @@ -237,12 +237,12 @@ class RCAttr final : public mm::TraceableObject, public PhysicalColumn, public P int EncodeValue_S(types::BString &v) override { return EncodeValue_T(v); } // 1-level code value for a given 0-level (text) value, if new_val then add to // dictionary if not present - int EncodeValue_T(const types::BString &rcbs, bool new_val = false, common::ErrorCode *sdbrc = 0); + int EncodeValue_T(const types::BString &rcbs, bool new_val = false, common::ErrorCode *tianmu_rc = 0); // no changes for REAL; rounded=true iff v has greater precision than the // column and the returned result is rounded down int64_t EncodeValue64(types::RCDataType *v, bool &rounded, - common::ErrorCode *sdbrc = 0); // as above - int64_t EncodeValue64(const types::RCValueObject &v, bool &rounded, common::ErrorCode *sdbrc = 0); + common::ErrorCode *tianmu_rc = 0); // as above + int64_t EncodeValue64(const types::RCValueObject &v, bool &rounded, common::ErrorCode *tianmu_rc = 0); // Query execution void EvaluatePack(MIUpdatingIterator &mit, int dim, Descriptor &desc) override; @@ -390,6 +390,6 @@ class RCAttr final : public mm::TraceableObject, public PhysicalColumn, public P std::function(const FilterCoordinate &co)> filter_creator; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_RC_ATTR_H_ +#endif // TIANMU_CORE_RC_ATTR_H_ diff --git a/storage/stonedb/core/rc_attr_typeinfo.cpp b/storage/tianmu/core/rc_attr_typeinfo.cpp similarity index 97% rename from storage/stonedb/core/rc_attr_typeinfo.cpp rename to storage/tianmu/core/rc_attr_typeinfo.cpp index 93f78eb2cc..6ac13cfef2 100644 --- a/storage/stonedb/core/rc_attr_typeinfo.cpp +++ b/storage/tianmu/core/rc_attr_typeinfo.cpp @@ -22,7 +22,7 @@ #include "types/rc_data_types.h" #include "types/rc_num.h" -namespace stonedb { +namespace Tianmu { namespace core { int ATI::TextSize(common::CT attrt, uint precision, int scale, DTCollation collation) { return common::TxtDataFormat::StaticExtrnalSize(attrt, precision, scale, &collation); @@ -35,4 +35,4 @@ const types::RCDataType &AttributeTypeInfo::ValuePrototype() const { return types::RCDateTime::NullValue(); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/rc_attr_typeinfo.h b/storage/tianmu/core/rc_attr_typeinfo.h similarity index 96% rename from storage/stonedb/core/rc_attr_typeinfo.h rename to storage/tianmu/core/rc_attr_typeinfo.h index 8c1e9ae608..6a29b2c385 100644 --- a/storage/stonedb/core/rc_attr_typeinfo.h +++ b/storage/tianmu/core/rc_attr_typeinfo.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_RC_ATTR_TYPEINFO_H_ -#define STONEDB_CORE_RC_ATTR_TYPEINFO_H_ +#ifndef TIANMU_CORE_RC_ATTR_TYPEINFO_H_ +#define TIANMU_CORE_RC_ATTR_TYPEINFO_H_ #pragma once #include #include "common/common_definitions.h" -namespace stonedb { +namespace Tianmu { namespace types { class RCDataType; } // namespace types @@ -125,6 +125,6 @@ class AttributeTypeInfo { std::bitset::digits> flag; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_RC_ATTR_TYPEINFO_H_ +#endif // TIANMU_CORE_RC_ATTR_TYPEINFO_H_ diff --git a/storage/stonedb/core/rc_mem_table.cpp b/storage/tianmu/core/rc_mem_table.cpp similarity index 95% rename from storage/stonedb/core/rc_mem_table.cpp rename to storage/tianmu/core/rc_mem_table.cpp index 1ad443f93b..e5402fe835 100644 --- a/storage/stonedb/core/rc_mem_table.cpp +++ b/storage/tianmu/core/rc_mem_table.cpp @@ -24,7 +24,7 @@ #include "index/kv_transaction.h" #include "index/rdb_meta_manager.h" -namespace stonedb { +namespace Tianmu { namespace core { RCMemTable::RCMemTable(const std::string name, const uint32_t mem_id, const uint32_t cf_id) : fullname_(name), mem_id_(mem_id), cf_handle_(kvstore->GetCfHandleByID(cf_id)) { @@ -80,7 +80,7 @@ std::shared_ptr RCMemTable::CreateMemTable(std::shared_ptrGetNextIndexId(); tb_mem = std::make_shared(normalized_name, mem_id, cf_id); kvstore->KVWriteMemTableMeta(tb_mem); - STONEDB_LOG(LogCtl_Level::INFO, "Create RowStore: %s, CF ID: %d, RowStore ID: %u", normalized_name.c_str(), cf_id, + TIANMU_LOG(LogCtl_Level::INFO, "Create RowStore: %s, CF ID: %d, RowStore ID: %u", normalized_name.c_str(), cf_id, mem_id); return tb_mem; @@ -109,7 +109,7 @@ common::ErrorCode RCMemTable::DropMemTable(std::string table_name) { auto tb_mem = kvstore->FindMemTable(normalized_name); if (!tb_mem) return common::ErrorCode::SUCCESS; - STONEDB_LOG(LogCtl_Level::INFO, "Dropping RowStore: %s, CF ID: %d, RowStore ID: %u", normalized_name.c_str(), + TIANMU_LOG(LogCtl_Level::INFO, "Dropping RowStore: %s, CF ID: %d, RowStore ID: %u", normalized_name.c_str(), tb_mem->GetCFHandle()->GetID(), tb_mem->GetMemID()); return kvstore->KVDelMemTableMeta(normalized_name); } @@ -171,4 +171,4 @@ void RCMemTable::Truncate(Transaction *tx) { return; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/rc_mem_table.h b/storage/tianmu/core/rc_mem_table.h similarity index 93% rename from storage/stonedb/core/rc_mem_table.h rename to storage/tianmu/core/rc_mem_table.h index d6a95d949c..6e79c9e9d0 100644 --- a/storage/stonedb/core/rc_mem_table.h +++ b/storage/tianmu/core/rc_mem_table.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_RC_MEM_TABLE_H_ -#define STONEDB_CORE_RC_MEM_TABLE_H_ +#ifndef TIANMU_CORE_RC_MEM_TABLE_H_ +#define TIANMU_CORE_RC_MEM_TABLE_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "common/exception.h" -namespace stonedb { +namespace Tianmu { namespace core { class TableShare; class Transaction; @@ -63,6 +63,6 @@ class RCMemTable { rocksdb::ColumnFamilyHandle *cf_handle_ = nullptr; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_RC_MEM_TABLE_H_ +#endif // TIANMU_CORE_RC_MEM_TABLE_H_ diff --git a/storage/stonedb/core/rc_table.cpp b/storage/tianmu/core/rc_table.cpp similarity index 95% rename from storage/stonedb/core/rc_table.cpp rename to storage/tianmu/core/rc_table.cpp index 4bab663b27..d150489101 100644 --- a/storage/stonedb/core/rc_table.cpp +++ b/storage/tianmu/core/rc_table.cpp @@ -26,7 +26,7 @@ #include "core/rc_attr.h" #include "core/table_share.h" #include "core/transaction.h" -#include "handler/stonedb_handler.h" +#include "handler/tianmu_handler.h" #include "loader/load_parser.h" #include "system/channel.h" #include "system/file_system.h" @@ -39,11 +39,11 @@ #include "log_event.h" #include "core/rc_table.h" -namespace stonedb { +namespace Tianmu { namespace core { uint32_t RCTable::GetTableId(const fs::path &dir) { TABLE_META meta; - system::StoneDBFile f; + system::TianmuFile f; f.OpenReadOnly(dir / common::TABLE_DESC_FILE); f.ReadExact(&meta, sizeof(meta)); return meta.id; @@ -58,7 +58,7 @@ void RCTable::CreateNew(const std::shared_ptr &opt) { TABLE_META meta{common::FILE_MAGIC, common::TABLE_DATA_VERSION, tid, opt->pss}; - system::StoneDBFile ftbl; + system::TianmuFile ftbl; ftbl.OpenCreateEmpty(path / common::TABLE_DESC_FILE); ftbl.WriteExact(&meta, sizeof(meta)); ftbl.Flush(); @@ -88,34 +88,34 @@ void RCTable::CreateNew(const std::shared_ptr &opt) { fs::create_symlink(dir, lnk); RCAttr::Create(lnk, opt->atis[idx], opt->pss, 0); - // STONEDB_LOG(LogCtl_Level::INFO, "Column %zu at %s", idx, dir.c_str()); + // TIANMU_LOG(LogCtl_Level::INFO, "Column %zu at %s", idx, dir.c_str()); } - STONEDB_LOG(LogCtl_Level::INFO, "Create table %s, ID = %u", opt->path.c_str(), tid); + TIANMU_LOG(LogCtl_Level::INFO, "Create table %s, ID = %u", opt->path.c_str(), tid); } void RCTable::Alter(const std::string &table_path, std::vector &new_cols, std::vector &old_cols, size_t no_objs) { fs::path tmp_dir = table_path + ".tmp"; - fs::path tab_dir = table_path + common::STONEDB_EXT; + fs::path tab_dir = table_path + common::TIANMU_EXT; fs::copy(tab_dir, tmp_dir, fs::copy_options::recursive | fs::copy_options::copy_symlinks); for (auto &p : fs::directory_iterator(tmp_dir / common::COLUMN_DIR)) fs::remove(p); TABLE_META meta; - system::StoneDBFile f; + system::TianmuFile f; f.OpenReadOnly(tab_dir / common::TABLE_DESC_FILE); f.ReadExact(&meta, sizeof(meta)); meta.id = rceng->GetNextTableId(); // only table id is updated - system::StoneDBFile tempf; + system::TianmuFile tempf; tempf.OpenReadWrite(tmp_dir / common::TABLE_DESC_FILE); tempf.WriteExact(&meta, sizeof(meta)); tempf.Flush(); std::vector old_versions(old_cols.size()); { - system::StoneDBFile f; + system::TianmuFile f; f.OpenReadOnly(tab_dir / common::TABLE_VERSION_FILE); f.ReadExact(&old_versions[0], old_cols.size() * sizeof(common::TX_ID)); } @@ -142,16 +142,16 @@ void RCTable::Alter(const std::string &table_path, std::vector &new_col fs::create_directory(dir); fs::create_symlink(dir, column_dir); RCAttr::Create(column_dir, Engine::GetAttrTypeInfo(*new_cols[i]), meta.pss, no_objs); - STONEDB_LOG(LogCtl_Level::INFO, "Add column %s at %s", new_cols[i]->field_name, dir.c_str()); + TIANMU_LOG(LogCtl_Level::INFO, "Add column %s at %s", new_cols[i]->field_name, dir.c_str()); } { - system::StoneDBFile f; + system::TianmuFile f; f.OpenCreate(tmp_dir / common::TABLE_VERSION_FILE); f.WriteExact(&new_versions[0], new_cols.size() * sizeof(common::TX_ID)); f.Flush(); } fs::resize_file(tmp_dir / common::TABLE_VERSION_FILE, new_cols.size() * sizeof(common::TX_ID)); - STONEDB_LOG(LogCtl_Level::INFO, "Altered table %s", table_path.c_str()); + TIANMU_LOG(LogCtl_Level::INFO, "Altered table %s", table_path.c_str()); } void RCTable::Truncate() { @@ -173,7 +173,7 @@ RCTable::RCTable(std::string const &p, TableShare *s, Transaction *tx) : share(s ASSERT(sz == fs::file_size(fs::canonical(fs::read_symlink(m_path / common::TABLE_VERSION_FILE), m_path)), "bad version file size. expected " + std::to_string(sz)); - system::StoneDBFile f; + system::TianmuFile f; f.OpenReadOnly(m_path / common::TABLE_VERSION_FILE); f.ReadExact(&m_versions[0], sz); @@ -261,7 +261,7 @@ bool RCTable::Verify() { std::stringstream ss; ss << "Error: columns in table " << m_path.string() << " are inconsistent. No. of records for each column:\n"; for (auto &attr : m_attrs) ss << attr->NumOfAttr() << " : " << attr->NumOfObj() << std::endl; - STONEDB_LOG(LogCtl_Level::ERROR, "%s", ss.str().c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "%s", ss.str().c_str()); } return !ok; } @@ -283,10 +283,10 @@ void RCTable::CommitVersion() { } } catch (std::exception &e) { no_except = false; - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { no_except = false; - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } } if (!no_except) { @@ -296,7 +296,7 @@ void RCTable::CommitVersion() { if (changed_columns.empty()) return; auto v = common::TABLE_VERSION_PREFIX + m_tx->GetID().ToString(); - system::StoneDBFile fv; + system::TianmuFile fv; fv.OpenCreateEmpty(m_path / v); fv.WriteExact(&m_versions[0], m_versions.size() * sizeof(decltype(m_versions)::value_type)); @@ -304,27 +304,27 @@ void RCTable::CommitVersion() { fs::create_symlink(v, m_path / common::TABLE_VERSION_FILE_TMP, ec); if (ec) { if (ec == std::errc::file_exists) { - STONEDB_LOG(LogCtl_Level::WARN, "delete leftover tmp version file under %s", m_path.c_str()); + TIANMU_LOG(LogCtl_Level::WARN, "delete leftover tmp version file under %s", m_path.c_str()); fs::remove(m_path / common::TABLE_VERSION_FILE_TMP); } fs::create_symlink(v, m_path / common::TABLE_VERSION_FILE_TMP); } // flush data with disk device - if (stonedb_sysvar_sync_buffers) { + if (tianmu_sysvar_sync_buffers) { for (auto &col : changed_columns) { fs::path dir = m_path / common::COLUMN_DIR / std::to_string(col); if (fs::is_symlink(dir)) dir = fs::canonical(fs::read_symlink(dir), m_path); if (!fs::is_directory(dir)) { - STONEDB_LOG(LogCtl_Level::ERROR, "Not a directory: %s", dir.c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "Not a directory: %s", dir.c_str()); continue; } for (auto &it : fs::directory_iterator(dir)) { if (fs::is_regular_file(it.path())) { - system::StoneDBFile fb; + system::TianmuFile fb; fb.OpenReadOnly(it.path().string()); fb.Flush(); } @@ -380,7 +380,7 @@ void RCTable::PostCommit() { } void RCTable::Rollback([[maybe_unused]] common::TX_ID xid, bool) { - STONEDB_LOG(LogCtl_Level::INFO, "roll back table %s.%s", db_name.c_str(), m_path.c_str()); + TIANMU_LOG(LogCtl_Level::INFO, "roll back table %s.%s", db_name.c_str(), m_path.c_str()); for (auto &attr : m_attrs) attr->Rollback(); } @@ -415,7 +415,7 @@ void RCTable::DisplayRSI() { ss << std::endl; } ss << "-----------------------------------------------------------" << std::endl; - STONEDB_LOG(LogCtl_Level::DEBUG, "%s", ss.str().c_str()); + TIANMU_LOG(LogCtl_Level::DEBUG, "%s", ss.str().c_str()); } RCTable::Iterator::Iterator(RCTable &table, std::shared_ptr filter) @@ -554,14 +554,14 @@ void RCTable::FillRowByRowid(TABLE *table, int64_t obj) { void RCTable::LoadDataInfile(system::IOParameters &iop) { if (iop.LoadDelayed() && GetID() != iop.TableID()) { - throw common::SDBError(common::ErrorCode::DATA_ERROR, "Invalid table ID(" + std::to_string(GetID()) + "/" + + throw common::TIANMUError(common::ErrorCode::DATA_ERROR, "Invalid table ID(" + std::to_string(GetID()) + "/" + std::to_string(iop.TableID()) + "): " + m_path.string()); } FunctionExecutor fe(std::bind(&RCTable::LockPackInfoForUse, this), std::bind(&RCTable::UnlockPackInfoFromUse, this)); if (iop.LoadDelayed()) { - no_loaded_rows = stonedb_sysvar_enable_rowstore ? MergeMemTable(iop) : ProcessDelayed(iop); + no_loaded_rows = tianmu_sysvar_enable_rowstore ? MergeMemTable(iop) : ProcessDelayed(iop); } else { no_loaded_rows = ProceedNormal(iop); } @@ -710,7 +710,7 @@ int RCTable::Insert(TABLE *table) { } if (tab->InsertIndex(current_tx, fields, NumOfObj()) == common::ErrorCode::DUPP_KEY) { - STONEDB_LOG(LogCtl_Level::INFO, "Insert duplicate key on row %d", NumOfObj() - 1); + TIANMU_LOG(LogCtl_Level::INFO, "Insert duplicate key on row %d", NumOfObj() - 1); return HA_ERR_FOUND_DUPP_KEY; } } @@ -727,7 +727,7 @@ uint64_t RCTable::ProceedNormal(system::IOParameters &iop) { if (iop.LocalLoad()) { fs.reset(new system::NetStream(iop)); } else { - fs.reset(new system::StoneDBFile()); + fs.reset(new system::TianmuFile()); fs->OpenReadOnly(iop.Path()); } @@ -755,7 +755,7 @@ uint64_t RCTable::ProceedNormal(system::IOParameters &iop) { if (no_loaded_rows > 0 && mysql_bin_log.is_open()) if (binlog_load_query_log_event(iop) != 0) { - STONEDB_LOG(LogCtl_Level::ERROR, "Write load binlog fail!"); + TIANMU_LOG(LogCtl_Level::ERROR, "Write load binlog fail!"); throw common::FormatException("Write load binlog fail!"); } timer.Print(__PRETTY_FUNCTION__); @@ -1080,7 +1080,7 @@ int RCTable::binlog_insert2load_block(std::vector &vcs, uint case common::CT::TIME_N: case common::CT::UNK: default: - throw common::Exception("Unsupported StoneDB Type " + + throw common::Exception("Unsupported Tianmu Type " + std::to_string(static_cast(m_attrs[att]->TypeName()))); break; } @@ -1206,7 +1206,7 @@ class DelayedInsertParser final { } if (index_table->InsertIndex(current_tx, fields, start_row + row_idx) == common::ErrorCode::DUPP_KEY) { - STONEDB_LOG(LogCtl_Level::DEBUG, "Delay insert discard this row for duplicate key"); + TIANMU_LOG(LogCtl_Level::DEBUG, "Delay insert discard this row for duplicate key"); return common::ErrorCode::DUPP_KEY; } return common::ErrorCode::SUCCESS; @@ -1247,7 +1247,7 @@ uint64_t RCTable::ProcessDelayed(system::IOParameters &iop) { if (no_loaded_rows > 0 && mysql_bin_log.is_open()) if (binlog_insert2load_log_event(iop) != 0) { - STONEDB_LOG(LogCtl_Level::ERROR, "Write insert to load binlog fail!"); + TIANMU_LOG(LogCtl_Level::ERROR, "Write insert to load binlog fail!"); throw common::FormatException("Write insert to load binlog fail!"); } @@ -1302,7 +1302,7 @@ int RCTable::MergeMemTable(system::IOParameters &iop) { m_mem_table->stat.read_bytes += value.size(); iter->Next(); - if (vec.size() >= static_cast(stonedb_sysvar_insert_max_buffered)) break; + if (vec.size() >= static_cast(tianmu_sysvar_insert_max_buffered)) break; } if (iter->Valid() && iter->key().starts_with(entry_slice)) { @@ -1336,17 +1336,17 @@ int RCTable::MergeMemTable(system::IOParameters &iop) { if (no_loaded_rows > 0 && mysql_bin_log.is_open()) if (binlog_insert2load_log_event(iop) != 0) { - STONEDB_LOG(LogCtl_Level::ERROR, "Write insert to load binlog fail!"); + TIANMU_LOG(LogCtl_Level::ERROR, "Write insert to load binlog fail!"); throw common::FormatException("Write insert to load binlog fail!"); } if (t2.tv_sec - t1.tv_sec > 15) { - STONEDB_LOG(LogCtl_Level::WARN, "Latency of rowstore %s larger than 15s, compact manually.", share->Path().c_str()); + TIANMU_LOG(LogCtl_Level::WARN, "Latency of rowstore %s larger than 15s, compact manually.", share->Path().c_str()); kvstore->GetRdb()->CompactRange(rocksdb::CompactRangeOptions(), m_mem_table->GetCFHandle(), nullptr, nullptr); } if ((t3.tv_sec - t2.tv_sec > 15) && index_table) { - STONEDB_LOG(LogCtl_Level::WARN, "Latency of index table %s larger than 15s, compact manually.", + TIANMU_LOG(LogCtl_Level::WARN, "Latency of index table %s larger than 15s, compact manually.", share->Path().c_str()); kvstore->GetRdb()->CompactRange(rocksdb::CompactRangeOptions(), index_table->rdbkey_->get_cf(), nullptr, nullptr); } @@ -1354,4 +1354,4 @@ int RCTable::MergeMemTable(system::IOParameters &iop) { return no_loaded_rows; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/rc_table.h b/storage/tianmu/core/rc_table.h similarity index 97% rename from storage/stonedb/core/rc_table.h rename to storage/tianmu/core/rc_table.h index b2a4adeae7..8d46e7fce4 100644 --- a/storage/stonedb/core/rc_table.h +++ b/storage/tianmu/core/rc_table.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_RC_TABLE_H_ -#define STONEDB_CORE_RC_TABLE_H_ +#ifndef TIANMU_CORE_RC_TABLE_H_ +#define TIANMU_CORE_RC_TABLE_H_ #pragma once #include @@ -26,7 +26,7 @@ #include "core/rc_mem_table.h" #include "util/fs.h" -namespace stonedb { +namespace Tianmu { namespace system { class IOParameters; @@ -210,6 +210,6 @@ class RCTable final : public JustATable { Iterator End() { return Iterator::CreateEnd(); } }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_RC_TABLE_H_ +#endif // TIANMU_CORE_RC_TABLE_H_ diff --git a/storage/stonedb/core/rcattr_exeq_rs.cpp b/storage/tianmu/core/rcattr_exeq_rs.cpp similarity index 99% rename from storage/stonedb/core/rcattr_exeq_rs.cpp rename to storage/tianmu/core/rcattr_exeq_rs.cpp index 243c03174e..1164ccff25 100644 --- a/storage/stonedb/core/rcattr_exeq_rs.cpp +++ b/storage/tianmu/core/rcattr_exeq_rs.cpp @@ -27,7 +27,7 @@ #include "vc/multi_value_column.h" #include "vc/single_column.h" -namespace stonedb { +namespace Tianmu { namespace core { // Rough queries and indexes @@ -990,7 +990,7 @@ void RCAttr::DisplayAttrStats(Filter *f) // filter is for # of objects ss << "----------------------------------------------------------------------" "---------" << std::endl; - STONEDB_LOG(LogCtl_Level::DEBUG, ss.str().c_str()); + TIANMU_LOG(LogCtl_Level::DEBUG, ss.str().c_str()); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/rcattr_exqp.cpp b/storage/tianmu/core/rcattr_exqp.cpp similarity index 98% rename from storage/stonedb/core/rcattr_exqp.cpp rename to storage/tianmu/core/rcattr_exqp.cpp index 4181d629c9..dadf47b514 100644 --- a/storage/stonedb/core/rcattr_exqp.cpp +++ b/storage/tianmu/core/rcattr_exqp.cpp @@ -34,7 +34,7 @@ #include "vc/in_set_column.h" #include "vc/single_column.h" -namespace stonedb { +namespace Tianmu { namespace core { void RCAttr::EvaluatePack(MIUpdatingIterator &mit, int dim, Descriptor &d) { MEASURE_FET("RCAttr::EvaluatePack(...)"); @@ -144,7 +144,7 @@ common::ErrorCode RCAttr::EvaluateOnIndex_BetweenInt(MIUpdatingIterator &mit, in ++iter; } else { - STONEDB_LOG(LogCtl_Level::ERROR, "GetCurKV valid! col:[%u]=%I64d, Path:%s", ColId(), pv1, + TIANMU_LOG(LogCtl_Level::ERROR, "GetCurKV valid! col:[%u]=%I64d, Path:%s", ColId(), pv1, m_share->owner->Path().data()); break; } @@ -206,7 +206,7 @@ common::ErrorCode RCAttr::EvaluateOnIndex_BetweenString(MIUpdatingIterator &mit, ++iter; } else { - STONEDB_LOG(LogCtl_Level::ERROR, "GetCurKV valid! col:[%u]=%s, Path:%s", ColId(), pv1.ToString().data(), + TIANMU_LOG(LogCtl_Level::ERROR, "GetCurKV valid! col:[%u]=%s, Path:%s", ColId(), pv1.ToString().data(), m_share->owner->Path().data()); break; } @@ -270,7 +270,7 @@ common::ErrorCode RCAttr::EvaluateOnIndex_BetweenString_UTF(MIUpdatingIterator & ++iter; } else { - STONEDB_LOG(LogCtl_Level::ERROR, "GetCurKV valid! col:[%u]=%s, Path:%s", ColId(), pv1.ToString().data(), + TIANMU_LOG(LogCtl_Level::ERROR, "GetCurKV valid! col:[%u]=%s, Path:%s", ColId(), pv1.ToString().data(), m_share->owner->Path().data()); break; } @@ -799,7 +799,7 @@ void RCAttr::EvaluatePack_BetweenInt(MIUpdatingIterator &mit, int dim, Descripto auto filter = mit.GetMultiIndex()->GetFilter(dim); // MIIterator iteratoring costs too much // Loop without it when packs are nearly full - if (stonedb_sysvar_filterevaluation_speedup && filter && + if (tianmu_sysvar_filterevaluation_speedup && filter && filter->NumOfOnes(pack) > static_cast(1 << (mit.GetPower() - 1))) { if (d.op == common::Operator::O_BETWEEN && !mit.NullsPossibleInPack(dim) && dpn.nn == 0) { // easy and fast case - no "if"s @@ -881,7 +881,7 @@ void RCAttr::EvaluatePack_BetweenReal(MIUpdatingIterator &mit, int dim, Descript auto filter = mit.GetMultiIndex()->GetFilter(dim); // MIIterator iteratoring costs too much // Loop without it when packs are nearly full - if (stonedb_sysvar_filterevaluation_speedup && filter && + if (tianmu_sysvar_filterevaluation_speedup && filter && filter->NumOfOnes(pack) > static_cast(1 << (mit.GetPower() - 1))) { for (uint32_t n = 0; n < dpn.nr; n++) { if (p->IsNull(n)) @@ -1267,4 +1267,4 @@ bool RCAttr::TryToMerge(Descriptor &d1, Descriptor &d2) { return false; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/rough_multi_index.cpp b/storage/tianmu/core/rough_multi_index.cpp similarity index 99% rename from storage/stonedb/core/rough_multi_index.cpp rename to storage/tianmu/core/rough_multi_index.cpp index 00a87c242a..9a26c7c4ca 100644 --- a/storage/stonedb/core/rough_multi_index.cpp +++ b/storage/tianmu/core/rough_multi_index.cpp @@ -18,7 +18,7 @@ #include "rough_multi_index.h" #include "core/rough_value.h" -namespace stonedb { +namespace Tianmu { namespace core { RoughMultiIndex::RoughMultiIndex(std::vector no_of_packs) { no_dims = int(no_of_packs.size()); @@ -192,4 +192,4 @@ RoughMultiIndex::RFDesc::RFDesc(const RFDesc &sec) { RoughMultiIndex::RFDesc::~RFDesc() { delete[] desc_rf; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/rough_multi_index.h b/storage/tianmu/core/rough_multi_index.h similarity index 96% rename from storage/stonedb/core/rough_multi_index.h rename to storage/tianmu/core/rough_multi_index.h index fe0b31ecda..1c7e07431d 100644 --- a/storage/stonedb/core/rough_multi_index.h +++ b/storage/tianmu/core/rough_multi_index.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_ROUGH_MULTI_INDEX_H_ -#define STONEDB_CORE_ROUGH_MULTI_INDEX_H_ +#ifndef TIANMU_CORE_ROUGH_MULTI_INDEX_H_ +#define TIANMU_CORE_ROUGH_MULTI_INDEX_H_ #pragma once #include "core/bin_tools.h" #include "core/cq_term.h" #include "core/filter.h" -namespace stonedb { +namespace Tianmu { namespace core { class RoughMultiIndex { public: @@ -94,6 +94,6 @@ class RoughMultiIndex { std::vector *local_desc; // a table of vectors of conditions for each dimension }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_ROUGH_MULTI_INDEX_H_ +#endif // TIANMU_CORE_ROUGH_MULTI_INDEX_H_ diff --git a/storage/stonedb/core/rough_value.cpp b/storage/tianmu/core/rough_value.cpp similarity index 95% rename from storage/stonedb/core/rough_value.cpp rename to storage/tianmu/core/rough_value.cpp index b1475d807d..2c580ee40c 100644 --- a/storage/stonedb/core/rough_value.cpp +++ b/storage/tianmu/core/rough_value.cpp @@ -17,8 +17,8 @@ #include "rough_value.h" -namespace stonedb { +namespace Tianmu { namespace core { RoughValue::RoughValue(int64_t min, int64_t max) : min(min), max(max) {} } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/rough_value.h b/storage/tianmu/core/rough_value.h similarity index 87% rename from storage/stonedb/core/rough_value.h rename to storage/tianmu/core/rough_value.h index 122ac71999..02e05f1251 100644 --- a/storage/stonedb/core/rough_value.h +++ b/storage/tianmu/core/rough_value.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_ROUGH_VALUE_H_ -#define STONEDB_CORE_ROUGH_VALUE_H_ +#ifndef TIANMU_CORE_ROUGH_VALUE_H_ +#define TIANMU_CORE_ROUGH_VALUE_H_ #pragma once #include "common/common_definitions.h" -namespace stonedb { +namespace Tianmu { namespace core { class RoughValue { int64_t min; @@ -32,6 +32,6 @@ class RoughValue { int64_t GetMax() const { return max; } }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_ROUGH_VALUE_H_ +#endif // TIANMU_CORE_ROUGH_VALUE_H_ diff --git a/storage/stonedb/core/rsi_bloom.cpp b/storage/tianmu/core/rsi_bloom.cpp similarity index 93% rename from storage/stonedb/core/rsi_bloom.cpp rename to storage/tianmu/core/rsi_bloom.cpp index 1c565333c4..d5bac493ec 100644 --- a/storage/stonedb/core/rsi_bloom.cpp +++ b/storage/tianmu/core/rsi_bloom.cpp @@ -18,9 +18,9 @@ #include "core/rsi_bloom.h" #include "core/pack_str.h" #include "system/rc_system.h" -#include "system/stonedb_file.h" +#include "system/tianmu_file.h" -namespace stonedb { +namespace Tianmu { namespace core { RSIndex_Bloom::RSIndex_Bloom(const fs::path &dir, common::TX_ID ver) { m_path = dir / common::COL_FILTER_BLOOM_DIR; @@ -28,7 +28,7 @@ RSIndex_Bloom::RSIndex_Bloom(const fs::path &dir, common::TX_ID ver) { bloom_filter_policy.reset(NewBloomFilterPolicy(bits_key)); - system::StoneDBFile frs_index; + system::TianmuFile frs_index; if (fs::exists(fpath)) { frs_index.OpenReadOnly(fpath); @@ -52,11 +52,11 @@ RSIndex_Bloom::~RSIndex_Bloom() { dealloc(bloom_buffers); } void RSIndex_Bloom::SaveToFile(common::TX_ID ver) { auto fpath = m_path / ver.ToString(); ASSERT(!fs::exists(fpath), "file already exists: " + fpath.string()); - system::StoneDBFile frs_index; + system::TianmuFile frs_index; frs_index.OpenCreate(fpath); frs_index.WriteExact(&hdr, sizeof(hdr)); frs_index.WriteExact(bloom_buffers, hdr.no_pack * sizeof(BF)); - if (stonedb_sysvar_sync_buffers) { + if (tianmu_sysvar_sync_buffers) { frs_index.Flush(); } } @@ -103,7 +103,7 @@ void RSIndex_Bloom::Update(common::PACK_INDEX pi, DPN &dpn, const PackStr *pack) Slice block = bloom_builder->Finish(); if (block.size() > sizeof(BF) - 4) { - STONEDB_LOG(LogCtl_Level::WARN, "Bloom len of pack:%d larger than expected", pi); + TIANMU_LOG(LogCtl_Level::WARN, "Bloom len of pack:%d larger than expected", pi); bloom_buffers[pi].len = 0; } else { bloom_buffers[pi].len = block.size(); @@ -111,4 +111,4 @@ void RSIndex_Bloom::Update(common::PACK_INDEX pi, DPN &dpn, const PackStr *pack) } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/rsi_bloom.h b/storage/tianmu/core/rsi_bloom.h similarity index 91% rename from storage/stonedb/core/rsi_bloom.h rename to storage/tianmu/core/rsi_bloom.h index 548c17f3f4..770f5ad303 100644 --- a/storage/stonedb/core/rsi_bloom.h +++ b/storage/tianmu/core/rsi_bloom.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_RSI_BLOOM_H_ -#define STONEDB_CORE_RSI_BLOOM_H_ +#ifndef TIANMU_CORE_RSI_BLOOM_H_ +#define TIANMU_CORE_RSI_BLOOM_H_ #pragma once #include "common/common_definitions.h" @@ -23,7 +23,7 @@ #include "core/rsi_index.h" #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace core { class PackStr; @@ -56,6 +56,6 @@ class RSIndex_Bloom final : public RSIndex { std::unique_ptr bloom_filter_policy; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_RSI_BLOOM_H_ +#endif // TIANMU_CORE_RSI_BLOOM_H_ diff --git a/storage/stonedb/core/rsi_cmap.cpp b/storage/tianmu/core/rsi_cmap.cpp similarity index 96% rename from storage/stonedb/core/rsi_cmap.cpp rename to storage/tianmu/core/rsi_cmap.cpp index 5a819014f3..4e9308db81 100644 --- a/storage/stonedb/core/rsi_cmap.cpp +++ b/storage/tianmu/core/rsi_cmap.cpp @@ -18,17 +18,17 @@ #include "core/rsi_cmap.h" #include "core/pack_str.h" #include "system/rc_system.h" -#include "system/stonedb_file.h" +#include "system/tianmu_file.h" #include "util/fs.h" -namespace stonedb { +namespace Tianmu { namespace core { RSIndex_CMap::RSIndex_CMap(const fs::path &dir, common::TX_ID ver) { m_path = dir / common::COL_FILTER_CMAP_DIR; auto fpath = dir / common::COL_FILTER_CMAP_DIR / ver.ToString(); if (fs::exists(fpath)) { - system::StoneDBFile frs_index; + system::TianmuFile frs_index; frs_index.OpenReadOnly(fpath); frs_index.ReadExact(&hdr, sizeof(hdr)); @@ -57,14 +57,14 @@ void RSIndex_CMap::SaveToFile(common::TX_ID ver) { auto fpath = m_path / ver.ToString(); ASSERT(!fs::exists(fpath), "file already exists: " + fpath.string()); - system::StoneDBFile frs_index; + system::TianmuFile frs_index; frs_index.OpenCreate(fpath); frs_index.WriteExact(&hdr, sizeof(hdr)); if (cmap_buffers != nullptr) { frs_index.WriteExact(cmap_buffers, hdr.no_pack * hdr.no_positions * CMAP_BYTES); } - if (stonedb_sysvar_sync_buffers) { + if (tianmu_sysvar_sync_buffers) { frs_index.Flush(); } } @@ -165,4 +165,4 @@ void RSIndex_CMap::Update(common::PACK_INDEX pi, DPN &dpn, const PackStr *pack) } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/rsi_cmap.h b/storage/tianmu/core/rsi_cmap.h similarity index 95% rename from storage/stonedb/core/rsi_cmap.h rename to storage/tianmu/core/rsi_cmap.h index 05001a036b..5b20adaa3b 100644 --- a/storage/stonedb/core/rsi_cmap.h +++ b/storage/tianmu/core/rsi_cmap.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_RSI_CMAP_H_ -#define STONEDB_CORE_RSI_CMAP_H_ +#ifndef TIANMU_CORE_RSI_CMAP_H_ +#define TIANMU_CORE_RSI_CMAP_H_ #pragma once #include "common/common_definitions.h" #include "core/rsi_index.h" #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace core { class PackStr; @@ -79,6 +79,6 @@ class RSIndex_CMap final : public RSIndex { size_t capacity = 0; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_RSI_CMAP_H_ +#endif // TIANMU_CORE_RSI_CMAP_H_ diff --git a/storage/stonedb/core/rsi_histogram.cpp b/storage/tianmu/core/rsi_histogram.cpp similarity index 98% rename from storage/stonedb/core/rsi_histogram.cpp rename to storage/tianmu/core/rsi_histogram.cpp index d1944fe778..6c6d8d93cc 100644 --- a/storage/stonedb/core/rsi_histogram.cpp +++ b/storage/tianmu/core/rsi_histogram.cpp @@ -20,15 +20,15 @@ #include "core/pack.h" #include "core/rsi_histogram.h" #include "system/rc_system.h" -#include "system/stonedb_file.h" +#include "system/tianmu_file.h" -namespace stonedb { +namespace Tianmu { namespace core { RSIndex_Hist::RSIndex_Hist(const fs::path &dir, common::TX_ID ver) { m_path = dir / common::COL_FILTER_HIST_DIR; auto fpath = dir / common::COL_FILTER_HIST_DIR / ver.ToString(); - system::StoneDBFile frs_index; + system::TianmuFile frs_index; if (fs::exists(fpath)) { frs_index.OpenReadOnly(fpath); @@ -56,11 +56,11 @@ void RSIndex_Hist::SaveToFile(common::TX_ID ver) { auto fpath = m_path / ver.ToString(); ASSERT(!fs::exists(fpath), "file already exists: " + fpath.string()); - system::StoneDBFile frs_index; + system::TianmuFile frs_index; frs_index.OpenCreate(fpath); frs_index.WriteExact(&hdr, sizeof(hdr)); frs_index.WriteExact(hist_buffers, hdr.no_pack * sizeof(BLOCK)); - if (stonedb_sysvar_sync_buffers) { + if (tianmu_sysvar_sync_buffers) { frs_index.Flush(); } } @@ -224,4 +224,4 @@ void RSIndex_Hist::Update(common::PACK_INDEX pi, DPN &dpn, const PackInt *pack) } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/rsi_histogram.h b/storage/tianmu/core/rsi_histogram.h similarity index 95% rename from storage/stonedb/core/rsi_histogram.h rename to storage/tianmu/core/rsi_histogram.h index a40ae4c732..3ec2494c86 100644 --- a/storage/stonedb/core/rsi_histogram.h +++ b/storage/tianmu/core/rsi_histogram.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_RSI_HISTOGRAM_H_ -#define STONEDB_CORE_RSI_HISTOGRAM_H_ +#ifndef TIANMU_CORE_RSI_HISTOGRAM_H_ +#define TIANMU_CORE_RSI_HISTOGRAM_H_ #pragma once #include "common/common_definitions.h" #include "core/pack_int.h" #include "core/rsi_index.h" -namespace stonedb { +namespace Tianmu { namespace core { class RSIndex_Hist final : public RSIndex { public: @@ -89,6 +89,6 @@ class RSIndex_Hist final : public RSIndex { size_t capacity = 0; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_RSI_HISTOGRAM_H_ \ No newline at end of file +#endif // TIANMU_CORE_RSI_HISTOGRAM_H_ \ No newline at end of file diff --git a/storage/stonedb/core/rsi_index.h b/storage/tianmu/core/rsi_index.h similarity index 89% rename from storage/stonedb/core/rsi_index.h rename to storage/tianmu/core/rsi_index.h index 4c77d14d07..6c5e0b5631 100644 --- a/storage/stonedb/core/rsi_index.h +++ b/storage/tianmu/core/rsi_index.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_RSI_INDEX_H_ -#define STONEDB_CORE_RSI_INDEX_H_ +#ifndef TIANMU_CORE_RSI_INDEX_H_ +#define TIANMU_CORE_RSI_INDEX_H_ #pragma once #include "common/exception.h" @@ -24,7 +24,7 @@ #include "mm/traceable_object.h" #include "util/fs.h" -namespace stonedb { +namespace Tianmu { namespace core { enum class FilterType : int { HIST, // histogram @@ -43,6 +43,6 @@ class RSIndex : public mm::TraceableObject { fs::path m_path; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_RSI_INDEX_H_ +#endif // TIANMU_CORE_RSI_INDEX_H_ diff --git a/storage/stonedb/core/sorter3.cpp b/storage/tianmu/core/sorter3.cpp similarity index 96% rename from storage/stonedb/core/sorter3.cpp rename to storage/tianmu/core/sorter3.cpp index 0a855a6038..f53b3190d4 100644 --- a/storage/stonedb/core/sorter3.cpp +++ b/storage/tianmu/core/sorter3.cpp @@ -24,7 +24,7 @@ #include "system/fet.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace core { // A static function to create a proper sorter Sorter3 *Sorter3::CreateSorter(int64_t size, uint key_bytes, uint total_bytes, int64_t limit, int mem_modifier) { @@ -91,7 +91,7 @@ bool SorterOnePass::PutValue(unsigned char *b) { } bool SorterOnePass::PutValue(Sorter3 *s) { - STONEDB_LOG(LogCtl_Level::WARN, "SorterOnePass PutValue merger, never verified."); + TIANMU_LOG(LogCtl_Level::WARN, "SorterOnePass PutValue merger, never verified."); DEBUG_ASSERT(buf_input_pos < buf_end); already_sorted = false; SorterOnePass *sp = (SorterOnePass *)s; @@ -234,7 +234,7 @@ bool SorterMultiPass::PutValue(unsigned char *b) { } bool SorterMultiPass::PutValue([[maybe_unused]] Sorter3 *s) { - STONEDB_LOG(LogCtl_Level::WARN, "PutValue Stub, should not see it now"); + TIANMU_LOG(LogCtl_Level::WARN, "PutValue Stub, should not see it now"); return true; } @@ -357,7 +357,7 @@ bool SorterCounting::PutValue(unsigned char *b) { } bool SorterCounting::PutValue([[maybe_unused]] Sorter3 *s) { - STONEDB_LOG(LogCtl_Level::WARN, "PutValue Stub, should not see it now"); + TIANMU_LOG(LogCtl_Level::WARN, "PutValue Stub, should not see it now"); return true; } @@ -475,16 +475,16 @@ bool SorterLimit::PutValue(Sorter3 *s) { // not called uint tmp_noobj = sl->GetObjNo(); unsigned char *buf1 = sl->Getbuf(); - STONEDB_LOG(LogCtl_Level::DEBUG, "PutValue: total bytes %d, tmp_noobj %ld ", total_bytes, tmp_noobj); + TIANMU_LOG(LogCtl_Level::DEBUG, "PutValue: total bytes %d, tmp_noobj %ld ", total_bytes, tmp_noobj); if (tmp_noobj) { if (no_obj + tmp_noobj <= size) { std::memcpy(buf + no_obj * total_bytes, buf1, tmp_noobj * total_bytes); no_obj += tmp_noobj; - STONEDB_LOG(LogCtl_Level::DEBUG, "PutValue: no_obj %ld, tmp_noobj %ld, total_bytes %ld buf %s", no_obj, tmp_noobj, + TIANMU_LOG(LogCtl_Level::DEBUG, "PutValue: no_obj %ld, tmp_noobj %ld, total_bytes %ld buf %s", no_obj, tmp_noobj, total_bytes, buf); } else { - STONEDB_LOG(LogCtl_Level::ERROR, "error in Putvalue, out of boundary size %d no_obj+tmp_noobj %d", size, + TIANMU_LOG(LogCtl_Level::ERROR, "error in Putvalue, out of boundary size %d no_obj+tmp_noobj %d", size, no_obj + tmp_noobj); throw common::OutOfMemoryException("Out of boundary after merge sorters together."); return false; @@ -493,4 +493,4 @@ bool SorterLimit::PutValue(Sorter3 *s) { return true; } } // namespace core -} // namespace stonedb \ No newline at end of file +} // namespace Tianmu \ No newline at end of file diff --git a/storage/stonedb/core/sorter3.h b/storage/tianmu/core/sorter3.h similarity index 98% rename from storage/stonedb/core/sorter3.h rename to storage/tianmu/core/sorter3.h index 35c2933aff..8820334699 100644 --- a/storage/stonedb/core/sorter3.h +++ b/storage/tianmu/core/sorter3.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_SORTER3_H_ -#define STONEDB_CORE_SORTER3_H_ +#ifndef TIANMU_CORE_SORTER3_H_ +#define TIANMU_CORE_SORTER3_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "system/cacheable_item.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace core { // Base class for various sorting algorithm @@ -224,6 +224,6 @@ class SorterLimit : public SorterOnePass { unsigned char *zero_buf; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_SORTER3_H_ \ No newline at end of file +#endif // TIANMU_CORE_SORTER3_H_ \ No newline at end of file diff --git a/storage/stonedb/core/sorter_wrapper.cpp b/storage/tianmu/core/sorter_wrapper.cpp similarity index 98% rename from storage/stonedb/core/sorter_wrapper.cpp rename to storage/tianmu/core/sorter_wrapper.cpp index 211d5219e7..04190083f7 100644 --- a/storage/stonedb/core/sorter_wrapper.cpp +++ b/storage/tianmu/core/sorter_wrapper.cpp @@ -22,7 +22,7 @@ #include "core/transaction.h" #include "util/thread_pool.h" -namespace stonedb { +namespace Tianmu { namespace core { SorterWrapper::SorterWrapper(MultiIndex &_mind, int64_t _limit) : cur_mit(&_mind) { no_of_rows = _mind.NumOfTuples(); @@ -232,7 +232,7 @@ bool SorterWrapper::InitPackrow(MIIterator &mit) // return true if the packrow } } - STONEDB_LOG(LogCtl_Level::DEBUG, "InitPackrow: no_values_encoded %d, begin to loadpacks scol size %d ", + TIANMU_LOG(LogCtl_Level::DEBUG, "InitPackrow: no_values_encoded %d, begin to loadpacks scol size %d ", no_values_encoded, scol.size()); // Not excluded: lock packs if (!rceng->query_thread_pool.is_owner()) { @@ -264,7 +264,7 @@ bool SorterWrapper::PutValues(MIIterator &mit) { bool SorterWrapper::PutValues(SorterWrapper &sw) { if (s == NULL) return false; // trivial sorter (constant values) no_values_encoded += sw.GetEncodedValNum(); - STONEDB_LOG(LogCtl_Level::DEBUG, "PutValues: no_values_encoded %d \n", no_values_encoded); + TIANMU_LOG(LogCtl_Level::DEBUG, "PutValues: no_values_encoded %d \n", no_values_encoded); return s->PutValue(sw.GetSorter()); } @@ -280,4 +280,4 @@ bool SorterWrapper::FetchNextRow() { return true; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/sorter_wrapper.h b/storage/tianmu/core/sorter_wrapper.h similarity index 95% rename from storage/stonedb/core/sorter_wrapper.h rename to storage/tianmu/core/sorter_wrapper.h index d6e8f8d335..c92142d392 100644 --- a/storage/stonedb/core/sorter_wrapper.h +++ b/storage/tianmu/core/sorter_wrapper.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_SORTER_WRAPPER_H_ -#define STONEDB_CORE_SORTER_WRAPPER_H_ +#ifndef TIANMU_CORE_SORTER_WRAPPER_H_ +#define TIANMU_CORE_SORTER_WRAPPER_H_ #pragma once #include "core/column_bin_encoder.h" @@ -24,7 +24,7 @@ #include "core/sorter3.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { class SorterWrapper { @@ -84,6 +84,6 @@ class SorterWrapper { std::vector input_cols; // encoders for sorted columns }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_SORTER_WRAPPER_H_ +#endif // TIANMU_CORE_SORTER_WRAPPER_H_ diff --git a/storage/stonedb/core/table_share.cpp b/storage/tianmu/core/table_share.cpp similarity index 89% rename from storage/stonedb/core/table_share.cpp rename to storage/tianmu/core/table_share.cpp index db68d285e0..64b21dfa44 100644 --- a/storage/stonedb/core/table_share.cpp +++ b/storage/tianmu/core/table_share.cpp @@ -22,11 +22,11 @@ #include "core/rc_table.h" #include "core/table_share.h" -namespace stonedb { +namespace Tianmu { namespace core { TableShare::TableShare(const fs::path &table_path, const TABLE_SHARE *table_share) : no_cols(table_share->fields), table_path(table_path) { - system::StoneDBFile ftbl; + system::TianmuFile ftbl; ftbl.OpenReadOnly(table_path / common::TABLE_DESC_FILE); ftbl.ReadExact(&meta, sizeof(meta)); @@ -42,7 +42,7 @@ TableShare::TableShare(const fs::path &table_path, const TABLE_SHARE *table_shar m_columns.reserve(no_cols); - system::StoneDBFile fv; + system::TianmuFile fv; fv.OpenReadOnly(table_path / common::TABLE_VERSION_FILE); for (uint i = 0; i < no_cols; i++) { common::TX_ID xid; @@ -58,12 +58,12 @@ TableShare::~TableShare() { thr_lock_delete(&thr_lock); if (current.use_count() > 1) - STONEDB_LOG(LogCtl_Level::FATAL, "TableShare still has ref outside by current %ld", current.use_count()); + TIANMU_LOG(LogCtl_Level::FATAL, "TableShare still has ref outside by current %ld", current.use_count()); - if (!write_table.expired()) STONEDB_LOG(LogCtl_Level::FATAL, "TableShare still has ref outside by write table"); + if (!write_table.expired()) TIANMU_LOG(LogCtl_Level::FATAL, "TableShare still has ref outside by write table"); for (auto &t : versions) - if (!t.expired()) STONEDB_LOG(LogCtl_Level::FATAL, "TableShare still has ref outside by old versions"); + if (!t.expired()) TIANMU_LOG(LogCtl_Level::FATAL, "TableShare still has ref outside by old versions"); } std::shared_ptr TableShare::GetSnapshot() { @@ -111,4 +111,4 @@ unsigned long TableShare::GetUpdateTime() { return system::GetFileTime((table_path / common::TABLE_VERSION_FILE).string()); } } // namespace core -} // namespace stonedb \ No newline at end of file +} // namespace Tianmu \ No newline at end of file diff --git a/storage/stonedb/core/table_share.h b/storage/tianmu/core/table_share.h similarity index 92% rename from storage/stonedb/core/table_share.h rename to storage/tianmu/core/table_share.h index 78805e1583..1c2ab032a8 100644 --- a/storage/stonedb/core/table_share.h +++ b/storage/tianmu/core/table_share.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_TABLE_SHARE_H_ -#define STONEDB_CORE_TABLE_SHARE_H_ +#ifndef TIANMU_CORE_TABLE_SHARE_H_ +#define TIANMU_CORE_TABLE_SHARE_H_ #pragma once #include "common/common_definitions.h" @@ -27,12 +27,12 @@ #include #include -namespace stonedb { +namespace Tianmu { namespace core { class RCTable; struct TABLE_META { - uint32_t magic = common::FILE_MAGIC; + uint64_t magic = common::FILE_MAGIC; uint32_t ver = common::TABLE_DATA_VERSION; uint32_t id; uint32_t pss = 16; @@ -83,6 +83,6 @@ class TableShare final { std::mutex write_table_mtx; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_TABLE_SHARE_H_ +#endif // TIANMU_CORE_TABLE_SHARE_H_ diff --git a/storage/stonedb/core/task_executor.cpp b/storage/tianmu/core/task_executor.cpp similarity index 96% rename from storage/stonedb/core/task_executor.cpp rename to storage/tianmu/core/task_executor.cpp index c8ea9534d2..c40e96b03c 100644 --- a/storage/stonedb/core/task_executor.cpp +++ b/storage/tianmu/core/task_executor.cpp @@ -21,12 +21,12 @@ #include "core/future.h" #include "core/task_executor.h" -#ifndef DISABLE_USED_FOR_STONEDB +#ifndef DISABLE_USED_FOR_TIANMU #include "core/engine.h" #include "system/rc_system.h" #endif -namespace stonedb { +namespace Tianmu { namespace core { class AppTemplate { static constexpr size_t queue_length = 128; @@ -96,9 +96,9 @@ void TaskExecutor::Exit() { void TaskExecutor::AddTask(std::unique_ptr task) { _app_template->AddTask(std::move(task)); } -#ifndef DISABLE_USED_FOR_STONEDB +#ifndef DISABLE_USED_FOR_TIANMU TaskExecutor *GetTaskExecutor() { return rceng->GetTaskExecutor(); } #endif } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/async_tests/task_executor.h b/storage/tianmu/core/task_executor.h similarity index 91% rename from storage/stonedb/async_tests/task_executor.h rename to storage/tianmu/core/task_executor.h index 9ae067da20..c30ede7ad2 100644 --- a/storage/stonedb/async_tests/task_executor.h +++ b/storage/tianmu/core/task_executor.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_TASK_EXECUTOR_H_ -#define STONEDB_CORE_TASK_EXECUTOR_H_ +#ifndef TIANMU_CORE_TASK_EXECUTOR_H_ +#define TIANMU_CORE_TASK_EXECUTOR_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "base/core/reactor.h" -namespace stonedb { +namespace Tianmu { namespace core { class AppTemplate; @@ -78,7 +78,7 @@ class TaskExecutor { std::unique_ptr _app_template; }; -#ifndef DISABLE_USED_FOR_STONEDB +#ifndef DISABLE_USED_FOR_TIANMU TaskExecutor *GetTaskExecutor(); template @@ -88,6 +88,6 @@ inline std::future ScheduleAsyncTask(Func &&func) { #endif } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_TASK_EXECUTOR_H_ +#endif // TIANMU_CORE_TASK_EXECUTOR_H_ diff --git a/storage/stonedb/core/temp_table.cpp b/storage/tianmu/core/temp_table.cpp similarity index 99% rename from storage/stonedb/core/temp_table.cpp rename to storage/tianmu/core/temp_table.cpp index 1a43ddb063..d676257590 100644 --- a/storage/stonedb/core/temp_table.cpp +++ b/storage/tianmu/core/temp_table.cpp @@ -39,7 +39,7 @@ #include "vc/subselect_column.h" #include "vc/type_cast_column.h" -namespace stonedb { +namespace Tianmu { namespace core { template class AttrBuffer : public CachedBuffer { @@ -282,7 +282,7 @@ void TempTable::Attr::SetValueInt64(int64_t obj, int64_t val) { else if (val == common::PLUS_INF_64) ((AttrBuffer *)buffer)->Set(obj, std::numeric_limits::max()); else if (val == common::MINUS_INF_64) - ((AttrBuffer *)buffer)->Set(obj, SDB_INT_MIN); + ((AttrBuffer *)buffer)->Set(obj, TIANMU_INT_MIN); else ((AttrBuffer *)buffer)->Set(obj, (int)val); break; @@ -290,9 +290,9 @@ void TempTable::Attr::SetValueInt64(int64_t obj, int64_t val) { if (val == common::NULL_VALUE_64) ((AttrBuffer *)buffer)->Set(obj, common::NULL_VALUE_SH); else if (val == common::PLUS_INF_64) - ((AttrBuffer *)buffer)->Set(obj, SDB_SMALLINT_MAX); + ((AttrBuffer *)buffer)->Set(obj, TIANMU_SMALLINT_MAX); else if (val == common::MINUS_INF_64) - ((AttrBuffer *)buffer)->Set(obj, SDB_SMALLINT_MIN); + ((AttrBuffer *)buffer)->Set(obj, TIANMU_SMALLINT_MIN); else ((AttrBuffer *)buffer)->Set(obj, (short)val); break; @@ -300,9 +300,9 @@ void TempTable::Attr::SetValueInt64(int64_t obj, int64_t val) { if (val == common::NULL_VALUE_64) ((AttrBuffer *)buffer)->Set(obj, common::NULL_VALUE_C); else if (val == common::PLUS_INF_64) - ((AttrBuffer *)buffer)->Set(obj, SDB_TINYINT_MAX); + ((AttrBuffer *)buffer)->Set(obj, TIANMU_TINYINT_MAX); else if (val == common::MINUS_INF_64) - ((AttrBuffer *)buffer)->Set(obj, SDB_TINYINT_MIN); + ((AttrBuffer *)buffer)->Set(obj, TIANMU_TINYINT_MIN); else ((AttrBuffer *)buffer)->Set(obj, (char)val); break; @@ -566,16 +566,16 @@ int64_t TempTable::Attr::GetMaxInt64(int pack) { int64_t stop = (pack + 1) * (1 << no_power); stop = stop > no_obj ? no_obj : stop; if (no_materialized < stop) return common::NULL_VALUE_64; - int64_t val, max = common::SDB_BIGINT_MIN; + int64_t val, max = common::TIANMU_BIGINT_MIN; for (int64_t i = start; i < stop; i++) { if (!IsNull(i)) { val = GetNotNullValueInt64(i); - if ((ATI::IsRealType(ct.GetTypeName()) && (max == common::SDB_BIGINT_MIN || *(double *)&val > *(double *)&max)) || + if ((ATI::IsRealType(ct.GetTypeName()) && (max == common::TIANMU_BIGINT_MIN || *(double *)&val > *(double *)&max)) || (!ATI::IsRealType(ct.GetTypeName()) && val > max)) max = val; } } - return (max == common::SDB_BIGINT_MIN ? common::PLUS_INF_64 : max); + return (max == common::TIANMU_BIGINT_MIN ? common::PLUS_INF_64 : max); } int64_t TempTable::Attr::GetMinInt64(int pack) { @@ -584,16 +584,16 @@ int64_t TempTable::Attr::GetMinInt64(int pack) { int64_t stop = (pack + 1) * (1 << no_power); stop = stop > no_obj ? no_obj : stop; if (no_materialized < stop) return common::NULL_VALUE_64; - int64_t val, min = common::SDB_BIGINT_MAX; + int64_t val, min = common::TIANMU_BIGINT_MAX; for (int64_t i = start; i < stop; i++) { if (!IsNull(i)) { val = GetNotNullValueInt64(i); - if ((ATI::IsRealType(ct.GetTypeName()) && (min == common::SDB_BIGINT_MAX || *(double *)&val < *(double *)&min)) || + if ((ATI::IsRealType(ct.GetTypeName()) && (min == common::TIANMU_BIGINT_MAX || *(double *)&val < *(double *)&min)) || (!ATI::IsRealType(ct.GetTypeName()) && val < min)) min = val; } } - return (min == common::SDB_BIGINT_MAX ? common::MINUS_INF_64 : min); + return (min == common::TIANMU_BIGINT_MAX ? common::MINUS_INF_64 : min); } int64_t TempTable::Attr::GetValueInt64(int64_t obj) const { @@ -2231,4 +2231,4 @@ void TempTableForSubquery::CreateTemplateIfNotExists() { } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/temp_table.h b/storage/tianmu/core/temp_table.h similarity index 99% rename from storage/stonedb/core/temp_table.h rename to storage/tianmu/core/temp_table.h index 796936185f..5c9c28ca0a 100644 --- a/storage/stonedb/core/temp_table.h +++ b/storage/tianmu/core/temp_table.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_TEMP_TABLE_H_ -#define STONEDB_CORE_TEMP_TABLE_H_ +#ifndef TIANMU_CORE_TEMP_TABLE_H_ +#define TIANMU_CORE_TEMP_TABLE_H_ #pragma once #include @@ -34,7 +34,7 @@ #include "exporter/data_exporter.h" #include "system/large_buffer.h" -namespace stonedb { +namespace Tianmu { namespace core { class Descriptor; class Filter; @@ -160,7 +160,7 @@ class TempTable : public JustATable { } common::ErrorCode EvaluateOnIndex([[maybe_unused]] MIUpdatingIterator &mit, [[maybe_unused]] int dim, [[maybe_unused]] Descriptor &desc, [[maybe_unused]] int64_t limit) override { - STONEDB_ERROR("To be implemented."); + TIANMU_ERROR("To be implemented."); return common::ErrorCode::FAILED; } types::BString DecodeValue_S([[maybe_unused]] int64_t code) override { @@ -518,6 +518,6 @@ class TempTableForSubquery : public TempTable { std::vector template_virt_cols; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_TEMP_TABLE_H_ +#endif // TIANMU_CORE_TEMP_TABLE_H_ diff --git a/storage/stonedb/core/temp_table_com.cpp b/storage/tianmu/core/temp_table_com.cpp similarity index 98% rename from storage/stonedb/core/temp_table_com.cpp rename to storage/tianmu/core/temp_table_com.cpp index 1ae8020677..c9dac8562e 100644 --- a/storage/stonedb/core/temp_table_com.cpp +++ b/storage/tianmu/core/temp_table_com.cpp @@ -26,7 +26,7 @@ #include "vc/subselect_column.h" #include "vc/type_cast_column.h" -namespace stonedb { +namespace Tianmu { namespace core { TempTable::TempTable(JustATable *t, int alias, Query *q) : mem_scale(-1), filter(t->Getpackpower()), output_mind(t->Getpackpower()), m_conn(current_tx) { @@ -100,4 +100,4 @@ vcolumn::VirtualColumn *CreateVCCopy(vcolumn::VirtualColumn *vc) { return vc; } } -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/temp_table_low.cpp b/storage/tianmu/core/temp_table_low.cpp similarity index 94% rename from storage/stonedb/core/temp_table_low.cpp rename to storage/tianmu/core/temp_table_low.cpp index 1f93105676..78a74c48d2 100644 --- a/storage/stonedb/core/temp_table_low.cpp +++ b/storage/tianmu/core/temp_table_low.cpp @@ -37,7 +37,7 @@ #include "vc/expr_column.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { bool TempTable::OrderByAndMaterialize(std::vector &ord, int64_t limit, int64_t offset, ResultSender *sender) // Sort MultiIndex using some (existing) attributes @@ -76,12 +76,12 @@ bool TempTable::OrderByAndMaterialize(std::vector &ord, int64_t // Xeon(R) CPU E5-2430 0 @ 2.20GHz // 2. Cannot support multi-dimension(join) case as MIIndex rewind so far does // not support it. - if (stonedb_sysvar_orderby_speedup && packs_no > 20 && no_dims == 1) { + if (tianmu_sysvar_orderby_speedup && packs_no > 20 && no_dims == 1) { task_num = 8; // recheck the up threashold for each SortLimit sub-sortedtable if (((packs_no - 1) * ((1 << filter.mind->ValueOfPower()) - 1)) / task_num < (limit + offset)) { task_num = 1; - STONEDB_LOG(LogCtl_Level::INFO, "Beyond uplimit of limit sort, switch to single thread logic. "); + TIANMU_LOG(LogCtl_Level::INFO, "Beyond uplimit of limit sort, switch to single thread logic. "); } total_limit = task_num * (limit + offset); } @@ -144,7 +144,7 @@ bool TempTable::OrderByAndMaterialize(std::vector &ord, int64_t else sorted_table.InitSorter(*(filter.mind), false); if (sorted_table.GetSorter() && std::strcmp(sorted_table.GetSorter()->Name(), "Heap Sort") != 0) { - STONEDB_LOG(LogCtl_Level::DEBUG, "Multi-thread order by is not supported for %s table.", + TIANMU_LOG(LogCtl_Level::DEBUG, "Multi-thread order by is not supported for %s table.", sorted_table.GetSorter()->Name()); task_num = 1; } @@ -189,7 +189,7 @@ bool TempTable::OrderByAndMaterialize(std::vector &ord, int64_t for (int i = 0; i < task_num; ++i) { int pstart = ((i == 0) ? 0 : mod + i * num); int pend = mod + (i + 1) * num - 1; - STONEDB_LOG(LogCtl_Level::INFO, "create new MIIterator: start pack %d, endpack %d", pstart, pend); + TIANMU_LOG(LogCtl_Level::INFO, "create new MIIterator: start pack %d, endpack %d", pstart, pend); auto &mi = mis.emplace_back(*filter.mind, true); @@ -200,7 +200,7 @@ bool TempTable::OrderByAndMaterialize(std::vector &ord, int64_t mii.RewindToPack(pstart); } - STONEDB_LOG(LogCtl_Level::DEBUG, "table statistic no_dim %d, packs_no %d \n", one_dim, packs_no); + TIANMU_LOG(LogCtl_Level::DEBUG, "table statistic no_dim %d, packs_no %d \n", one_dim, packs_no); // Repeat the same logic to prepare the new sort tables // Note: Don't RoughSort them as it would impact initPack logic // and some rows would be skipped from adding in the sort table @@ -219,7 +219,7 @@ bool TempTable::OrderByAndMaterialize(std::vector &ord, int64_t } } - STONEDB_LOG(LogCtl_Level::DEBUG, + TIANMU_LOG(LogCtl_Level::DEBUG, "SortTable preparation done. row num %d, offset %d, limit %d, " "task_num %d", local_row, offset, limit, task_num); @@ -228,8 +228,8 @@ bool TempTable::OrderByAndMaterialize(std::vector &ord, int64_t for (uint i = 0; i < NumOfAttrs(); i++) { if (attrs[i]->alias != NULL) { if (sender) - attrs[i]->CreateBuffer(no_obj > stonedb_sysvar_result_sender_rows ? stonedb_sysvar_result_sender_rows : no_obj, - m_conn, no_obj > stonedb_sysvar_result_sender_rows); + attrs[i]->CreateBuffer(no_obj > tianmu_sysvar_result_sender_rows ? tianmu_sysvar_result_sender_rows : no_obj, + m_conn, no_obj > tianmu_sysvar_result_sender_rows); else attrs[i]->CreateBuffer(no_obj, m_conn); } @@ -282,7 +282,7 @@ bool TempTable::OrderByAndMaterialize(std::vector &ord, int64_t ++offset_done; global_row++; } while (valid && global_row < limit + offset && - !(sender && local_row >= stonedb_sysvar_result_sender_rows)); // a limit for + !(sender && local_row >= tianmu_sysvar_result_sender_rows)); // a limit for // streaming buffer // Note: what about SetNumOfMaterialized()? Only no_obj is set now. if (sender) { @@ -291,13 +291,13 @@ bool TempTable::OrderByAndMaterialize(std::vector &ord, int64_t sender->Send(iter); ++iter; } - // STONEDB_LOG(LogCtl_Level::DEBUG, "Put sort output - %d rows in sender", local_row); + // TIANMU_LOG(LogCtl_Level::DEBUG, "Put sort output - %d rows in sender", local_row); local_row = 0; } } while (valid && global_row < limit + offset); rccontrol.lock(m_conn->GetThreadID()) << "Sorted end, rows retrieved." << system::unlock; - // STONEDB_LOG(LogCtl_Level::INFO, "OrderByAndMaterialize complete global_row %d, limit %d, + // TIANMU_LOG(LogCtl_Level::INFO, "OrderByAndMaterialize complete global_row %d, limit %d, // offset %d", global_row, limit, offset); return true; } @@ -315,7 +315,7 @@ void TempTable::FillMaterializedBuffers(int64_t local_limit, int64_t local_offse uint page_size = CalculatePageSize(); if (pagewise) // the number of rows to be sent at once - page_size = std::min(page_size, stonedb_sysvar_result_sender_rows); + page_size = std::min(page_size, tianmu_sysvar_result_sender_rows); if (no_materialized == 0) { // Column statistics @@ -552,7 +552,7 @@ size_t TempTable::TaskPutValueInST(MIIterator *it, Transaction *ci, SorterWrappe local_row += it->GetPackSizeLeft(); it->NextPackrow(); - STONEDB_LOG(LogCtl_Level::DEBUG, "skip this pack it %x", it); + TIANMU_LOG(LogCtl_Level::DEBUG, "skip this pack it %x", it); continue; } } @@ -568,4 +568,4 @@ size_t TempTable::TaskPutValueInST(MIIterator *it, Transaction *ci, SorterWrappe return local_row; } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/temp_table_roughquery.cpp b/storage/tianmu/core/temp_table_roughquery.cpp similarity index 99% rename from storage/stonedb/core/temp_table_roughquery.cpp rename to storage/tianmu/core/temp_table_roughquery.cpp index dcde691feb..f5c96bb858 100644 --- a/storage/stonedb/core/temp_table_roughquery.cpp +++ b/storage/tianmu/core/temp_table_roughquery.cpp @@ -26,7 +26,7 @@ #include "core/temp_table.h" #include "vc/single_column.h" -namespace stonedb { +namespace Tianmu { namespace core { void TempTable::RoughMaterialize([[maybe_unused]] bool in_subq, ResultSender *sender, [[maybe_unused]] bool lazy) { MEASURE_FET("Descriptor::RoughMaterialize(...)"); @@ -768,4 +768,4 @@ void TempTable::RoughUnion(TempTable *t, ResultSender *sender) { } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/tools.h b/storage/tianmu/core/tools.h similarity index 98% rename from storage/stonedb/core/tools.h rename to storage/tianmu/core/tools.h index 5ca84d0271..54a3e5a319 100644 --- a/storage/stonedb/core/tools.h +++ b/storage/tianmu/core/tools.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_TOOLS_H_ -#define STONEDB_CORE_TOOLS_H_ +#ifndef TIANMU_CORE_TOOLS_H_ +#define TIANMU_CORE_TOOLS_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "common/assert.h" -namespace stonedb { +namespace Tianmu { namespace core { #if !defined(_countof) @@ -302,6 +302,6 @@ extern LockProfiler lock_profiler; #endif } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_TOOLS_H_ \ No newline at end of file +#endif // TIANMU_CORE_TOOLS_H_ \ No newline at end of file diff --git a/storage/stonedb/core/transaction.cpp b/storage/tianmu/core/transaction.cpp similarity index 93% rename from storage/stonedb/core/transaction.cpp rename to storage/tianmu/core/transaction.cpp index 7159564752..e11f01270a 100644 --- a/storage/stonedb/core/transaction.cpp +++ b/storage/tianmu/core/transaction.cpp @@ -23,7 +23,7 @@ #include "system/file_system.h" #include "util/fs.h" -namespace stonedb { +namespace Tianmu { thread_local core::Transaction *current_tx; @@ -84,15 +84,15 @@ void Transaction::Commit([[maybe_unused]] THD *thd) { } void Transaction::Rollback([[maybe_unused]] THD *thd, bool force_error_message) { - STONEDB_LOG(LogCtl_Level::INFO, "rollback transaction %s.", tid.ToString().c_str()); + TIANMU_LOG(LogCtl_Level::INFO, "rollback transaction %s.", tid.ToString().c_str()); std::shared_lock rlock(drop_rename_mutex); if (m_modified_tables.size()) { if (force_error_message) { const char *message = - "StoneDB storage engine has encountered an unexpected error. " + "Tianmu storage engine has encountered an unexpected error. " "The current transaction has been rolled back."; - STONEDB_LOG(LogCtl_Level::ERROR, "%s", message); + TIANMU_LOG(LogCtl_Level::ERROR, "%s", message); my_message(ER_XA_RBROLLBACK, message, MYF(0)); } } @@ -113,4 +113,4 @@ void Transaction::ResetDisplay() { ConfigureRCControl(); } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/transaction.h b/storage/tianmu/core/transaction.h similarity index 95% rename from storage/stonedb/core/transaction.h rename to storage/tianmu/core/transaction.h index 40db0fb995..7b3f9d498d 100644 --- a/storage/stonedb/core/transaction.h +++ b/storage/tianmu/core/transaction.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_TRANSACTION_H_ -#define STONEDB_CORE_TRANSACTION_H_ +#ifndef TIANMU_CORE_TRANSACTION_H_ +#define TIANMU_CORE_TRANSACTION_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "core/engine.h" #include "index/kv_store.h" #include "index/kv_transaction.h" -namespace stonedb { +namespace Tianmu { namespace core { class Transaction final { static common::SequenceGenerator sg; @@ -82,6 +82,6 @@ class Transaction final { index::KVTransaction &KVTrans() { return kv_trans; } }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_TRANSACTION_H_ +#endif // TIANMU_CORE_TRANSACTION_H_ diff --git a/storage/stonedb/core/value.h b/storage/tianmu/core/value.h similarity index 94% rename from storage/stonedb/core/value.h rename to storage/tianmu/core/value.h index dfc9e67bf4..c58b799c82 100644 --- a/storage/stonedb/core/value.h +++ b/storage/tianmu/core/value.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_VALUE_H_ -#define STONEDB_CORE_VALUE_H_ +#ifndef TIANMU_CORE_VALUE_H_ +#define TIANMU_CORE_VALUE_H_ #pragma once #include #include -namespace stonedb { +namespace Tianmu { namespace core { class Value final { public: @@ -55,6 +55,6 @@ class Value final { std::variant var; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_VALUE_H_ +#endif // TIANMU_CORE_VALUE_H_ diff --git a/storage/stonedb/core/value_matching_hashtable.cpp b/storage/tianmu/core/value_matching_hashtable.cpp similarity index 99% rename from storage/stonedb/core/value_matching_hashtable.cpp rename to storage/tianmu/core/value_matching_hashtable.cpp index 451e398d5b..13880dc077 100644 --- a/storage/stonedb/core/value_matching_hashtable.cpp +++ b/storage/tianmu/core/value_matching_hashtable.cpp @@ -19,7 +19,7 @@ #include "core/bin_tools.h" -namespace stonedb { +namespace Tianmu { namespace core { ValueMatching_HashTable::ValueMatching_HashTable() { @@ -156,4 +156,4 @@ bool ValueMatching_HashTable::FindCurrentRow(unsigned char *input_buffer, int64_ } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/value_matching_hashtable.h b/storage/tianmu/core/value_matching_hashtable.h similarity index 94% rename from storage/stonedb/core/value_matching_hashtable.h rename to storage/tianmu/core/value_matching_hashtable.h index 9107ba51dd..7a14b69f1c 100644 --- a/storage/stonedb/core/value_matching_hashtable.h +++ b/storage/tianmu/core/value_matching_hashtable.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_VALUE_MATCHING_HASHTABLE_H_ -#define STONEDB_CORE_VALUE_MATCHING_HASHTABLE_H_ +#ifndef TIANMU_CORE_VALUE_MATCHING_HASHTABLE_H_ +#define TIANMU_CORE_VALUE_MATCHING_HASHTABLE_H_ #pragma once #include "core/blocked_mem_table.h" #include "core/value_matching_table.h" -namespace stonedb { +namespace Tianmu { namespace core { // Expandable hash table @@ -82,6 +82,6 @@ class ValueMatching_HashTable : public mm::TraceableObject, public ValueMatching }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_VALUE_MATCHING_HASHTABLE_H_ +#endif // TIANMU_CORE_VALUE_MATCHING_HASHTABLE_H_ diff --git a/storage/stonedb/core/value_matching_table.cpp b/storage/tianmu/core/value_matching_table.cpp similarity index 99% rename from storage/stonedb/core/value_matching_table.cpp rename to storage/tianmu/core/value_matching_table.cpp index dda424a8a8..fc74d4fe7e 100644 --- a/storage/stonedb/core/value_matching_table.cpp +++ b/storage/tianmu/core/value_matching_table.cpp @@ -19,7 +19,7 @@ #include "core/value_matching_hashtable.h" -namespace stonedb { +namespace Tianmu { namespace core { ValueMatchingTable::ValueMatchingTable() { total_width = 0; @@ -198,4 +198,4 @@ bool ValueMatching_LookupTable::SetEndRow(int64_t row) { } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/value_matching_table.h b/storage/tianmu/core/value_matching_table.h similarity index 97% rename from storage/stonedb/core/value_matching_table.h rename to storage/tianmu/core/value_matching_table.h index 9031612a71..b336b6c0ac 100644 --- a/storage/stonedb/core/value_matching_table.h +++ b/storage/tianmu/core/value_matching_table.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_VALUE_MATCHING_TABLE_H_ -#define STONEDB_CORE_VALUE_MATCHING_TABLE_H_ +#ifndef TIANMU_CORE_VALUE_MATCHING_TABLE_H_ +#define TIANMU_CORE_VALUE_MATCHING_TABLE_H_ #pragma once #include "core/bin_tools.h" #include "core/filter.h" #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace core { // A structure to store large data rows consisting of and // , divided into "columns" defined as byte offsets. Functionality: @@ -176,6 +176,6 @@ class ValueMatching_LookupTable : public mm::TraceableObject, public ValueMatchi int64_t occupied_iterator; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_VALUE_MATCHING_TABLE_H_ +#endif // TIANMU_CORE_VALUE_MATCHING_TABLE_H_ diff --git a/storage/stonedb/core/value_or_null.cpp b/storage/tianmu/core/value_or_null.cpp similarity index 98% rename from storage/stonedb/core/value_or_null.cpp rename to storage/tianmu/core/value_or_null.cpp index cb9d1d4ed4..e988452ee2 100644 --- a/storage/stonedb/core/value_or_null.cpp +++ b/storage/tianmu/core/value_or_null.cpp @@ -20,7 +20,7 @@ #include "common/assert.h" #include "types/rc_num.h" -namespace stonedb { +namespace Tianmu { namespace core { void ValueOrNull::SetBString(const types::BString &rcs) { Clear(); @@ -108,4 +108,4 @@ void ValueOrNull::Swap(ValueOrNull &von) { } } } // namespace core -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/core/value_or_null.h b/storage/tianmu/core/value_or_null.h similarity index 94% rename from storage/stonedb/core/value_or_null.h rename to storage/tianmu/core/value_or_null.h index 30e75507ce..9b912e20a7 100644 --- a/storage/stonedb/core/value_or_null.h +++ b/storage/tianmu/core/value_or_null.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_VALUE_OR_NULL_H_ -#define STONEDB_CORE_VALUE_OR_NULL_H_ +#ifndef TIANMU_CORE_VALUE_OR_NULL_H_ +#define TIANMU_CORE_VALUE_OR_NULL_H_ #pragma once #include @@ -23,10 +23,10 @@ #include "common/common_definitions.h" #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace core { class ValueOrNull final { - friend class Item_sdbfield; + friend class Item_tianmufield; public: ValueOrNull() : x(common::NULL_VALUE_64), null(true) {} @@ -112,6 +112,6 @@ class ValueOrNull final { } }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_VALUE_OR_NULL_H_ \ No newline at end of file +#endif // TIANMU_CORE_VALUE_OR_NULL_H_ \ No newline at end of file diff --git a/storage/stonedb/core/value_set.cpp b/storage/tianmu/core/value_set.cpp similarity index 99% rename from storage/stonedb/core/value_set.cpp rename to storage/tianmu/core/value_set.cpp index 20fc5ae2bd..3189af3ce2 100644 --- a/storage/stonedb/core/value_set.cpp +++ b/storage/tianmu/core/value_set.cpp @@ -23,7 +23,7 @@ #include "value_set.h" -namespace stonedb { +namespace Tianmu { namespace core { ValueSet::ValueSet(uint32_t power) { prepared = false; @@ -505,4 +505,4 @@ bool ValueSet::CopyCondition([[maybe_unused]] common::CT at, std::shared_ptr @@ -23,7 +23,7 @@ #include "common/common_definitions.h" #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace types { class RCDataType; @@ -122,6 +122,6 @@ class ValueSet { typedef decltype(values)::const_iterator const_iterator; }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_VALUE_SET_H_ +#endif // TIANMU_CORE_VALUE_SET_H_ diff --git a/storage/stonedb/core/var_id.h b/storage/tianmu/core/var_id.h similarity index 89% rename from storage/stonedb/core/var_id.h rename to storage/tianmu/core/var_id.h index 23014f4e71..8188220cb0 100644 --- a/storage/stonedb/core/var_id.h +++ b/storage/tianmu/core/var_id.h @@ -14,11 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_CORE_VAR_ID_H_ -#define STONEDB_CORE_VAR_ID_H_ +#ifndef TIANMU_CORE_VAR_ID_H_ +#define TIANMU_CORE_VAR_ID_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace core { struct VarID { int tab; @@ -31,6 +31,6 @@ struct VarID { }; } // namespace core -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_CORE_VAR_ID_H_ +#endif // TIANMU_CORE_VAR_ID_H_ diff --git a/storage/stonedb/exporter/data_exporter.cpp b/storage/tianmu/exporter/data_exporter.cpp similarity index 97% rename from storage/stonedb/exporter/data_exporter.cpp rename to storage/tianmu/exporter/data_exporter.cpp index 04631ecac1..babc9f6031 100644 --- a/storage/stonedb/exporter/data_exporter.cpp +++ b/storage/tianmu/exporter/data_exporter.cpp @@ -22,7 +22,7 @@ #include "core/rc_attr.h" #include "system/large_buffer.h" -namespace stonedb { +namespace Tianmu { namespace exporter { void DataExporter::Init(std::shared_ptr buffer, std::vector source_deas, @@ -49,4 +49,4 @@ void DataExporter::Init(std::shared_ptr buffer, std::vector DataExporter::~DataExporter() {} } // namespace exporter -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/exporter/data_exporter.h b/storage/tianmu/exporter/data_exporter.h similarity index 92% rename from storage/stonedb/exporter/data_exporter.h rename to storage/tianmu/exporter/data_exporter.h index a6193447c7..23dd514bea 100644 --- a/storage/stonedb/exporter/data_exporter.h +++ b/storage/tianmu/exporter/data_exporter.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_EXPORTER_DATA_EXPORTER_H_ -#define STONEDB_EXPORTER_DATA_EXPORTER_H_ +#ifndef TIANMU_EXPORTER_DATA_EXPORTER_H_ +#define TIANMU_EXPORTER_DATA_EXPORTER_H_ #pragma once #include "common/common_definitions.h" @@ -24,7 +24,7 @@ #include "system/large_buffer.h" #include "system/txt_utils.h" -namespace stonedb { +namespace Tianmu { namespace exporter { class DataExporter { @@ -65,6 +65,6 @@ class DataExporter { }; } // namespace exporter -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_EXPORTER_DATA_EXPORTER_H_ +#endif // TIANMU_EXPORTER_DATA_EXPORTER_H_ diff --git a/storage/stonedb/exporter/data_exporter_txt.cpp b/storage/tianmu/exporter/data_exporter_txt.cpp similarity index 99% rename from storage/stonedb/exporter/data_exporter_txt.cpp rename to storage/tianmu/exporter/data_exporter_txt.cpp index 804e22e9db..21a3c95205 100644 --- a/storage/stonedb/exporter/data_exporter_txt.cpp +++ b/storage/tianmu/exporter/data_exporter_txt.cpp @@ -19,7 +19,7 @@ #include "types/rc_num.h" -namespace stonedb { +namespace Tianmu { namespace exporter { DEforTxt::DEforTxt(const system::IOParameters &iop) @@ -127,4 +127,4 @@ size_t DEforTxt::WriteString(const types::BString &str, int len) { } } // namespace exporter -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/exporter/data_exporter_txt.h b/storage/tianmu/exporter/data_exporter_txt.h similarity index 91% rename from storage/stonedb/exporter/data_exporter_txt.h rename to storage/tianmu/exporter/data_exporter_txt.h index 7e930bb037..390a6c671a 100644 --- a/storage/stonedb/exporter/data_exporter_txt.h +++ b/storage/tianmu/exporter/data_exporter_txt.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_EXPORTER_DATA_EXPORTER_TXT_H_ -#define STONEDB_EXPORTER_DATA_EXPORTER_TXT_H_ +#ifndef TIANMU_EXPORTER_DATA_EXPORTER_TXT_H_ +#define TIANMU_EXPORTER_DATA_EXPORTER_TXT_H_ #pragma once #include "exporter/data_exporter.h" #include "system/io_parameters.h" -namespace stonedb { +namespace Tianmu { namespace exporter { class DEforTxt : public DataExporter { @@ -67,6 +67,6 @@ class DEforTxt : public DataExporter { }; } // namespace exporter -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_EXPORTER_DATA_EXPORTER_TXT_H_ +#endif // TIANMU_EXPORTER_DATA_EXPORTER_TXT_H_ diff --git a/storage/stonedb/exporter/export2file.cpp b/storage/tianmu/exporter/export2file.cpp similarity index 81% rename from storage/stonedb/exporter/export2file.cpp rename to storage/tianmu/exporter/export2file.cpp index f0e1c2f5ce..ff94fd530c 100644 --- a/storage/stonedb/exporter/export2file.cpp +++ b/storage/tianmu/exporter/export2file.cpp @@ -20,13 +20,13 @@ #include "common/assert.h" #include "core/engine.h" -namespace stonedb { +namespace Tianmu { namespace exporter { -select_sdb_export::select_sdb_export(Query_result_export *se) +select_tianmu_export::select_tianmu_export(Query_result_export *se) : Query_result_export(se->get_sql_exchange()), se(se), prepared(false) {} -int select_sdb_export::prepare(List &list, SELECT_LEX_UNIT *u) { +int select_tianmu_export::prepare(List &list, SELECT_LEX_UNIT *u) { bool blob_flag = 0; unit = u; { @@ -56,13 +56,13 @@ int select_sdb_export::prepare(List &list, SELECT_LEX_UNIT *u) { return 0; } -void select_sdb_export::SetRowCount(ha_rows x) { row_count = x; } +void select_tianmu_export::SetRowCount(ha_rows x) { row_count = x; } -void select_sdb_export::SendOk(THD *thd) { ::my_ok(thd, row_count); } +void select_tianmu_export::SendOk(THD *thd) { ::my_ok(thd, row_count); } -sql_exchange *select_sdb_export::SqlExchange() { return exchange; } +sql_exchange *select_tianmu_export::SqlExchange() { return exchange; } -bool select_sdb_export::send_data(List &items) { return se->send_data(items); } +bool select_tianmu_export::send_data(List &items) { return se->send_data(items); } } // namespace exporter -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/exporter/export2file.h b/storage/tianmu/exporter/export2file.h similarity index 77% rename from storage/stonedb/exporter/export2file.h rename to storage/tianmu/exporter/export2file.h index 3c4f9e62e7..4035bc1524 100644 --- a/storage/stonedb/exporter/export2file.h +++ b/storage/tianmu/exporter/export2file.h @@ -14,21 +14,21 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_EXPORTER_EXPORT2FILE_H_ -#define STONEDB_EXPORTER_EXPORT2FILE_H_ +#ifndef TIANMU_EXPORTER_EXPORT2FILE_H_ +#define TIANMU_EXPORTER_EXPORT2FILE_H_ #pragma once #include "core/temp_table.h" #include "system/io_parameters.h" -namespace stonedb { +namespace Tianmu { namespace exporter { -class select_sdb_export : public Query_result_export { +class select_tianmu_export : public Query_result_export { public: - // select_sdb_export(sql_exchange *ex); - select_sdb_export(Query_result_export *se); - ~select_sdb_export(){}; + // select_tianmu_export(sql_exchange *ex); + select_tianmu_export(Query_result_export *se); + ~select_tianmu_export(){}; int prepare(List &list, SELECT_LEX_UNIT *u) override; void SetRowCount(ha_rows x); void SendOk(THD *thd); @@ -42,6 +42,6 @@ class select_sdb_export : public Query_result_export { }; } // namespace exporter -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_EXPORTER_EXPORT2FILE_H_ +#endif // TIANMU_EXPORTER_EXPORT2FILE_H_ diff --git a/storage/stonedb/handler/ha_rcengine.cpp b/storage/tianmu/handler/ha_rcengine.cpp similarity index 55% rename from storage/stonedb/handler/ha_rcengine.cpp rename to storage/tianmu/handler/ha_rcengine.cpp index 22ad0aae4e..a205a18421 100644 --- a/storage/stonedb/handler/ha_rcengine.cpp +++ b/storage/tianmu/handler/ha_rcengine.cpp @@ -22,38 +22,38 @@ #include "util/log_ctl.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace dbhandler { -enum class SDBEngineReturnValues { LD_Successed = 100, LD_Failed = 101, LD_Continue = 102 }; +enum class TIANMUEngineReturnValues { LD_Successed = 100, LD_Failed = 101, LD_Continue = 102 }; -void SDB_UpdateAndStoreColumnComment(TABLE *table, int field_id, Field *source_field, int source_field_id, +void TIANMU_UpdateAndStoreColumnComment(TABLE *table, int field_id, Field *source_field, int source_field_id, CHARSET_INFO *cs) { try { rceng->UpdateAndStoreColumnComment(table, field_id, source_field, source_field_id, cs); } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s.", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } } namespace { -bool AtLeastOneSDBTableInvolved(LEX *lex) { +bool AtLeastOneTIANMUTableInvolved(LEX *lex) { for (TABLE_LIST *table_list = lex->query_tables; table_list; table_list = table_list->next_global) { TABLE *table = table_list->table; - if (core::Engine::IsSDBTable(table)) return TRUE; + if (core::Engine::IsTIANMUTable(table)) return TRUE; } return FALSE; } -bool ForbiddenMySQLQueryPath([[maybe_unused]] LEX *lex) { return (stonedb_sysvar_allowmysqlquerypath == 0); } +bool ForbiddenMySQLQueryPath([[maybe_unused]] LEX *lex) { return (tianmu_sysvar_allowmysqlquerypath == 0); } } // namespace -bool SDB_SetStatementAllowed(THD *thd, LEX *lex) { - if (AtLeastOneSDBTableInvolved(lex)) { +bool TIANMU_SetStatementAllowed(THD *thd, LEX *lex) { + if (AtLeastOneTIANMUTableInvolved(lex)) { if (ForbiddenMySQLQueryPath(lex)) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "Queries inside SET statements are not supported. " @@ -64,23 +64,23 @@ bool SDB_SetStatementAllowed(THD *thd, LEX *lex) { return false; } else push_warning(thd, Sql_condition::SL_NOTE, ER_UNKNOWN_ERROR, - "SET statement not supported by the StoneDB Optimizer. The " + "SET statement not supported by the Tianmu Optimizer. The " "query executed " "by MySQL engine."); } return true; } -int SDB_HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_tables_done_option, int &res, - int &optimize_after_sdb, int &sdb_free_join, int with_insert=false) { +int TIANMU_HandleSelect(THD *thd, LEX *lex, Query_result *&result, ulong setup_tables_done_option, int &res, + int &optimize_after_tianmu, int &tianmu_free_join, int with_insert=false) { int ret = RCBASE_QUERY_ROUTE; try { // handle_select_ret is introduced here because in case of some exceptions // (e.g. thrown from ForbiddenMySQLQueryPath) we want to return // RCBASE_QUERY_ROUTE - int handle_select_ret = rceng->HandleSelect(thd, lex, result, setup_tables_done_option, res, optimize_after_sdb, - sdb_free_join, with_insert); - if (handle_select_ret == RETURN_QUERY_TO_MYSQL_ROUTE && AtLeastOneSDBTableInvolved(lex) && + int handle_select_ret = rceng->HandleSelect(thd, lex, result, setup_tables_done_option, res, optimize_after_tianmu, + tianmu_free_join, with_insert); + if (handle_select_ret == RETURN_QUERY_TO_MYSQL_ROUTE && AtLeastOneTIANMUTableInvolved(lex) && ForbiddenMySQLQueryPath(lex)) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "The query includes syntax that is not supported by the storage engine. \ @@ -91,58 +91,58 @@ Either restructure the query with supported syntax, or enable the MySQL core::Qu ret = handle_select_ret; } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "HandleSelect Error: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "HandleSelect Error: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } return ret; } -int SDB_LoadData(THD *thd, sql_exchange *ex, TABLE_LIST *table_list, void *arg, char *errmsg, int len, int &errcode) { - common::SDBError sdb_error; - int ret = static_cast(SDBEngineReturnValues::LD_Failed); +int TIANMU_LoadData(THD *thd, sql_exchange *ex, TABLE_LIST *table_list, void *arg, char *errmsg, int len, int &errcode) { + common::TIANMUError tianmu_error; + int ret = static_cast(TIANMUEngineReturnValues::LD_Failed); - if (!core::Engine::IsSDBTable(table_list->table)) return static_cast(SDBEngineReturnValues::LD_Continue); + if (!core::Engine::IsTIANMUTable(table_list->table)) return static_cast(TIANMUEngineReturnValues::LD_Continue); try { - sdb_error = rceng->RunLoader(thd, ex, table_list, arg); - if (sdb_error.GetErrorCode() != common::ErrorCode::SUCCESS) { - STONEDB_LOG(LogCtl_Level::ERROR, "RunLoader Error: %s", sdb_error.Message().c_str()); + tianmu_error = rceng->RunLoader(thd, ex, table_list, arg); + if (tianmu_error.GetErrorCode() != common::ErrorCode::SUCCESS) { + TIANMU_LOG(LogCtl_Level::ERROR, "RunLoader Error: %s", tianmu_error.Message().c_str()); } else { - ret = static_cast(SDBEngineReturnValues::LD_Successed); + ret = static_cast(TIANMUEngineReturnValues::LD_Successed); } } catch (std::exception &e) { - sdb_error = common::SDBError(common::ErrorCode::UNKNOWN_ERROR, e.what()); - STONEDB_LOG(LogCtl_Level::ERROR, "RunLoader Error: %s", sdb_error.Message().c_str()); + tianmu_error = common::TIANMUError(common::ErrorCode::UNKNOWN_ERROR, e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "RunLoader Error: %s", tianmu_error.Message().c_str()); } catch (...) { - sdb_error = common::SDBError(common::ErrorCode::UNKNOWN_ERROR, "An unknown system exception error caught."); - STONEDB_LOG(LogCtl_Level::ERROR, "RunLoader Error: %s", sdb_error.Message().c_str()); + tianmu_error = common::TIANMUError(common::ErrorCode::UNKNOWN_ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "RunLoader Error: %s", tianmu_error.Message().c_str()); } - std::strncpy(errmsg, sdb_error.Message().c_str(), len - 1); + std::strncpy(errmsg, tianmu_error.Message().c_str(), len - 1); errmsg[len - 1] = '\0'; - errcode = (int)sdb_error.GetErrorCode(); + errcode = (int)tianmu_error.GetErrorCode(); return ret; } // returning true means 'to continue' -bool stonedb_load(THD *thd, sql_exchange *ex, TABLE_LIST *table_list, void *arg) { - char sdbmsg[256]; - int sdberrcode; - switch (static_cast(SDB_LoadData(thd, ex, table_list, arg, sdbmsg, 256, sdberrcode))) { - case SDBEngineReturnValues::LD_Continue: +bool tianmu_load(THD *thd, sql_exchange *ex, TABLE_LIST *table_list, void *arg) { + char tianmumsg[256]; + int tianmu_errcode; + switch (static_cast(TIANMU_LoadData(thd, ex, table_list, arg, tianmumsg, 256, tianmu_errcode))) { + case TIANMUEngineReturnValues::LD_Continue: return true; - case SDBEngineReturnValues::LD_Failed: - my_message(sdberrcode, sdbmsg, MYF(0)); + case TIANMUEngineReturnValues::LD_Failed: + my_message(tianmu_errcode, tianmumsg, MYF(0)); [[fallthrough]]; - case SDBEngineReturnValues::LD_Successed: + case TIANMUEngineReturnValues::LD_Successed: return false; default: - my_message(sdberrcode, sdbmsg, MYF(0)); + my_message(tianmu_errcode, tianmumsg, MYF(0)); break; } return false; } } // namespace dbhandler -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/handler/ha_rcengine.h b/storage/tianmu/handler/ha_rcengine.h similarity index 57% rename from storage/stonedb/handler/ha_rcengine.h rename to storage/tianmu/handler/ha_rcengine.h index 0c2f9cc3f5..81194dfe2d 100644 --- a/storage/stonedb/handler/ha_rcengine.h +++ b/storage/tianmu/handler/ha_rcengine.h @@ -14,24 +14,24 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_HANDLER_HA_RCENGINE_H_ -#define STONEDB_HANDLER_HA_RCENGINE_H_ +#ifndef TIANMU_HANDLER_HA_RCENGINE_H_ +#define TIANMU_HANDLER_HA_RCENGINE_H_ #pragma once -// mysql <--> sdb interface functions -namespace stonedb { +// mysql <--> tianmu interface functions +namespace Tianmu { namespace dbhandler { -void SDB_UpdateAndStoreColumnComment(TABLE *table, int field_id, Field *source_field, int source_field_id, +void TIANMU_UpdateAndStoreColumnComment(TABLE *table, int field_id, Field *source_field, int source_field_id, CHARSET_INFO *cs); -bool SDB_SetStatementAllowed(THD *thd, LEX *lex); +bool TIANMU_SetStatementAllowed(THD *thd, LEX *lex); -int SDB_HandleSelect(THD *thd, LEX *lex, Query_result *&result_output, ulong setup_tables_done_option, int &res, - int &optimize_after_sdb, int &sdb_free_join, int with_insert = false); -bool stonedb_load(THD *thd, sql_exchange *ex, TABLE_LIST *table_list, void *arg); +int TIANMU_HandleSelect(THD *thd, LEX *lex, Query_result *&result_output, ulong setup_tables_done_option, int &res, + int &optimize_after_tianmu, int &tianmu_free_join, int with_insert = false); +bool tianmu_load(THD *thd, sql_exchange *ex, TABLE_LIST *table_list, void *arg); } // namespace dbhandler -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_HANDLER_HA_RCENGINE_H_ +#endif // TIANMU_HANDLER_HA_RCENGINE_H_ diff --git a/storage/stonedb/handler/stonedb_handler.cpp b/storage/tianmu/handler/tianmu_handler.cpp similarity index 83% rename from storage/stonedb/handler/stonedb_handler.cpp rename to storage/tianmu/handler/tianmu_handler.cpp index 6aa314d6e3..1162420db5 100644 --- a/storage/stonedb/handler/stonedb_handler.cpp +++ b/storage/tianmu/handler/tianmu_handler.cpp @@ -15,7 +15,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "stonedb_handler.h" +#include "tianmu_handler.h" #include @@ -34,12 +34,12 @@ #define MYSQL_SERVER 1 -namespace stonedb { +namespace Tianmu { namespace dbhandler { -const Alter_inplace_info::HA_ALTER_FLAGS StonedbHandler::STONEDB_SUPPORTED_ALTER_ADD_DROP_ORDER = +const Alter_inplace_info::HA_ALTER_FLAGS TianmuHandler::TIANMU_SUPPORTED_ALTER_ADD_DROP_ORDER = Alter_inplace_info::ADD_COLUMN | Alter_inplace_info::DROP_COLUMN | Alter_inplace_info::ALTER_STORED_COLUMN_ORDER; -const Alter_inplace_info::HA_ALTER_FLAGS StonedbHandler::STONEDB_SUPPORTED_ALTER_COLUMN_NAME = +const Alter_inplace_info::HA_ALTER_FLAGS TianmuHandler::TIANMU_SUPPORTED_ALTER_COLUMN_NAME = Alter_inplace_info::ALTER_COLUMN_DEFAULT | Alter_inplace_info::ALTER_COLUMN_NAME; ///////////////////////////////////////////////////////////////////// // @@ -155,12 +155,12 @@ static core::Value GetValueFromField(Field *f) { return v; } -StonedbHandler::StonedbHandler(handlerton *hton, TABLE_SHARE *table_arg) : handler(hton, table_arg) { +TianmuHandler::TianmuHandler(handlerton *hton, TABLE_SHARE *table_arg) : handler(hton, table_arg) { ref_length = sizeof(uint64_t); } -const char **StonedbHandler::bas_ext() const { - static const char *ha_rcbase_exts[] = {common::STONEDB_EXT, 0}; +const char **TianmuHandler::bas_ext() const { + static const char *ha_rcbase_exts[] = {common::TIANMU_EXT, 0}; return ha_rcbase_exts; } @@ -179,7 +179,7 @@ std::vector GetAttrsUseIndicator(TABLE *table) { } // namespace static bool is_delay_insert(THD *thd) { - return stonedb_sysvar_insert_delayed && + return tianmu_sysvar_insert_delayed && (thd_sql_command(thd) == SQLCOM_INSERT || thd_sql_command(thd) == SQLCOM_INSERT_SELECT) && thd->lex->duplicates != DUP_UPDATE; } @@ -213,7 +213,7 @@ static bool is_delay_insert(THD *thd) { Called from lock.cc by get_lock_data(). */ -THR_LOCK_DATA **StonedbHandler::store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) { +THR_LOCK_DATA **TianmuHandler::store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) { if (lock_type >= TL_WRITE_CONCURRENT_INSERT && lock_type <= TL_WRITE) { if (is_delay_insert(thd)) lock_type = TL_READ; @@ -237,7 +237,7 @@ THR_LOCK_DATA **StonedbHandler::store_lock(THD *thd, THR_LOCK_DATA **to, enum th Called from lock.cc by lock_external() and unlock_external(). Also called from sql_table.cc by copy_data_between_tables(). */ -int StonedbHandler::external_lock(THD *thd, int lock_type) { +int TianmuHandler::external_lock(THD *thd, int lock_type) { DBUG_ENTER(__PRETTY_FUNCTION__); int ret = 1; @@ -275,11 +275,11 @@ int StonedbHandler::external_lock(THD *thd, int lock_type) { } ret = 0; } catch (std::exception &e) { - my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "StoneDB internal error", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s.", e.what()); + my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "Tianmu internal error", MYF(0)); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s.", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } // destroy the tx on failure @@ -406,7 +406,7 @@ inline bool has_dup_key(std::shared_ptr &indextab, TABLE *t Called from item_sum.cc, item_sum.cc, sql_acl.cc, sql_insert.cc, sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc, and sql_update.cc. */ -int StonedbHandler::write_row([[maybe_unused]] uchar *buf) { +int TianmuHandler::write_row([[maybe_unused]] uchar *buf) { int ret = 1; DBUG_ENTER(__PRETTY_FUNCTION__); try { @@ -422,24 +422,24 @@ int StonedbHandler::write_row([[maybe_unused]] uchar *buf) { } catch (common::OutOfMemoryException &e) { DBUG_RETURN(ER_LOCK_WAIT_TIMEOUT); } catch (common::DatabaseException &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught in Engine::InsertRow: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught in Engine::InsertRow: %s.", e.what()); my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); } catch (common::FormatException &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught in Engine::InsertRow: %s Row: %ld, field %u.", e.what(), + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught in Engine::InsertRow: %s Row: %ld, field %u.", e.what(), e.m_row_no, e.m_field_no); my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); } catch (common::FileException &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught in Engine::InsertRow: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught in Engine::InsertRow: %s.", e.what()); my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); } catch (common::Exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught in Engine::InsertRow: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught in Engine::InsertRow: %s.", e.what()); my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught in Engine::InsertRow: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught in Engine::InsertRow: %s.", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } DBUG_RETURN(ret); } @@ -459,7 +459,7 @@ int StonedbHandler::write_row([[maybe_unused]] uchar *buf) { Called from sql_select.cc, sql_acl.cc, sql_update.cc, and sql_insert.cc. */ -int StonedbHandler::update_row(const uchar *old_data, uchar *new_data) { +int TianmuHandler::update_row(const uchar *old_data, uchar *new_data) { DBUG_ENTER(__PRETTY_FUNCTION__); int ret = HA_ERR_INTERNAL_ERROR; auto org_bitmap = dbug_tmp_use_all_columns(table, table->write_set); @@ -496,21 +496,21 @@ int StonedbHandler::update_row(const uchar *old_data, uchar *new_data) { tab->UpdateItem(current_position, i, v); } } - rceng->IncStonedbStatUpdate(); + rceng->IncTianmuStatUpdate(); DBUG_RETURN(0); } catch (common::DatabaseException &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Update exception: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Update exception: %s.", e.what()); } catch (common::FileException &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Update exception: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Update exception: %s.", e.what()); } catch (common::DupKeyException &e) { ret = HA_ERR_FOUND_DUPP_KEY; - STONEDB_LOG(LogCtl_Level::ERROR, "Update exception: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Update exception: %s.", e.what()); } catch (common::Exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Update exception: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Update exception: %s.", e.what()); } catch (std::exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Update exception: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Update exception: %s.", e.what()); } catch (...) { - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } DBUG_RETURN(ret); } @@ -528,7 +528,7 @@ int StonedbHandler::update_row(const uchar *old_data, uchar *new_data) { Called in sql_delete.cc, sql_insert.cc, and sql_select.cc. In sql_select it is used for removing duplicates while in insert it is used for REPLACE calls. */ -int StonedbHandler::delete_row([[maybe_unused]] const uchar *buf) { +int TianmuHandler::delete_row([[maybe_unused]] const uchar *buf) { DBUG_ENTER(__PRETTY_FUNCTION__); DBUG_RETURN(HA_ERR_WRONG_COMMAND); } @@ -544,26 +544,26 @@ int StonedbHandler::delete_row([[maybe_unused]] const uchar *buf) { Called from sql_select.cc by JOIN::rein*it. Called from sql_union.cc by st_select_lex_unit::exec(). */ -int StonedbHandler::delete_all_rows() { +int TianmuHandler::delete_all_rows() { DBUG_ENTER(__PRETTY_FUNCTION__); DBUG_RETURN(HA_ERR_WRONG_COMMAND); } -int StonedbHandler::rename_table(const char *from, const char *to) { +int TianmuHandler::rename_table(const char *from, const char *to) { try { rceng->RenameTable(current_tx, from, to, ha_thd()); return 0; } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } return 1; } -void StonedbHandler::update_create_info([[maybe_unused]] HA_CREATE_INFO *create_info) {} +void TianmuHandler::update_create_info([[maybe_unused]] HA_CREATE_INFO *create_info) {} /* ::info() is used to return information to the optimizer. @@ -610,7 +610,7 @@ void StonedbHandler::update_create_info([[maybe_unused]] HA_CREATE_INFO *create_ sql_update.cc */ -int StonedbHandler::info(uint flag) { +int TianmuHandler::info(uint flag) { DBUG_ENTER(__PRETTY_FUNCTION__); int ret = 1; try { @@ -644,17 +644,17 @@ int StonedbHandler::info(uint flag) { ret = 0; } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } DBUG_RETURN(ret); } /* this should return 0 for concurrent insert to work */ -my_bool stonedb_check_status([[maybe_unused]] void *param) { return 0; } +my_bool tianmu_check_status([[maybe_unused]] void *param) { return 0; } /* Used for opening tables. The name will be the name of the file. @@ -665,7 +665,7 @@ my_bool stonedb_check_status([[maybe_unused]] void *param) { return 0; } Called from handler.cc by handler::ha_open(). The server opens all tables by calling ha_open() which then calls the handler specific open(). */ -int StonedbHandler::open(const char *name, [[maybe_unused]] int mode, [[maybe_unused]] uint test_if_locked) { +int TianmuHandler::open(const char *name, [[maybe_unused]] int mode, [[maybe_unused]] uint test_if_locked) { DBUG_ENTER(__PRETTY_FUNCTION__); m_table_name = name; @@ -680,20 +680,20 @@ int StonedbHandler::open(const char *name, [[maybe_unused]] int mode, [[maybe_un if (!(share = rceng->GetTableShare(table_share))) DBUG_RETURN(ret); thr_lock_data_init(&share->thr_lock, &m_lock, NULL); - share->thr_lock.check_status = stonedb_check_status; + share->thr_lock.check_status = tianmu_check_status; // have primary key, use table index if (table->s->primary_key != MAX_INDEXES) rceng->AddTableIndex(name, table, ha_thd()); rceng->AddMemTable(table, share); ret = 0; } catch (common::Exception &e) { - my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "Error from StoneDB engine", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "A stonedb exception is caught: %s", e.what()); + my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "Error from Tianmu engine", MYF(0)); + TIANMU_LOG(LogCtl_Level::ERROR, "A tianmu exception is caught: %s", e.what()); } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } info(HA_STATUS_CONST); @@ -701,7 +701,7 @@ int StonedbHandler::open(const char *name, [[maybe_unused]] int mode, [[maybe_un DBUG_RETURN(ret); } -int StonedbHandler::free_share() { +int TianmuHandler::free_share() { share.reset(); return 0; } @@ -716,12 +716,12 @@ int StonedbHandler::free_share() { myisam table. For sql_base.cc look at close_data_tables(). */ -int StonedbHandler::close() { +int TianmuHandler::close() { DBUG_ENTER(__PRETTY_FUNCTION__); DBUG_RETURN(free_share()); } -int StonedbHandler::fill_row_by_id([[maybe_unused]] uchar *buf, uint64_t rowid) { +int TianmuHandler::fill_row_by_id([[maybe_unused]] uchar *buf, uint64_t rowid) { DBUG_ENTER(__PRETTY_FUNCTION__); int rc = HA_ERR_KEY_NOT_FOUND; try { @@ -737,18 +737,18 @@ int StonedbHandler::fill_row_by_id([[maybe_unused]] uchar *buf, uint64_t rowid) } } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } DBUG_RETURN(rc); } -int StonedbHandler::index_init(uint index, [[maybe_unused]] bool sorted) { +int TianmuHandler::index_init(uint index, [[maybe_unused]] bool sorted) { DBUG_ENTER(__PRETTY_FUNCTION__); active_index = index; DBUG_RETURN(0); } -int StonedbHandler::index_end() { +int TianmuHandler::index_end() { DBUG_ENTER(__PRETTY_FUNCTION__); active_index = MAX_KEY; DBUG_RETURN(0); @@ -759,7 +759,7 @@ int StonedbHandler::index_end() { row if available. If the key value is null, begin at the first key of the index. */ -int StonedbHandler::index_read([[maybe_unused]] uchar *buf, [[maybe_unused]] const uchar *key, +int TianmuHandler::index_read([[maybe_unused]] uchar *buf, [[maybe_unused]] const uchar *key, [[maybe_unused]] uint key_len __attribute__((unused)), enum ha_rkey_function find_flag __attribute__((unused))) { DBUG_ENTER(__PRETTY_FUNCTION__); @@ -786,18 +786,18 @@ int StonedbHandler::index_read([[maybe_unused]] uchar *buf, [[maybe_unused]] con } else { // not support HA_READ_PREFIX_LAST_OR_PREV HA_READ_PREFIX_LAST rc = HA_ERR_WRONG_COMMAND; - STONEDB_LOG(LogCtl_Level::ERROR, "Error: index_read not support prefix search"); + TIANMU_LOG(LogCtl_Level::ERROR, "Error: index_read not support prefix search"); } } else { // other index not support rc = HA_ERR_WRONG_INDEX; - STONEDB_LOG(LogCtl_Level::ERROR, "Error: index_read only support primary key"); + TIANMU_LOG(LogCtl_Level::ERROR, "Error: index_read only support primary key"); } } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } DBUG_RETURN(rc); @@ -806,7 +806,7 @@ int StonedbHandler::index_read([[maybe_unused]] uchar *buf, [[maybe_unused]] con /* Used to read forward through the index. */ -int StonedbHandler::index_next([[maybe_unused]] uchar *buf) { +int TianmuHandler::index_next([[maybe_unused]] uchar *buf) { DBUG_ENTER(__PRETTY_FUNCTION__); int rc = HA_ERR_END_OF_FILE; try { @@ -821,7 +821,7 @@ int StonedbHandler::index_next([[maybe_unused]] uchar *buf) { } } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } DBUG_RETURN(rc); } @@ -829,7 +829,7 @@ int StonedbHandler::index_next([[maybe_unused]] uchar *buf) { /* Used to read backwards through the index. */ -int StonedbHandler::index_prev([[maybe_unused]] uchar *buf) { +int TianmuHandler::index_prev([[maybe_unused]] uchar *buf) { DBUG_ENTER(__PRETTY_FUNCTION__); int rc = HA_ERR_END_OF_FILE; try { @@ -844,7 +844,7 @@ int StonedbHandler::index_prev([[maybe_unused]] uchar *buf) { } } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } DBUG_RETURN(rc); } @@ -855,7 +855,7 @@ int StonedbHandler::index_prev([[maybe_unused]] uchar *buf) { Called from opt_range.cc, opt_sum.cc, sql_handler.cc, and sql_select.cc. */ -int StonedbHandler::index_first([[maybe_unused]] uchar *buf) { +int TianmuHandler::index_first([[maybe_unused]] uchar *buf) { DBUG_ENTER(__PRETTY_FUNCTION__); int rc = HA_ERR_END_OF_FILE; try { @@ -873,7 +873,7 @@ int StonedbHandler::index_first([[maybe_unused]] uchar *buf) { } } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } DBUG_RETURN(rc); } @@ -884,7 +884,7 @@ int StonedbHandler::index_first([[maybe_unused]] uchar *buf) { Called from opt_range.cc, opt_sum.cc, sql_handler.cc, and sql_select.cc. */ -int StonedbHandler::index_last([[maybe_unused]] uchar *buf) { +int TianmuHandler::index_last([[maybe_unused]] uchar *buf) { DBUG_ENTER(__PRETTY_FUNCTION__); int rc = HA_ERR_END_OF_FILE; try { @@ -902,7 +902,7 @@ int StonedbHandler::index_last([[maybe_unused]] uchar *buf) { } } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } DBUG_RETURN(rc); } @@ -916,7 +916,7 @@ int StonedbHandler::index_last([[maybe_unused]] uchar *buf) { Called from filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc, and sql_update.cc. */ -int StonedbHandler::rnd_init(bool scan) { +int TianmuHandler::rnd_init(bool scan) { DBUG_ENTER(__PRETTY_FUNCTION__); int ret = 1; @@ -946,7 +946,7 @@ int StonedbHandler::rnd_init(bool scan) { } catch (common::Exception const &e) { rccontrol << system::lock << "Error in push-down execution, push-down execution aborted: " << e.what() << system::unlock; - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught in push-down execution: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught in push-down execution: %s", e.what()); } m_query.reset(); m_cq.reset(); @@ -967,16 +967,16 @@ int StonedbHandler::rnd_init(bool scan) { if (table_ptr != NULL) blob_buffers.resize(table_ptr->NumOfDisplaybleAttrs()); } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } DBUG_RETURN(ret); } -int StonedbHandler::rnd_end() { +int TianmuHandler::rnd_end() { DBUG_ENTER(__PRETTY_FUNCTION__); reset(); DBUG_RETURN(0); @@ -991,7 +991,7 @@ int StonedbHandler::rnd_end() { Called from filesort.cc, records.cc, sql_handler.cc, sql_select.cc, sql_table.cc, and sql_update.cc. */ -int StonedbHandler::rnd_next(uchar *buf) { +int TianmuHandler::rnd_next(uchar *buf) { DBUG_ENTER(__PRETTY_FUNCTION__); int ret = HA_ERR_END_OF_FILE; @@ -1004,10 +1004,10 @@ int StonedbHandler::rnd_next(uchar *buf) { ret = 0; } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } DBUG_RETURN(ret); @@ -1027,7 +1027,7 @@ int StonedbHandler::rnd_next(uchar *buf) { Called from filesort.cc, sql_select.cc, sql_delete.cc and sql_update.cc. */ -void StonedbHandler::position([[maybe_unused]] const uchar *record) { +void TianmuHandler::position([[maybe_unused]] const uchar *record) { DBUG_ENTER(__PRETTY_FUNCTION__); my_store_ptr(ref, ref_length, current_position); @@ -1042,7 +1042,7 @@ void StonedbHandler::position([[maybe_unused]] const uchar *record) { or position you saved when position() was called. Called from filesort.cc records.cc sql_insert.cc sql_select.cc sql_update.cc. */ -int StonedbHandler::rnd_pos(uchar *buf, uchar *pos) { +int TianmuHandler::rnd_pos(uchar *buf, uchar *pos) { DBUG_ENTER(__PRETTY_FUNCTION__); int ret = HA_ERR_END_OF_FILE; @@ -1068,10 +1068,10 @@ int StonedbHandler::rnd_pos(uchar *buf, uchar *pos) { ret = 0; } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } DBUG_RETURN(ret); @@ -1082,10 +1082,10 @@ int StonedbHandler::rnd_pos(uchar *buf, uchar *pos) { the storage engine. The myisam engine implements the most hints. ha_innodb.cc has the most exhaustive list of these hints. */ -int StonedbHandler::extra(enum ha_extra_function operation) { +int TianmuHandler::extra(enum ha_extra_function operation) { DBUG_ENTER(__PRETTY_FUNCTION__); /* This preemptive delete might cause problems here. - * Other place where it can be put is StonedbHandler::external_lock(). + * Other place where it can be put is TianmuHandler::external_lock(). */ if (operation == HA_EXTRA_NO_CACHE) { m_cq.reset(); @@ -1094,7 +1094,7 @@ int StonedbHandler::extra(enum ha_extra_function operation) { DBUG_RETURN(0); } -int StonedbHandler::start_stmt(THD *thd, thr_lock_type lock_type) { +int TianmuHandler::start_stmt(THD *thd, thr_lock_type lock_type) { try { if (lock_type == TL_WRITE_CONCURRENT_INSERT || lock_type == TL_WRITE_DEFAULT || lock_type == TL_WRITE) { trans_register_ha(thd, true, rcbase_hton,NULL); @@ -1103,10 +1103,10 @@ int StonedbHandler::start_stmt(THD *thd, thr_lock_type lock_type) { } } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } return 0; } @@ -1116,7 +1116,7 @@ int StonedbHandler::start_stmt(THD *thd, thr_lock_type lock_type) { If current thread is in non-autocommit, we don't permit any mysql query caching. */ -my_bool StonedbHandler::register_query_cache_table(THD *thd, char *table_key, size_t key_length, +my_bool TianmuHandler::register_query_cache_table(THD *thd, char *table_key, size_t key_length, qc_engine_callback *call_back, [[maybe_unused]] ulonglong *engine_data) { *call_back = rcbase_query_caching_of_table_permitted; @@ -1137,7 +1137,7 @@ my_bool StonedbHandler::register_query_cache_table(THD *thd, char *table_key, si during create if the table_flag HA_DROP_BEFORE_CREATE was specified for the storage engine. */ -int StonedbHandler::delete_table(const char *name) { +int TianmuHandler::delete_table(const char *name) { DBUG_ENTER(__PRETTY_FUNCTION__); int ret = 1; try { @@ -1145,10 +1145,10 @@ int StonedbHandler::delete_table(const char *name) { ret = 0; } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } DBUG_RETURN(ret); @@ -1161,7 +1161,7 @@ int StonedbHandler::delete_table(const char *name) { Called from opt_range.cc by check_quick_keys(). */ -ha_rows StonedbHandler::records_in_range([[maybe_unused]] uint inx, [[maybe_unused]] key_range *min_key, +ha_rows TianmuHandler::records_in_range([[maybe_unused]] uint inx, [[maybe_unused]] key_range *min_key, [[maybe_unused]] key_range *max_key) { DBUG_ENTER(__PRETTY_FUNCTION__); DBUG_RETURN(10); // low number to force index usage @@ -1177,7 +1177,7 @@ ha_rows StonedbHandler::records_in_range([[maybe_unused]] uint inx, [[maybe_unus Called from handle.cc by ha_create_table(). */ -int StonedbHandler::create(const char *name, TABLE *table_arg, [[maybe_unused]] HA_CREATE_INFO *create_info) { +int TianmuHandler::create(const char *name, TABLE *table_arg, [[maybe_unused]] HA_CREATE_INFO *create_info) { DBUG_ENTER(__PRETTY_FUNCTION__); try { rceng->CreateTable(name, table_arg); @@ -1187,35 +1187,35 @@ int StonedbHandler::create(const char *name, TABLE *table_arg, [[maybe_unused]] } catch (common::UnsupportedDataTypeException &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); } catch (fs::filesystem_error &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "filesystem_error on table creation '%s'", e.what()); - fs::remove_all(std::string(name) + common::STONEDB_EXT); + TIANMU_LOG(LogCtl_Level::ERROR, "filesystem_error on table creation '%s'", e.what()); + fs::remove_all(std::string(name) + common::TIANMU_EXT); } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } DBUG_RETURN(1); } -int StonedbHandler::truncate() { +int TianmuHandler::truncate() { int ret = 0; try { rceng->TruncateTable(m_table_name, ha_thd()); } catch (std::exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); ret = 1; } catch (...) { - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); ret = 1; } return ret; } -int StonedbHandler::fill_row(uchar *buf) { +int TianmuHandler::fill_row(uchar *buf) { if (table_new_iter == table_new_iter_end) return HA_ERR_END_OF_FILE; my_bitmap_map *org_bitmap = dbug_tmp_use_all_columns(table, table->write_set); @@ -1245,7 +1245,7 @@ int StonedbHandler::fill_row(uchar *buf) { return 0; } -char *StonedbHandler::update_table_comment(const char *comment) { +char *TianmuHandler::update_table_comment(const char *comment) { char *ret = const_cast(comment); try { uint length = (uint)std::strlen(comment); @@ -1283,16 +1283,16 @@ char *StonedbHandler::update_table_comment(const char *comment) { ret = str; } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } return ret; } -bool StonedbHandler::explain_message(const Item *a_cond, String *buf) { +bool TianmuHandler::explain_message(const Item *a_cond, String *buf) { DBUG_ENTER(__PRETTY_FUNCTION__); if (current_tx->Explain()) { cond_push(a_cond); @@ -1302,7 +1302,7 @@ bool StonedbHandler::explain_message(const Item *a_cond, String *buf) { DBUG_RETURN(TRUE); } -int StonedbHandler::set_cond_iter() { +int TianmuHandler::set_cond_iter() { int ret = 1; if (m_query && !m_result && table_ptr->NumOfObj() != 0) { m_cq->Result(m_tmp_table); // it is ALWAYS -2 though.... @@ -1329,7 +1329,7 @@ int StonedbHandler::set_cond_iter() { } catch (common::Exception const &e) { rccontrol << system::lock << "Error in push-down execution, push-down execution aborted: " << e.what() << system::unlock; - STONEDB_LOG(LogCtl_Level::ERROR, "Error in push-down execution, push-down execution aborted: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Error in push-down execution, push-down execution aborted: %s", e.what()); } m_query.reset(); m_cq.reset(); @@ -1337,7 +1337,7 @@ int StonedbHandler::set_cond_iter() { return ret; } -const Item *StonedbHandler::cond_push(const Item *a_cond) { +const Item *TianmuHandler::cond_push(const Item *a_cond) { Item const *ret = a_cond; Item *cond = const_cast(a_cond); @@ -1400,15 +1400,15 @@ const Item *StonedbHandler::cond_push(const Item *a_cond) { ret = 0; } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } return ret; } -int StonedbHandler::reset() { +int TianmuHandler::reset() { DBUG_ENTER(__PRETTY_FUNCTION__); int ret = 1; @@ -1424,38 +1424,38 @@ int StonedbHandler::reset() { ret = 0; } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } DBUG_RETURN(ret); } -enum_alter_inplace_result StonedbHandler::check_if_supported_inplace_alter([[maybe_unused]] TABLE *altered_table, +enum_alter_inplace_result TianmuHandler::check_if_supported_inplace_alter([[maybe_unused]] TABLE *altered_table, Alter_inplace_info *ha_alter_info) { - if ((ha_alter_info->handler_flags & ~STONEDB_SUPPORTED_ALTER_ADD_DROP_ORDER) && - (ha_alter_info->handler_flags != STONEDB_SUPPORTED_ALTER_COLUMN_NAME)) { + if ((ha_alter_info->handler_flags & ~TIANMU_SUPPORTED_ALTER_ADD_DROP_ORDER) && + (ha_alter_info->handler_flags != TIANMU_SUPPORTED_ALTER_COLUMN_NAME)) { return HA_ALTER_ERROR; } return HA_ALTER_INPLACE_EXCLUSIVE_LOCK; } -bool StonedbHandler::inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { +bool TianmuHandler::inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info) { try { - if (!(ha_alter_info->handler_flags & ~STONEDB_SUPPORTED_ALTER_ADD_DROP_ORDER)) { + if (!(ha_alter_info->handler_flags & ~TIANMU_SUPPORTED_ALTER_ADD_DROP_ORDER)) { std::vector v_old(table_share->field, table_share->field + table_share->fields); std::vector v_new(altered_table->s->field, altered_table->s->field + altered_table->s->fields); rceng->PrepareAlterTable(m_table_name, v_new, v_old, ha_thd()); return false; - } else if (ha_alter_info->handler_flags == STONEDB_SUPPORTED_ALTER_COLUMN_NAME) { + } else if (ha_alter_info->handler_flags == TIANMU_SUPPORTED_ALTER_COLUMN_NAME) { return false; } } catch (std::exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "Unable to inplace alter table", MYF(0)); @@ -1463,21 +1463,21 @@ bool StonedbHandler::inplace_alter_table(TABLE *altered_table, Alter_inplace_inf return true; } -bool StonedbHandler::commit_inplace_alter_table([[maybe_unused]] TABLE *altered_table, +bool TianmuHandler::commit_inplace_alter_table([[maybe_unused]] TABLE *altered_table, Alter_inplace_info *ha_alter_info, bool commit) { if (!commit) { - STONEDB_LOG(LogCtl_Level::INFO, "Alter table failed : %s%s", m_table_name.c_str(), " rollback"); + TIANMU_LOG(LogCtl_Level::INFO, "Alter table failed : %s%s", m_table_name.c_str(), " rollback"); return true; } - if (ha_alter_info->handler_flags == STONEDB_SUPPORTED_ALTER_COLUMN_NAME) { + if (ha_alter_info->handler_flags == TIANMU_SUPPORTED_ALTER_COLUMN_NAME) { return false; } - if ((ha_alter_info->handler_flags & ~STONEDB_SUPPORTED_ALTER_ADD_DROP_ORDER)) { - STONEDB_LOG(LogCtl_Level::INFO, "Altered table not support type %lu", ha_alter_info->handler_flags); + if ((ha_alter_info->handler_flags & ~TIANMU_SUPPORTED_ALTER_ADD_DROP_ORDER)) { + TIANMU_LOG(LogCtl_Level::INFO, "Altered table not support type %lu", ha_alter_info->handler_flags); return true; } fs::path tmp_dir(m_table_name + ".tmp"); - fs::path tab_dir(m_table_name + common::STONEDB_EXT); + fs::path tab_dir(m_table_name + common::TIANMU_EXT); fs::path bak_dir(m_table_name + ".backup"); try { @@ -1497,12 +1497,12 @@ bool StonedbHandler::commit_inplace_alter_table([[maybe_unused]] TABLE *altered_ auto search = s.find(target); if (search == s.end()) { fs::remove_all(target); - STONEDB_LOG(LogCtl_Level::INFO, "removing %s", target.c_str()); + TIANMU_LOG(LogCtl_Level::INFO, "removing %s", target.c_str()); } } fs::remove_all(bak_dir); } catch (fs::filesystem_error &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "file system error: %s %s|%s", e.what(), e.path1().string().c_str(), + TIANMU_LOG(LogCtl_Level::ERROR, "file system error: %s %s|%s", e.what(), e.path1().string().c_str(), e.path2().string().c_str()); my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "Failed to commit alter table", MYF(0)); return true; @@ -1513,7 +1513,7 @@ bool StonedbHandler::commit_inplace_alter_table([[maybe_unused]] TABLE *altered_ key: mysql format, may be union key, need changed to kvstore key format */ -void StonedbHandler::key_convert(const uchar *key, uint key_len, std::vector cols, +void TianmuHandler::key_convert(const uchar *key, uint key_len, std::vector cols, std::vector &keys) { key_restore(table->record[0], (uchar *)key, &table->key_info[active_index], key_len); @@ -1536,19 +1536,19 @@ void StonedbHandler::key_convert(const uchar *key, uint key_len, std::vectortype()) { case MYSQL_TYPE_TINY: { int64_t v = f->val_int(); - if (v > SDB_TINYINT_MAX) - v = SDB_TINYINT_MAX; - else if (v < SDB_TINYINT_MIN) - v = SDB_TINYINT_MIN; + if (v > TIANMU_TINYINT_MAX) + v = TIANMU_TINYINT_MAX; + else if (v < TIANMU_TINYINT_MIN) + v = TIANMU_TINYINT_MIN; *(int64_t *)ptr = v; ptr += sizeof(int64_t); } break; case MYSQL_TYPE_SHORT: { int64_t v = f->val_int(); - if (v > SDB_SMALLINT_MAX) - v = SDB_SMALLINT_MAX; - else if (v < SDB_SMALLINT_MIN) - v = SDB_SMALLINT_MIN; + if (v > TIANMU_SMALLINT_MAX) + v = TIANMU_SMALLINT_MAX; + else if (v < TIANMU_SMALLINT_MIN) + v = TIANMU_SMALLINT_MIN; *(int64_t *)ptr = v; ptr += sizeof(int64_t); } break; @@ -1556,26 +1556,26 @@ void StonedbHandler::key_convert(const uchar *key, uint key_len, std::vectorval_int(); if (v > std::numeric_limits::max()) v = std::numeric_limits::max(); - else if (v < SDB_INT_MIN) - v = SDB_INT_MIN; + else if (v < TIANMU_INT_MIN) + v = TIANMU_INT_MIN; *(int64_t *)ptr = v; ptr += sizeof(int64_t); } break; case MYSQL_TYPE_INT24: { int64_t v = f->val_int(); - if (v > SDB_MEDIUMINT_MAX) - v = SDB_MEDIUMINT_MAX; - else if (v < SDB_MEDIUMINT_MIN) - v = SDB_MEDIUMINT_MIN; + if (v > TIANMU_MEDIUMINT_MAX) + v = TIANMU_MEDIUMINT_MAX; + else if (v < TIANMU_MEDIUMINT_MIN) + v = TIANMU_MEDIUMINT_MIN; *(int64_t *)ptr = v; ptr += sizeof(int64_t); } break; case MYSQL_TYPE_LONGLONG: { int64_t v = f->val_int(); - if (v > common::SDB_BIGINT_MAX) - v = common::SDB_BIGINT_MAX; - else if (v < common::SDB_BIGINT_MIN) - v = common::SDB_BIGINT_MIN; + if (v > common::TIANMU_BIGINT_MAX) + v = common::TIANMU_BIGINT_MAX; + else if (v < common::TIANMU_BIGINT_MIN) + v = common::TIANMU_BIGINT_MIN; *(int64_t *)ptr = v; ptr += sizeof(int64_t); } break; @@ -1661,4 +1661,4 @@ void StonedbHandler::key_convert(const uchar *key, uint key_len, std::vector cols, std::vector &keys); public: - static const Alter_inplace_info::HA_ALTER_FLAGS STONEDB_SUPPORTED_ALTER_ADD_DROP_ORDER; - static const Alter_inplace_info::HA_ALTER_FLAGS STONEDB_SUPPORTED_ALTER_COLUMN_NAME; + static const Alter_inplace_info::HA_ALTER_FLAGS TIANMU_SUPPORTED_ALTER_ADD_DROP_ORDER; + static const Alter_inplace_info::HA_ALTER_FLAGS TIANMU_SUPPORTED_ALTER_COLUMN_NAME; protected: int set_cond_iter(); @@ -184,6 +184,6 @@ class StonedbHandler final : public handler { }; } // namespace dbhandler -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_HANDLER_STONEDB_HANDLER_H_ +#endif // TIANMU_HANDLER_TIANMU_HANDLER_H_ diff --git a/storage/stonedb/handler/stonedb_handler_com.cpp b/storage/tianmu/handler/tianmu_handler_com.cpp similarity index 75% rename from storage/stonedb/handler/stonedb_handler_com.cpp rename to storage/tianmu/handler/tianmu_handler_com.cpp index 4b7311e14b..70c0a1d982 100644 --- a/storage/stonedb/handler/stonedb_handler_com.cpp +++ b/storage/tianmu/handler/tianmu_handler_com.cpp @@ -20,7 +20,7 @@ #include #include "core/transaction.h" -#include "handler/stonedb_handler.h" +#include "handler/tianmu_handler.h" #include "mm/initializer.h" #include "system/file_out.h" #include "binlog.h" @@ -31,7 +31,7 @@ struct st_mysql_sys_var { MYSQL_PLUGIN_VAR_HEADER; }; -namespace stonedb { +namespace Tianmu { namespace dbhandler { /* @@ -39,7 +39,7 @@ namespace dbhandler { extentions exist for the storage engine. This is also used by the default rename_table and delete_table method in handler.cc. */ -my_bool stonedb_bootstrap = 0; +my_bool tianmu_bootstrap = 0; char *strmov_str(char *dst, const char *src) { @@ -63,11 +63,11 @@ static int rcbase_done_func([[maybe_unused]] void *p) { } handler *rcbase_create_handler(handlerton *hton, TABLE_SHARE *table, MEM_ROOT *mem_root) { - return new (mem_root) StonedbHandler(hton, table); + return new (mem_root) TianmuHandler(hton, table); } int rcbase_panic_func([[maybe_unused]] handlerton *hton, enum ha_panic_function flag) { - if (stonedb_bootstrap) return 0; + if (tianmu_bootstrap) return 0; if (flag == HA_PANIC_CLOSE) { delete rceng; @@ -87,10 +87,10 @@ int rcbase_rollback([[maybe_unused]] handlerton *hton, THD *thd, bool all) { ret = 0; } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception error is caught: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception error is caught: %s.", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } DBUG_RETURN(ret); @@ -106,10 +106,10 @@ int rcbase_close_connection(handlerton *hton, THD *thd) { ret = 0; } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception error is caught: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception error is caught: %s.", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } DBUG_RETURN(ret); @@ -136,25 +136,25 @@ int rcbase_commit([[maybe_unused]] handlerton *hton, THD *thd, bool all) { try { rceng->Rollback(thd, all, true); if (!error_message.empty()) { - STONEDB_LOG(LogCtl_Level::ERROR, "%s", error_message.c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "%s", error_message.c_str()); my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), error_message.c_str(), MYF(0)); } } catch (std::exception &e) { if (!error_message.empty()) { - STONEDB_LOG(LogCtl_Level::ERROR, "%s", error_message.c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "%s", error_message.c_str()); my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), error_message.c_str(), MYF(0)); } my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), (std::string("Failed to rollback transaction. Error: ") + e.what()).c_str(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to rollback transaction. Error: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to rollback transaction. Error: %s.", e.what()); } catch (...) { if (!error_message.empty()) { - STONEDB_LOG(LogCtl_Level::ERROR, "%s", error_message.c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "%s", error_message.c_str()); my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), error_message.c_str(), MYF(0)); } my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "Failed to rollback transaction. Unknown error.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to rollback transaction. Unknown error."); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to rollback transaction. Unknown error."); } } @@ -162,7 +162,7 @@ int rcbase_commit([[maybe_unused]] handlerton *hton, THD *thd, bool all) { } bool rcbase_show_status([[maybe_unused]] handlerton *hton, THD *thd, stat_print_fn *pprint, enum ha_stat_type stat) { - const static char *hton_name = "STONEDB"; + const static char *hton_name = "TIANMU"; std::ostringstream buf(std::ostringstream::out); @@ -176,7 +176,7 @@ bool rcbase_show_status([[maybe_unused]] handlerton *hton, THD *thd, stat_print_ return false; } -extern my_bool stonedb_bootstrap; +extern my_bool tianmu_bootstrap; static int init_variables() { opt_binlog_order_commits = false; @@ -192,7 +192,7 @@ int rcbase_init_func(void *p) { } rcbase_hton->state = SHOW_OPTION_YES; - rcbase_hton->db_type = DB_TYPE_STONEDB; + rcbase_hton->db_type = DB_TYPE_TIANMU; rcbase_hton->create = rcbase_create_handler; rcbase_hton->flags = HTON_NO_FLAGS; rcbase_hton->panic = rcbase_panic_func; @@ -203,14 +203,14 @@ int rcbase_init_func(void *p) { // When mysqld runs as bootstrap mode, we do not need to initialize // memmanager. - if (stonedb_bootstrap) DBUG_RETURN(0); + if (tianmu_bootstrap) DBUG_RETURN(0); int ret = 1; rceng = NULL; try { std::string log_file = mysql_home_ptr; - log_setup(log_file + "/log/stonedb.log"); + log_setup(log_file + "/log/tianmu.log"); rccontrol.addOutput(new system::FileOut(log_file + "/log/trace.log")); rcquerylog.addOutput(new system::FileOut(log_file + "/log/query.log")); struct hostent *hent = NULL; @@ -223,7 +223,7 @@ int rcbase_init_func(void *p) { rceng = new core::Engine(); ret = rceng->Init(total_ha); { - STONEDB_LOG(LogCtl_Level::INFO, + TIANMU_LOG(LogCtl_Level::INFO, "\n" "------------------------------------------------------------" "----------------------------------" @@ -249,16 +249,16 @@ int rcbase_init_func(void *p) { } catch (std::exception &e) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), e.what(), MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An exception error is caught: %s.", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception error is caught: %s.", e.what()); } catch (...) { my_message(static_cast(common::ErrorCode::UNKNOWN_ERROR), "An unknown system exception error caught.", MYF(0)); - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } DBUG_RETURN(ret); } -struct st_mysql_storage_engine stonedb_storage_engine = {MYSQL_HANDLERTON_INTERFACE_VERSION}; +struct st_mysql_storage_engine tianmu_storage_engine = {MYSQL_HANDLERTON_INTERFACE_VERSION}; int get_DelayedBufferUsage_StatusVar([[maybe_unused]] MYSQL_THD thd, SHOW_VAR *var, char *buff) { var->type = SHOW_CHAR; @@ -369,7 +369,7 @@ int get_UpdatePerMinute_StatusVar([[maybe_unused]] MYSQL_THD thd, SHOW_VAR *outv char masteslave_info[8192]; -SHOW_VAR stonedb_masterslave_dump[] = {{"info", masteslave_info, SHOW_CHAR, SHOW_SCOPE_UNDEF}, {NullS, NullS, SHOW_LONG, SHOW_SCOPE_UNDEF}}; +SHOW_VAR tianmu_masterslave_dump[] = {{"info", masteslave_info, SHOW_CHAR, SHOW_SCOPE_UNDEF}, {NullS, NullS, SHOW_LONG, SHOW_SCOPE_UNDEF}}; // showtype // ===================== @@ -377,7 +377,7 @@ SHOW_VAR stonedb_masterslave_dump[] = {{"info", masteslave_info, SHOW_CHAR, SHOW // SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, // SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE -int stonedb_throw_error_func([[maybe_unused]] MYSQL_THD thd, [[maybe_unused]] struct st_mysql_sys_var *var, +int tianmu_throw_error_func([[maybe_unused]] MYSQL_THD thd, [[maybe_unused]] struct st_mysql_sys_var *var, [[maybe_unused]] void *save, struct st_mysql_value *value) { int buffer_length = 512; char buff[512] = {0}; @@ -425,7 +425,7 @@ extern void async_join_update(MYSQL_THD thd, struct st_mysql_sys_var *var, void } #define STATUS_MEMBER(name, label) \ - { "StoneDB_" #label, (char *)get_##name##_StatusVar, SHOW_FUNC, SHOW_SCOPE_UNDEF} + { "Tianmu_" #label, (char *)get_##name##_StatusVar, SHOW_FUNC, SHOW_SCOPE_UNDEF} STATUS_FUNCTION(gdchits, SHOW_LONGLONG, getCacheHits) STATUS_FUNCTION(gdcmisses, SHOW_LONGLONG, getCacheMisses) @@ -506,114 +506,114 @@ static struct st_mysql_show_var statusvars[] = { {0, 0, SHOW_UNDEF, SHOW_SCOPE_UNDEF}, }; -static MYSQL_SYSVAR_BOOL(refresh_sys_stonedb, stonedb_sysvar_refresh_sys_table, PLUGIN_VAR_BOOL, "-", NULL, +static MYSQL_SYSVAR_BOOL(refresh_sys_tianmu, tianmu_sysvar_refresh_sys_table, PLUGIN_VAR_BOOL, "-", NULL, refresh_sys_table_func, TRUE); -static MYSQL_THDVAR_STR(trigger_error, PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL, "-", stonedb_throw_error_func, +static MYSQL_THDVAR_STR(trigger_error, PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL, "-", tianmu_throw_error_func, update_func_str, NULL); -static MYSQL_SYSVAR_INT(ini_allowmysqlquerypath, stonedb_sysvar_allowmysqlquerypath, PLUGIN_VAR_READONLY, "-", NULL, +static MYSQL_SYSVAR_INT(ini_allowmysqlquerypath, tianmu_sysvar_allowmysqlquerypath, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, 1, 0); -static MYSQL_SYSVAR_STR(ini_cachefolder, stonedb_sysvar_cachefolder, PLUGIN_VAR_READONLY, "-", NULL, NULL, "cache"); -static MYSQL_SYSVAR_INT(ini_knlevel, stonedb_sysvar_knlevel, PLUGIN_VAR_READONLY, "-", NULL, NULL, 99, 0, 99, 0); -static MYSQL_SYSVAR_BOOL(ini_pushdown, stonedb_sysvar_pushdown, PLUGIN_VAR_READONLY, "-", NULL, NULL, TRUE); -static MYSQL_SYSVAR_INT(ini_servermainheapsize, stonedb_sysvar_servermainheapsize, PLUGIN_VAR_READONLY, "-", NULL, NULL, +static MYSQL_SYSVAR_STR(ini_cachefolder, tianmu_sysvar_cachefolder, PLUGIN_VAR_READONLY, "-", NULL, NULL, "cache"); +static MYSQL_SYSVAR_INT(ini_knlevel, tianmu_sysvar_knlevel, PLUGIN_VAR_READONLY, "-", NULL, NULL, 99, 0, 99, 0); +static MYSQL_SYSVAR_BOOL(ini_pushdown, tianmu_sysvar_pushdown, PLUGIN_VAR_READONLY, "-", NULL, NULL, TRUE); +static MYSQL_SYSVAR_INT(ini_servermainheapsize, tianmu_sysvar_servermainheapsize, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, 1000000, 0); -static MYSQL_SYSVAR_BOOL(ini_usemysqlimportexportdefaults, stonedb_sysvar_usemysqlimportexportdefaults, +static MYSQL_SYSVAR_BOOL(ini_usemysqlimportexportdefaults, tianmu_sysvar_usemysqlimportexportdefaults, PLUGIN_VAR_READONLY, "-", NULL, NULL, FALSE); -static MYSQL_SYSVAR_INT(ini_threadpoolsize, stonedb_sysvar_threadpoolsize, PLUGIN_VAR_READONLY, "-", NULL, NULL, 1, 0, +static MYSQL_SYSVAR_INT(ini_threadpoolsize, tianmu_sysvar_threadpoolsize, PLUGIN_VAR_READONLY, "-", NULL, NULL, 1, 0, 1000000, 0); -static MYSQL_SYSVAR_INT(ini_cachesizethreshold, stonedb_sysvar_cachesizethreshold, PLUGIN_VAR_INT, "-", NULL, NULL, 4, +static MYSQL_SYSVAR_INT(ini_cachesizethreshold, tianmu_sysvar_cachesizethreshold, PLUGIN_VAR_INT, "-", NULL, NULL, 4, 0, 1024, 0); -static MYSQL_SYSVAR_INT(ini_cachereleasethreshold, stonedb_sysvar_cachereleasethreshold, PLUGIN_VAR_INT, "-", NULL, +static MYSQL_SYSVAR_INT(ini_cachereleasethreshold, tianmu_sysvar_cachereleasethreshold, PLUGIN_VAR_INT, "-", NULL, NULL, 100, 0, 100000, 0); -static MYSQL_SYSVAR_BOOL(insert_delayed, stonedb_sysvar_insert_delayed, PLUGIN_VAR_READONLY, "-", NULL, NULL, TRUE); -static MYSQL_SYSVAR_INT(insert_cntthreshold, stonedb_sysvar_insert_cntthreshold, PLUGIN_VAR_READONLY, "-", NULL, NULL, +static MYSQL_SYSVAR_BOOL(insert_delayed, tianmu_sysvar_insert_delayed, PLUGIN_VAR_READONLY, "-", NULL, NULL, TRUE); +static MYSQL_SYSVAR_INT(insert_cntthreshold, tianmu_sysvar_insert_cntthreshold, PLUGIN_VAR_READONLY, "-", NULL, NULL, 2, 0, 1000, 0); -static MYSQL_SYSVAR_INT(insert_numthreshold, stonedb_sysvar_insert_numthreshold, PLUGIN_VAR_READONLY, "-", NULL, NULL, +static MYSQL_SYSVAR_INT(insert_numthreshold, tianmu_sysvar_insert_numthreshold, PLUGIN_VAR_READONLY, "-", NULL, NULL, 10000, 0, 100000, 0); -static MYSQL_SYSVAR_INT(insert_wait_ms, stonedb_sysvar_insert_wait_ms, PLUGIN_VAR_READONLY, "-", NULL, NULL, 100, 10, +static MYSQL_SYSVAR_INT(insert_wait_ms, tianmu_sysvar_insert_wait_ms, PLUGIN_VAR_READONLY, "-", NULL, NULL, 100, 10, 10000, 0); -static MYSQL_SYSVAR_INT(insert_wait_time, stonedb_sysvar_insert_wait_time, PLUGIN_VAR_INT, "-", NULL, NULL, 1000, 0, +static MYSQL_SYSVAR_INT(insert_wait_time, tianmu_sysvar_insert_wait_time, PLUGIN_VAR_INT, "-", NULL, NULL, 1000, 0, 600000, 0); -static MYSQL_SYSVAR_INT(insert_max_buffered, stonedb_sysvar_insert_max_buffered, PLUGIN_VAR_READONLY, "-", NULL, NULL, +static MYSQL_SYSVAR_INT(insert_max_buffered, tianmu_sysvar_insert_max_buffered, PLUGIN_VAR_READONLY, "-", NULL, NULL, 65536, 0, 10000000, 0); -static MYSQL_SYSVAR_BOOL(compensation_start, stonedb_sysvar_compensation_start, PLUGIN_VAR_BOOL, "-", NULL, NULL, +static MYSQL_SYSVAR_BOOL(compensation_start, tianmu_sysvar_compensation_start, PLUGIN_VAR_BOOL, "-", NULL, NULL, FALSE); -static MYSQL_SYSVAR_STR(hugefiledir, stonedb_sysvar_hugefiledir, PLUGIN_VAR_READONLY, "-", NULL, NULL, ""); -static MYSQL_SYSVAR_INT(cachinglevel, stonedb_sysvar_cachinglevel, PLUGIN_VAR_READONLY, "-", NULL, NULL, 1, 0, 512, 0); -static MYSQL_SYSVAR_STR(mm_policy, stonedb_sysvar_mm_policy, PLUGIN_VAR_READONLY, "-", NULL, NULL, ""); -static MYSQL_SYSVAR_INT(mm_hardlimit, stonedb_sysvar_mm_hardlimit, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, 1, 0); -static MYSQL_SYSVAR_STR(mm_releasepolicy, stonedb_sysvar_mm_releasepolicy, PLUGIN_VAR_READONLY, "-", NULL, NULL, "2q"); -static MYSQL_SYSVAR_INT(mm_largetempratio, stonedb_sysvar_mm_largetempratio, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, +static MYSQL_SYSVAR_STR(hugefiledir, tianmu_sysvar_hugefiledir, PLUGIN_VAR_READONLY, "-", NULL, NULL, ""); +static MYSQL_SYSVAR_INT(cachinglevel, tianmu_sysvar_cachinglevel, PLUGIN_VAR_READONLY, "-", NULL, NULL, 1, 0, 512, 0); +static MYSQL_SYSVAR_STR(mm_policy, tianmu_sysvar_mm_policy, PLUGIN_VAR_READONLY, "-", NULL, NULL, ""); +static MYSQL_SYSVAR_INT(mm_hardlimit, tianmu_sysvar_mm_hardlimit, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, 1, 0); +static MYSQL_SYSVAR_STR(mm_releasepolicy, tianmu_sysvar_mm_releasepolicy, PLUGIN_VAR_READONLY, "-", NULL, NULL, "2q"); +static MYSQL_SYSVAR_INT(mm_largetempratio, tianmu_sysvar_mm_largetempratio, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, 99, 0); -static MYSQL_SYSVAR_INT(mm_largetemppool_threshold, stonedb_sysvar_mm_large_threshold, PLUGIN_VAR_INT, +static MYSQL_SYSVAR_INT(mm_largetemppool_threshold, tianmu_sysvar_mm_large_threshold, PLUGIN_VAR_INT, "size threshold in MB for using large temp thread pool", NULL, NULL, 16, 0, 10240, 0); -static MYSQL_SYSVAR_INT(sync_buffers, stonedb_sysvar_sync_buffers, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, 1, 0); +static MYSQL_SYSVAR_INT(sync_buffers, tianmu_sysvar_sync_buffers, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, 1, 0); -static MYSQL_SYSVAR_INT(query_threads, stonedb_sysvar_query_threads, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, 100, +static MYSQL_SYSVAR_INT(query_threads, tianmu_sysvar_query_threads, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, 100, 0); -static MYSQL_SYSVAR_INT(load_threads, stonedb_sysvar_load_threads, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, 100, 0); -static MYSQL_SYSVAR_INT(bg_load_threads, stonedb_sysvar_bg_load_threads, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, +static MYSQL_SYSVAR_INT(load_threads, tianmu_sysvar_load_threads, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, 100, 0); +static MYSQL_SYSVAR_INT(bg_load_threads, tianmu_sysvar_bg_load_threads, PLUGIN_VAR_READONLY, "-", NULL, NULL, 0, 0, 100, 0); -static MYSQL_SYSVAR_INT(insert_buffer_size, stonedb_sysvar_insert_buffer_size, PLUGIN_VAR_READONLY, "-", NULL, NULL, +static MYSQL_SYSVAR_INT(insert_buffer_size, tianmu_sysvar_insert_buffer_size, PLUGIN_VAR_READONLY, "-", NULL, NULL, 512, 512, 10000, 0); static MYSQL_THDVAR_INT(session_debug_level, PLUGIN_VAR_INT, "session debug level", NULL, debug_update, 3, 0, 5, 0); static MYSQL_THDVAR_INT(control_trace, PLUGIN_VAR_OPCMDARG, "ini controltrace", NULL, trace_update, 0, 0, 100, 0); -static MYSQL_SYSVAR_INT(global_debug_level, stonedb_sysvar_global_debug_level, PLUGIN_VAR_INT, "global debug level", +static MYSQL_SYSVAR_INT(global_debug_level, tianmu_sysvar_global_debug_level, PLUGIN_VAR_INT, "global debug level", NULL, NULL, 4, 0, 5, 0); -static MYSQL_SYSVAR_INT(distinct_cache_size, stonedb_sysvar_distcache_size, PLUGIN_VAR_INT, +static MYSQL_SYSVAR_INT(distinct_cache_size, tianmu_sysvar_distcache_size, PLUGIN_VAR_INT, "Upper byte limit for GroupDistinctCache buffer", NULL, NULL, 64, 64, 256, 0); -static MYSQL_SYSVAR_BOOL(filterevaluation_speedup, stonedb_sysvar_filterevaluation_speedup, PLUGIN_VAR_BOOL, "-", NULL, +static MYSQL_SYSVAR_BOOL(filterevaluation_speedup, tianmu_sysvar_filterevaluation_speedup, PLUGIN_VAR_BOOL, "-", NULL, NULL, TRUE); -static MYSQL_SYSVAR_BOOL(groupby_speedup, stonedb_sysvar_groupby_speedup, PLUGIN_VAR_BOOL, "-", NULL, NULL, TRUE); -static MYSQL_SYSVAR_BOOL(orderby_speedup, stonedb_sysvar_orderby_speedup, PLUGIN_VAR_BOOL, "-", NULL, NULL, FALSE); -static MYSQL_SYSVAR_INT(join_parallel, stonedb_sysvar_join_parallel, PLUGIN_VAR_INT, +static MYSQL_SYSVAR_BOOL(groupby_speedup, tianmu_sysvar_groupby_speedup, PLUGIN_VAR_BOOL, "-", NULL, NULL, TRUE); +static MYSQL_SYSVAR_BOOL(orderby_speedup, tianmu_sysvar_orderby_speedup, PLUGIN_VAR_BOOL, "-", NULL, NULL, FALSE); +static MYSQL_SYSVAR_INT(join_parallel, tianmu_sysvar_join_parallel, PLUGIN_VAR_INT, "join matching parallel: 0-Disabled, 1-Auto, N-specify count", NULL, NULL, 1, 0, 1000, 0); -static MYSQL_SYSVAR_INT(join_splitrows, stonedb_sysvar_join_splitrows, PLUGIN_VAR_INT, +static MYSQL_SYSVAR_INT(join_splitrows, tianmu_sysvar_join_splitrows, PLUGIN_VAR_INT, "join split rows:0-Disabled, 1-Auto, N-specify count", NULL, NULL, 0, 0, 1000, 0); -static MYSQL_SYSVAR_BOOL(minmax_speedup, stonedb_sysvar_minmax_speedup, PLUGIN_VAR_BOOL, "-", NULL, NULL, TRUE); -static MYSQL_SYSVAR_UINT(index_cache_size, stonedb_sysvar_index_cache_size, PLUGIN_VAR_READONLY, +static MYSQL_SYSVAR_BOOL(minmax_speedup, tianmu_sysvar_minmax_speedup, PLUGIN_VAR_BOOL, "-", NULL, NULL, TRUE); +static MYSQL_SYSVAR_UINT(index_cache_size, tianmu_sysvar_index_cache_size, PLUGIN_VAR_READONLY, "Index cache size in MB", NULL, NULL, 0, 0, 65536, 0); -static MYSQL_SYSVAR_BOOL(index_search, stonedb_sysvar_index_search, PLUGIN_VAR_BOOL, "-", NULL, NULL, TRUE); -static MYSQL_SYSVAR_BOOL(enable_rowstore, stonedb_sysvar_enable_rowstore, PLUGIN_VAR_BOOL, "-", NULL, NULL, TRUE); -static MYSQL_SYSVAR_BOOL(parallel_filloutput, stonedb_sysvar_parallel_filloutput, PLUGIN_VAR_BOOL, "-", NULL, NULL, +static MYSQL_SYSVAR_BOOL(index_search, tianmu_sysvar_index_search, PLUGIN_VAR_BOOL, "-", NULL, NULL, TRUE); +static MYSQL_SYSVAR_BOOL(enable_rowstore, tianmu_sysvar_enable_rowstore, PLUGIN_VAR_BOOL, "-", NULL, NULL, TRUE); +static MYSQL_SYSVAR_BOOL(parallel_filloutput, tianmu_sysvar_parallel_filloutput, PLUGIN_VAR_BOOL, "-", NULL, NULL, TRUE); -static MYSQL_SYSVAR_BOOL(parallel_mapjoin, stonedb_sysvar_parallel_mapjoin, PLUGIN_VAR_BOOL, "-", NULL, NULL, FALSE); +static MYSQL_SYSVAR_BOOL(parallel_mapjoin, tianmu_sysvar_parallel_mapjoin, PLUGIN_VAR_BOOL, "-", NULL, NULL, FALSE); -static MYSQL_SYSVAR_INT(max_execution_time, stonedb_sysvar_max_execution_time, PLUGIN_VAR_INT, +static MYSQL_SYSVAR_INT(max_execution_time, tianmu_sysvar_max_execution_time, PLUGIN_VAR_INT, "max query execution time in seconds", NULL, NULL, 0, 0, 10000, 0); -static MYSQL_SYSVAR_INT(ini_controlquerylog, stonedb_sysvar_controlquerylog, PLUGIN_VAR_INT, "global controlquerylog", +static MYSQL_SYSVAR_INT(ini_controlquerylog, tianmu_sysvar_controlquerylog, PLUGIN_VAR_INT, "global controlquerylog", NULL, controlquerylog_update, 1, 0, 100, 0); static const char *dist_policy_names[] = {"round-robin", "random", "space", 0}; static TYPELIB policy_typelib_t = {array_elements(dist_policy_names) - 1, "dist_policy_names", dist_policy_names, 0}; -static MYSQL_SYSVAR_ENUM(data_distribution_policy, stonedb_sysvar_dist_policy, PLUGIN_VAR_RQCMDARG, +static MYSQL_SYSVAR_ENUM(data_distribution_policy, tianmu_sysvar_dist_policy, PLUGIN_VAR_RQCMDARG, "Specifies the policy to distribute column data among multiple data " "directories." "Possible values are round-robin(default), random, and space", NULL, NULL, 2, &policy_typelib_t); -static MYSQL_SYSVAR_INT(disk_usage_threshold, stonedb_sysvar_disk_usage_threshold, PLUGIN_VAR_INT, +static MYSQL_SYSVAR_INT(disk_usage_threshold, tianmu_sysvar_disk_usage_threshold, PLUGIN_VAR_INT, "Specifies the disk usage threshold for data diretories.", NULL, NULL, 85, 10, 99, 0); -static MYSQL_SYSVAR_UINT(lookup_max_size, stonedb_sysvar_lookup_max_size, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, +static MYSQL_SYSVAR_UINT(lookup_max_size, tianmu_sysvar_lookup_max_size, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "Lookup dictionary max size", NULL, NULL, 100000, 1000, 1000000, 0); -static MYSQL_SYSVAR_BOOL(qps_log, stonedb_sysvar_qps_log, PLUGIN_VAR_BOOL, "-", NULL, NULL, TRUE); +static MYSQL_SYSVAR_BOOL(qps_log, tianmu_sysvar_qps_log, PLUGIN_VAR_BOOL, "-", NULL, NULL, TRUE); -static MYSQL_SYSVAR_BOOL(force_hashjoin, stonedb_sysvar_force_hashjoin, PLUGIN_VAR_BOOL, "-", NULL, NULL, FALSE); -static MYSQL_SYSVAR_INT(start_async, stonedb_sysvar_start_async, PLUGIN_VAR_INT, +static MYSQL_SYSVAR_BOOL(force_hashjoin, tianmu_sysvar_force_hashjoin, PLUGIN_VAR_BOOL, "-", NULL, NULL, FALSE); +static MYSQL_SYSVAR_INT(start_async, tianmu_sysvar_start_async, PLUGIN_VAR_INT, "Enable async, specifies async threads x/100 * cpus", NULL, start_async_update, 0, 0, 100, 0); -static MYSQL_SYSVAR_STR(async_join, stonedb_sysvar_async_join, PLUGIN_VAR_STR, +static MYSQL_SYSVAR_STR(async_join, tianmu_sysvar_async_join, PLUGIN_VAR_STR, "Set async join params: packStep;traverseCount;matchCount", NULL, async_join_update, "1;0;0;0"); -static MYSQL_SYSVAR_BOOL(join_disable_switch_side, stonedb_sysvar_join_disable_switch_side, PLUGIN_VAR_BOOL, "-", NULL, +static MYSQL_SYSVAR_BOOL(join_disable_switch_side, tianmu_sysvar_join_disable_switch_side, PLUGIN_VAR_BOOL, "-", NULL, NULL, FALSE); -static MYSQL_SYSVAR_BOOL(enable_histogram_cmap_bloom, stonedb_sysvar_enable_histogram_cmap_bloom, PLUGIN_VAR_BOOL, "-", +static MYSQL_SYSVAR_BOOL(enable_histogram_cmap_bloom, tianmu_sysvar_enable_histogram_cmap_bloom, PLUGIN_VAR_BOOL, "-", NULL, NULL, FALSE); -static MYSQL_SYSVAR_UINT(result_sender_rows, stonedb_sysvar_result_sender_rows, PLUGIN_VAR_UNSIGNED, +static MYSQL_SYSVAR_UINT(result_sender_rows, tianmu_sysvar_result_sender_rows, PLUGIN_VAR_UNSIGNED, "The number of rows to load at a time when processing " "queries like select xxx from yyya", NULL, NULL, 65536, 1024, 131072, 0); @@ -630,7 +630,7 @@ void debug_update(MYSQL_THD thd, [[maybe_unused]] struct st_mysql_sys_var *var, void trace_update(MYSQL_THD thd, [[maybe_unused]] struct st_mysql_sys_var *var, void *var_ptr, const void *save) { *((int *)var_ptr) = *((int *)save); // get global mysql_sysvar_control_trace - stonedb_sysvar_controltrace = THDVAR(nullptr, control_trace); + tianmu_sysvar_controltrace = THDVAR(nullptr, control_trace); if (rceng) { core::Transaction *cur_conn = rceng->GetTx(thd); cur_conn->SetSessionTrace(*((int *)save)); @@ -664,12 +664,12 @@ void resolve_async_join_settings(const std::string &settings) { boost::split(splits_vec, settings, boost::is_any_of(";")); if (splits_vec.size() >= 4) { try { - stonedb_sysvar_async_join_setting.pack_per_step = boost::lexical_cast(splits_vec[0]); - stonedb_sysvar_async_join_setting.rows_per_step = boost::lexical_cast(splits_vec[1]); - stonedb_sysvar_async_join_setting.traverse_slices = boost::lexical_cast(splits_vec[2]); - stonedb_sysvar_async_join_setting.match_slices = boost::lexical_cast(splits_vec[3]); + tianmu_sysvar_async_join_setting.pack_per_step = boost::lexical_cast(splits_vec[0]); + tianmu_sysvar_async_join_setting.rows_per_step = boost::lexical_cast(splits_vec[1]); + tianmu_sysvar_async_join_setting.traverse_slices = boost::lexical_cast(splits_vec[2]); + tianmu_sysvar_async_join_setting.match_slices = boost::lexical_cast(splits_vec[3]); } catch (...) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed resolve async join settings"); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed resolve async join settings"); } } } @@ -681,7 +681,7 @@ void async_join_update([[maybe_unused]] MYSQL_THD thd, [[maybe_unused]] struct s resolve_async_join_settings(settings); } -static struct st_mysql_sys_var *sdb_showvars[] = {MYSQL_SYSVAR(bg_load_threads), +static struct st_mysql_sys_var *tianmu_showvars[] = {MYSQL_SYSVAR(bg_load_threads), MYSQL_SYSVAR(cachinglevel), MYSQL_SYSVAR(compensation_start), MYSQL_SYSVAR(control_trace), @@ -730,7 +730,7 @@ static struct st_mysql_sys_var *sdb_showvars[] = {MYSQL_SYSVAR(bg_load_threads), MYSQL_SYSVAR(parallel_mapjoin), MYSQL_SYSVAR(qps_log), MYSQL_SYSVAR(query_threads), - MYSQL_SYSVAR(refresh_sys_stonedb), + MYSQL_SYSVAR(refresh_sys_tianmu), MYSQL_SYSVAR(session_debug_level), MYSQL_SYSVAR(sync_buffers), MYSQL_SYSVAR(trigger_error), @@ -740,20 +740,20 @@ static struct st_mysql_sys_var *sdb_showvars[] = {MYSQL_SYSVAR(bg_load_threads), MYSQL_SYSVAR(result_sender_rows), NULL}; } // namespace dbhandler -} // namespace stonedb +} // namespace Tianmu -mysql_declare_plugin(stonedb){ +mysql_declare_plugin(tianmu){ MYSQL_STORAGE_ENGINE_PLUGIN, - &stonedb::dbhandler::stonedb_storage_engine, - "STONEDB", + &Tianmu::dbhandler::tianmu_storage_engine, + "TIANMU", "StoneAtom Group Holding Limited", - "StoneDB storage engine", + "Tianmu storage engine", PLUGIN_LICENSE_GPL, - stonedb::dbhandler::rcbase_init_func, /* Plugin Init */ - stonedb::dbhandler::rcbase_done_func, /* Plugin Deinit */ + Tianmu::dbhandler::rcbase_init_func, /* Plugin Init */ + Tianmu::dbhandler::rcbase_done_func, /* Plugin Deinit */ 0x0001 /* 0.1 */, - stonedb::dbhandler::statusvars, /* status variables */ - stonedb::dbhandler::sdb_showvars, /* system variables */ + Tianmu::dbhandler::statusvars, /* status variables */ + Tianmu::dbhandler::tianmu_showvars, /* system variables */ NULL, /* config options */ 0 /* flags for plugin */ } mysql_declare_plugin_end; diff --git a/storage/stonedb/index/kv_store.cpp b/storage/tianmu/index/kv_store.cpp similarity index 90% rename from storage/stonedb/index/kv_store.cpp rename to storage/tianmu/index/kv_store.cpp index 9471da5bcd..69a66e65d6 100644 --- a/storage/stonedb/index/kv_store.cpp +++ b/storage/tianmu/index/kv_store.cpp @@ -19,7 +19,7 @@ #include "core/engine.h" -namespace stonedb { +namespace Tianmu { namespace index { void KVStore::Init() { @@ -29,10 +29,10 @@ void KVStore::Init() { std::vector cf_handles; rocksdb::Options options; options.create_if_missing = true; - if (stonedb_sysvar_index_cache_size != 0) { + if (tianmu_sysvar_index_cache_size != 0) { bbto_.no_block_cache = false; bbto_.cache_index_and_filter_blocks = true; - bbto_.block_cache = rocksdb::NewLRUCache(stonedb_sysvar_index_cache_size << 20); + bbto_.block_cache = rocksdb::NewLRUCache(tianmu_sysvar_index_cache_size << 20); options.table_factory.reset(rocksdb::NewBlockBasedTableFactory(bbto_)); } rocksdb::DBOptions db_option(options); @@ -47,7 +47,7 @@ void KVStore::Init() { rocksdb::Status status = rocksdb::DB::ListColumnFamilies(db_option, rocksdb_datadir, &cf_names); if (!status.ok() && ( (status.subcode() == rocksdb::Status::kNone) || (status.subcode() == rocksdb::Status::kPathNotFound)) ) { - STONEDB_LOG(LogCtl_Level::INFO, "First init rocksdb, create default cloum family"); + TIANMU_LOG(LogCtl_Level::INFO, "First init rocksdb, create default cloum family"); cf_names.push_back(DEFAULT_CF_NAME); } rocksdb::ColumnFamilyOptions rs_cf_option(options); @@ -124,14 +124,14 @@ void KVStore::AsyncDropData() { DEBUG_ASSERT(cfh); rocksdb::Status status = rocksdb::DeleteFilesInRange(rdb_->GetBaseDB(), cfh, &range.start, &range.limit); if (!status.ok()) { - STONEDB_LOG(LogCtl_Level::ERROR, "RocksDB: delete file range fail, status: %s ", status.ToString().c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "RocksDB: delete file range fail, status: %s ", status.ToString().c_str()); if (status.IsShutdownInProgress()) { break; } } status = rdb_->CompactRange(options, cfh, &range.start, &range.limit); if (!status.ok()) { - STONEDB_LOG(LogCtl_Level::ERROR, "RocksDB: Compact range index fail, status: %s ", status.ToString().c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "RocksDB: Compact range index fail, status: %s ", status.ToString().c_str()); if (status.IsShutdownInProgress()) { break; } @@ -139,7 +139,7 @@ void KVStore::AsyncDropData() { } dict_manager_.finish_indexes(del_index_ids, MetaType::DDL_DROP_INDEX_ONGOING); } - STONEDB_LOG(LogCtl_Level::INFO, "KVStore drop Table thread exiting..."); + TIANMU_LOG(LogCtl_Level::INFO, "KVStore drop Table thread exiting..."); } common::ErrorCode KVStore::KVWriteTableMeta(std::shared_ptr tbl) { @@ -149,7 +149,7 @@ common::ErrorCode KVStore::KVWriteTableMeta(std::shared_ptr tbl) { std::shared_ptr defer(nullptr, [this](...) { dict_manager_.unlock(); }); ddl_manager_.put_and_write(tbl, batch); if (!dict_manager_.commit(batch)) { - STONEDB_LOG(LogCtl_Level::ERROR, "Commit table metadata fail!"); + TIANMU_LOG(LogCtl_Level::ERROR, "Commit table metadata fail!"); return common::ErrorCode::FAILED; } return common::ErrorCode::SUCCESS; @@ -181,7 +181,7 @@ common::ErrorCode KVStore::KVRenameTableMeta(const std::string &s_name, const st dict_manager_.lock(); std::shared_ptr defer(nullptr, [this](...) { dict_manager_.unlock(); }); if (!ddl_manager_.rename(s_name, d_name, batch)) { - STONEDB_LOG(LogCtl_Level::ERROR, "rename table %s not exsit", s_name.c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "rename table %s not exsit", s_name.c_str()); return common::ErrorCode::FAILED; } @@ -198,7 +198,7 @@ common::ErrorCode KVStore::KVWriteMemTableMeta(std::shared_ptr std::shared_ptr defer(nullptr, [this](...) { dict_manager_.unlock(); }); ddl_manager_.put_mem(tb_mem, batch); if (!dict_manager_.commit(batch)) { - STONEDB_LOG(LogCtl_Level::ERROR, "Commit memory table metadata fail!"); + TIANMU_LOG(LogCtl_Level::ERROR, "Commit memory table metadata fail!"); return common::ErrorCode::FAILED; } return common::ErrorCode::SUCCESS; @@ -231,7 +231,7 @@ common::ErrorCode KVStore::KVRenameMemTableMeta(std::string s_name, std::string dict_manager_.lock(); std::shared_ptr defer(nullptr, [this](...) { dict_manager_.unlock(); }); if (!ddl_manager_.rename_mem(s_name, d_name, batch)) { - STONEDB_LOG(LogCtl_Level::ERROR, "rename table %s failed", s_name.c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "rename table %s failed", s_name.c_str()); return common::ErrorCode::FAILED; } @@ -243,7 +243,7 @@ common::ErrorCode KVStore::KVRenameMemTableMeta(std::string s_name, std::string bool KVStore::KVDeleteKey(rocksdb::WriteOptions &wopts, rocksdb::ColumnFamilyHandle *cf, rocksdb::Slice &key) { rocksdb::Status s = rdb_->Delete(wopts, cf, key); if (!s.ok()) { - STONEDB_LOG(LogCtl_Level::ERROR, "Rdb delete key fail: %s", s.ToString().c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "Rdb delete key fail: %s", s.ToString().c_str()); return false; } @@ -253,7 +253,7 @@ bool KVStore::KVDeleteKey(rocksdb::WriteOptions &wopts, rocksdb::ColumnFamilyHan bool KVStore::KVWriteBatch(rocksdb::WriteOptions &wopts, rocksdb::WriteBatch *batch) { const rocksdb::Status s = rdb_->GetBaseDB()->Write(wopts, batch); if (!s.ok()) { - STONEDB_LOG(LogCtl_Level::ERROR, "Rdb write batch fail: %s", s.ToString().c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "Rdb write batch fail: %s", s.ToString().c_str()); return false; } return true; @@ -279,4 +279,4 @@ bool IndexCompactFilter::Filter([[maybe_unused]] int level, const rocksdb::Slice } } // namespace index -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/index/kv_store.h b/storage/tianmu/index/kv_store.h similarity index 97% rename from storage/stonedb/index/kv_store.h rename to storage/tianmu/index/kv_store.h index dd5a9a67df..0dc3649d63 100644 --- a/storage/stonedb/index/kv_store.h +++ b/storage/tianmu/index/kv_store.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_INDEX_KV_STORE_H_ -#define STONEDB_INDEX_KV_STORE_H_ +#ifndef TIANMU_INDEX_KV_STORE_H_ +#define TIANMU_INDEX_KV_STORE_H_ #pragma once #include @@ -32,7 +32,7 @@ #include "rocksdb/utilities/write_batch_with_index.h" #include "util/fs.h" -namespace stonedb { +namespace Tianmu { namespace index { class KVStore final { @@ -123,6 +123,6 @@ class IndexCompactFilterFactory : public rocksdb::CompactionFilterFactory { }; } // namespace index -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_INDEX_KV_STORE_H_ +#endif // TIANMU_INDEX_KV_STORE_H_ diff --git a/storage/stonedb/index/kv_transaction.cpp b/storage/tianmu/index/kv_transaction.cpp similarity index 98% rename from storage/stonedb/index/kv_transaction.cpp rename to storage/tianmu/index/kv_transaction.cpp index b56ef19a34..37187f1c1b 100644 --- a/storage/stonedb/index/kv_transaction.cpp +++ b/storage/tianmu/index/kv_transaction.cpp @@ -20,7 +20,7 @@ #include "common/common_definitions.h" #include "index/kv_store.h" -namespace stonedb { +namespace Tianmu { namespace index { KVTransaction::~KVTransaction() { @@ -113,4 +113,4 @@ void KVTransaction::Rollback() { } } // namespace index -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/index/kv_transaction.h b/storage/tianmu/index/kv_transaction.h similarity index 94% rename from storage/stonedb/index/kv_transaction.h rename to storage/tianmu/index/kv_transaction.h index a778d65f8f..42bc8ba732 100644 --- a/storage/stonedb/index/kv_transaction.h +++ b/storage/tianmu/index/kv_transaction.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_INDEX_KV_TRANSACTION_H_ -#define STONEDB_INDEX_KV_TRANSACTION_H_ +#ifndef TIANMU_INDEX_KV_TRANSACTION_H_ +#define TIANMU_INDEX_KV_TRANSACTION_H_ #pragma once #include "index/rc_table_index.h" @@ -23,7 +23,7 @@ #include "rocksdb/utilities/transaction_db.h" #include "rocksdb/utilities/write_batch_with_index.h" -namespace stonedb { +namespace Tianmu { namespace index { class KVTransaction { @@ -58,6 +58,6 @@ class KVTransaction { }; } // namespace index -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_INDEX_KV_TRANSACTION_H_ +#endif // TIANMU_INDEX_KV_TRANSACTION_H_ diff --git a/storage/stonedb/index/rc_table_index.cpp b/storage/tianmu/index/rc_table_index.cpp similarity index 93% rename from storage/stonedb/index/rc_table_index.cpp rename to storage/tianmu/index/rc_table_index.cpp index 2288efa51a..b18657043e 100644 --- a/storage/stonedb/index/rc_table_index.cpp +++ b/storage/tianmu/index/rc_table_index.cpp @@ -21,10 +21,10 @@ #include "common/common_definitions.h" #include "core/transaction.h" -#include "handler/stonedb_handler.h" +#include "handler/tianmu_handler.h" #include "index/rdb_meta_manager.h" -namespace stonedb { +namespace Tianmu { namespace index { @@ -97,12 +97,12 @@ RCTableIndex::RCTableIndex(const std::string &name, TABLE *table) { std::string fullname; if (!NormalizeName(name, fullname)) { - STONEDB_LOG(LogCtl_Level::WARN, "normalize tablename %s fail!", name.c_str()); + TIANMU_LOG(LogCtl_Level::WARN, "normalize tablename %s fail!", name.c_str()); return; } tbl_ = kvstore->FindTable(fullname); if (tbl_ == nullptr) { - STONEDB_LOG(LogCtl_Level::WARN, "find table %s fail!", fullname.c_str()); + TIANMU_LOG(LogCtl_Level::WARN, "find table %s fail!", fullname.c_str()); return; } keyid_ = table->s->primary_key; @@ -138,7 +138,7 @@ common::ErrorCode RCTableIndex::CreateIndexTable(const std::string &name, TABLE // This helps with performance and scaling out to much larger volumes than innodb supports. // It is assumed that your data preparation / ETL phase will ensure correct data being fed into columnstore. if (table->s->keys > 1) { - STONEDB_LOG(LogCtl_Level::WARN, "Table :%s have other keys except primary key, only use primary key!", name.data()); + TIANMU_LOG(LogCtl_Level::WARN, "Table :%s have other keys except primary key, only use primary key!", name.data()); } // Create table/key descriptions and put them into the data dictionary @@ -170,7 +170,7 @@ common::ErrorCode RCTableIndex::RefreshIndexTable(const std::string &name) { } tbl_ = kvstore->FindTable(fullname); if (tbl_ == nullptr) { - STONEDB_LOG(LogCtl_Level::WARN, "table %s init ddl error", fullname.c_str()); + TIANMU_LOG(LogCtl_Level::WARN, "table %s init ddl error", fullname.c_str()); return common::ErrorCode::FAILED; } rdbkey_ = tbl_->m_rdbkeys[keyid_]; @@ -226,8 +226,8 @@ common::ErrorCode RCTableIndex::CheckUniqueness(core::Transaction *tx, const roc } if (!s.ok() && !s.IsNotFound()) { - // STONEDB_LOG(LogCtl_Level::ERROR, "RockDb read fail:%s", s.ToString().c_str()); - STONEDB_LOG(LogCtl_Level::ERROR, "RockDb read fail:%s", s.getState()); + // TIANMU_LOG(LogCtl_Level::ERROR, "RockDb read fail:%s", s.ToString().c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "RockDb read fail:%s", s.getState()); return common::ErrorCode::FAILED; } @@ -252,7 +252,7 @@ common::ErrorCode RCTableIndex::InsertIndex(core::Transaction *tx, std::vectorKVTrans().Put(cf, {(const char *)key.ptr(), key.length()}, {(const char *)value.ptr(), value.length()}); if (!s.ok()) { - STONEDB_LOG(LogCtl_Level::ERROR, "RockDb: insert key fail!"); + TIANMU_LOG(LogCtl_Level::ERROR, "RockDb: insert key fail!"); rc = common::ErrorCode::FAILED; } return rc; @@ -272,7 +272,7 @@ common::ErrorCode RCTableIndex::UpdateIndex(core::Transaction *tx, std::string_v const auto cf = rdbkey_->get_cf(); tx->KVTrans().Delete(cf, {(const char *)packkey.ptr(), packkey.length()}); } else { - STONEDB_LOG(LogCtl_Level::WARN, "RockDb: don't have the key for update!"); + TIANMU_LOG(LogCtl_Level::WARN, "RockDb: don't have the key for update!"); } rc = InsertIndex(tx, nfields, row); return rc; @@ -335,7 +335,7 @@ void KeyIterator::ScanToKey(std::shared_ptr tab, std::vectorValid() || !rdbkey_->covers_key(iter_->key())) valid = false; break; default: - STONEDB_LOG(LogCtl_Level::ERROR, "key not support this op:%d", op); + TIANMU_LOG(LogCtl_Level::ERROR, "key not support this op:%d", op); valid = false; break; } @@ -405,4 +405,4 @@ common::ErrorCode KeyIterator::GetCurKV(std::vector &keys, uint64_t } } // namespace index -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/index/rc_table_index.h b/storage/tianmu/index/rc_table_index.h similarity index 95% rename from storage/stonedb/index/rc_table_index.h rename to storage/tianmu/index/rc_table_index.h index c2a9650000..3340b39fc5 100644 --- a/storage/stonedb/index/rc_table_index.h +++ b/storage/tianmu/index/rc_table_index.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_INDEX_RC_TABLE_INDEX_H_ -#define STONEDB_INDEX_RC_TABLE_INDEX_H_ +#ifndef TIANMU_INDEX_RC_TABLE_INDEX_H_ +#define TIANMU_INDEX_RC_TABLE_INDEX_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "common/common_definitions.h" #include "index/rdb_utils.h" -namespace stonedb { +namespace Tianmu { namespace core { class Transaction; } @@ -89,6 +89,6 @@ class KeyIterator final { }; } // namespace index -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_INDEX_RC_TABLE_INDEX_H_ +#endif // TIANMU_INDEX_RC_TABLE_INDEX_H_ diff --git a/storage/stonedb/index/rdb_meta_manager.cpp b/storage/tianmu/index/rdb_meta_manager.cpp similarity index 96% rename from storage/stonedb/index/rdb_meta_manager.cpp rename to storage/tianmu/index/rdb_meta_manager.cpp index e8b7c35a1c..62d1ab9b05 100644 --- a/storage/stonedb/index/rdb_meta_manager.cpp +++ b/storage/tianmu/index/rdb_meta_manager.cpp @@ -34,7 +34,7 @@ #include "index/kv_store.h" #include "index/rdb_utils.h" -namespace stonedb { +namespace Tianmu { namespace index { RdbKey::RdbKey(uint indexnr, uint keyno, rocksdb::ColumnFamilyHandle *cf_handle, uint16_t index_ver, uchar index_type, @@ -285,7 +285,7 @@ common::ErrorCode RdbKey::unpack_key(StringReader &key, StringReader &value, std case MYSQL_TYPE_FLOAT: case MYSQL_TYPE_NEWDECIMAL: { if (unpack_field_number(key, field, col.col_flag) < 0) { - STONEDB_LOG(LogCtl_Level::ERROR, "unpack numeric field failed!"); + TIANMU_LOG(LogCtl_Level::ERROR, "unpack numeric field failed!"); return common::ErrorCode::FAILED; } } break; @@ -299,7 +299,7 @@ common::ErrorCode RdbKey::unpack_key(StringReader &key, StringReader &value, std case MYSQL_TYPE_STRING: { // case sensitive for character if (unpack_field_string(key, value, field) < 0) { - STONEDB_LOG(LogCtl_Level::ERROR, "unpack string field failed!"); + TIANMU_LOG(LogCtl_Level::ERROR, "unpack string field failed!"); return common::ErrorCode::FAILED; } } break; @@ -353,7 +353,7 @@ void RdbTable::set_name(const std::string &name) { m_fullname = name; size_t dotpos = name.find('.'); if (dotpos == std::string::npos) { - STONEDB_LOG(LogCtl_Level::ERROR, "table name :%s format wrong", name.data()); + TIANMU_LOG(LogCtl_Level::ERROR, "table name :%s format wrong", name.data()); return; } m_dbname = name.substr(0, dotpos); @@ -378,7 +378,7 @@ bool DDLManager::init(DICTManager *const dict, CFManager *const cf_manager_) { if (key.size() >= INDEX_NUMBER_SIZE && memcmp(key.data(), ddl_entry, INDEX_NUMBER_SIZE)) break; if (key.size() <= INDEX_NUMBER_SIZE) { - STONEDB_LOG(LogCtl_Level::ERROR, "RocksDB: Table_store: key has length %d (corruption)", (int)key.size()); + TIANMU_LOG(LogCtl_Level::ERROR, "RocksDB: Table_store: key has length %d (corruption)", (int)key.size()); return false; } std::shared_ptr tdef = std::make_shared(key, INDEX_NUMBER_SIZE); @@ -386,7 +386,7 @@ bool DDLManager::init(DICTManager *const dict, CFManager *const cf_manager_) { // read the DDLs. const int real_val_size = val.size() - VERSION_SIZE; if (real_val_size % sizeof(GlobalId) > 0) { - STONEDB_LOG(LogCtl_Level::ERROR, "RocksDB: Table_store: invalid keylist for table %s", tdef->fullname().c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "RocksDB: Table_store: invalid keylist for table %s", tdef->fullname().c_str()); return false; } @@ -395,7 +395,7 @@ bool DDLManager::init(DICTManager *const dict, CFManager *const cf_manager_) { ptr = reinterpret_cast(val.data()); const int version = be_read_uint16(&ptr); if (version != static_cast(enumVersion::DDL_VERSION)) { - STONEDB_LOG(LogCtl_Level::ERROR, + TIANMU_LOG(LogCtl_Level::ERROR, "RocksDB: DDL ENTRY Version was not expected.Expected: %d, " "Actual: %d", static_cast(enumVersion::DDL_VERSION), version); @@ -410,14 +410,14 @@ bool DDLManager::init(DICTManager *const dict, CFManager *const cf_manager_) { uchar index_type = 0; std::vector vcols; if (!m_dict->get_index_info(gl_index_id, index_ver, index_type, vcols)) { - STONEDB_LOG(LogCtl_Level::ERROR, + TIANMU_LOG(LogCtl_Level::ERROR, "RocksDB: Could not get INDEXINFO for Index Number " "(%u,%u), table %s", gl_index_id.cf_id, gl_index_id.index_id, tdef->fullname().c_str()); return false; } if (max_index_id < gl_index_id.index_id) { - STONEDB_LOG(LogCtl_Level::ERROR, + TIANMU_LOG(LogCtl_Level::ERROR, "RocksDB: Found MetaType::MAX_INDEX_ID %u, but also found larger " "index %u from INDEXINFO.", max_index_id, gl_index_id.index_id); @@ -426,14 +426,14 @@ bool DDLManager::init(DICTManager *const dict, CFManager *const cf_manager_) { // In some abnormal condition, gl_index_id.cf_id(CF Number) is greater // than 0 like 3 or 4 just log it and set the CF to 0. if (gl_index_id.cf_id != 0) { - STONEDB_LOG(LogCtl_Level::ERROR, - "StoneDB-RocksDB: Could not get Column Family Flags for CF " + TIANMU_LOG(LogCtl_Level::ERROR, + "Tianmu-RocksDB: Could not get Column Family Flags for CF " "Number %d, table %s", gl_index_id.cf_id, tdef->fullname().c_str()); gl_index_id.cf_id = 0; } if (!m_dict->get_cf_flags(gl_index_id.cf_id, flags)) { - STONEDB_LOG(LogCtl_Level::ERROR, + TIANMU_LOG(LogCtl_Level::ERROR, "RocksDB: Could not get Column Family Flags for CF Number " "%d, table %s", gl_index_id.cf_id, tdef->fullname().c_str()); @@ -465,7 +465,7 @@ bool DDLManager::init(DICTManager *const dict, CFManager *const cf_manager_) { const uchar *ptr = reinterpret_cast(val.data()); const int version = be_read_uint16(&ptr); if (version != static_cast(enumVersion::DDL_VERSION)) { - STONEDB_LOG(LogCtl_Level::ERROR, + TIANMU_LOG(LogCtl_Level::ERROR, "RocksDB: DDL MEMTABLE ENTRY Version was not expected or " "currupt.Expected: %d, Actual: %d", static_cast(enumVersion::DDL_VERSION), version); @@ -476,7 +476,7 @@ bool DDLManager::init(DICTManager *const dict, CFManager *const cf_manager_) { const uint32_t memtable_id = be_read_uint32(&ptr); std::string table_name = std::string(key.data() + INDEX_NUMBER_SIZE, key.size() - INDEX_NUMBER_SIZE); if (max_index_id < memtable_id) { - STONEDB_LOG(LogCtl_Level::ERROR, "RocksDB: Found MAX_MEM_ID %u, but also found larger memtable id %u.", + TIANMU_LOG(LogCtl_Level::ERROR, "RocksDB: Found MAX_MEM_ID %u, but also found larger memtable id %u.", max_index_id, memtable_id); return false; } @@ -563,7 +563,7 @@ bool DDLManager::rename(const std::string &from, const std::string &to, rocksdb: new_rec->put_dict(m_dict, batch, key.ptr(), key.length()); put(new_rec); } else { - STONEDB_LOG(LogCtl_Level::WARN, "Rename table:%s have no cf_definition", from.data()); + TIANMU_LOG(LogCtl_Level::WARN, "Rename table:%s have no cf_definition", from.data()); } return true; } @@ -689,7 +689,7 @@ bool DICTManager::commit(rocksdb::WriteBatch *const batch, const bool &sync) con rocksdb::Status s = m_db->Write(options, batch); bool res = s.ok(); if (!res) { - STONEDB_LOG(LogCtl_Level::ERROR, "DICTManager::commit error"); + TIANMU_LOG(LogCtl_Level::ERROR, "DICTManager::commit error"); } batch->Clear(); return res; @@ -797,7 +797,7 @@ bool DICTManager::get_index_info(const GlobalId &gl_index_id, uint16_t &index_ve } } if (error) { - STONEDB_LOG(LogCtl_Level::ERROR, "RocksDB: Found invalid key version number (%u, %u) ", index_ver, index_type); + TIANMU_LOG(LogCtl_Level::ERROR, "RocksDB: Found invalid key version number (%u, %u) ", index_ver, index_type); } return found; } @@ -861,7 +861,7 @@ bool DICTManager::update_max_index_id(rocksdb::WriteBatch *const batch, const ui uint32_t old_index_id = -1; if (get_max_index_id(&old_index_id)) { if (old_index_id > index_id) { - STONEDB_LOG(LogCtl_Level::ERROR, "RocksDB: Found max index id %u but trying to update to %u.", old_index_id, + TIANMU_LOG(LogCtl_Level::ERROR, "RocksDB: Found max index id %u but trying to update to %u.", old_index_id, index_id); return true; } @@ -1008,4 +1008,4 @@ std::vector CFManager::get_all_cf(void) { } } // namespace index -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/index/rdb_meta_manager.h b/storage/tianmu/index/rdb_meta_manager.h similarity index 98% rename from storage/stonedb/index/rdb_meta_manager.h rename to storage/tianmu/index/rdb_meta_manager.h index 8a9153cb8a..1a1573d3f4 100644 --- a/storage/stonedb/index/rdb_meta_manager.h +++ b/storage/tianmu/index/rdb_meta_manager.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_INDEX_RDB_META_MANAGER_H_ -#define STONEDB_INDEX_RDB_META_MANAGER_H_ +#ifndef TIANMU_INDEX_RDB_META_MANAGER_H_ +#define TIANMU_INDEX_RDB_META_MANAGER_H_ #pragma once #include @@ -31,7 +31,7 @@ #include "rocksdb/utilities/transaction_db.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace core { class RCMemTable; } @@ -305,6 +305,6 @@ inline bool IsRowStoreCF(std::string cf_name) { }; } // namespace index -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_INDEX_RDB_META_MANAGER_H_ +#endif // TIANMU_INDEX_RDB_META_MANAGER_H_ diff --git a/storage/stonedb/index/rdb_utils.h b/storage/tianmu/index/rdb_utils.h similarity index 95% rename from storage/stonedb/index/rdb_utils.h rename to storage/tianmu/index/rdb_utils.h index 38ecb1a524..6358cfde0e 100644 --- a/storage/stonedb/index/rdb_utils.h +++ b/storage/tianmu/index/rdb_utils.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_INDEX_RDB_UTILS_H_ -#define STONEDB_INDEX_RDB_UTILS_H_ +#ifndef TIANMU_INDEX_RDB_UTILS_H_ +#define TIANMU_INDEX_RDB_UTILS_H_ #pragma once #include @@ -27,7 +27,7 @@ #include "rocksdb/db.h" #include "util/fs.h" -namespace stonedb { +namespace Tianmu { namespace index { enum class Separator { LE_SPACES = 1, EQ_SPACES, GE_SPACES }; @@ -153,7 +153,7 @@ class StringReader { void read_uint8(uchar *const res) { const uchar *p; if (!(p = reinterpret_cast(read(1)))) - STONEDB_ERROR("bad read_uint8"); + TIANMU_ERROR("bad read_uint8"); else { *res = *p; } @@ -162,7 +162,7 @@ class StringReader { void read_uint16(uint16_t *const res) { const uchar *p; if (!(p = reinterpret_cast(read(2)))) - STONEDB_ERROR("bad read_uint16"); + TIANMU_ERROR("bad read_uint16"); else { *res = be_to_uint16(p); } @@ -171,7 +171,7 @@ class StringReader { void read_uint32(uint32_t *const res) { const uchar *p; if (!(p = reinterpret_cast(read(4)))) - STONEDB_ERROR("bad read_uint32"); + TIANMU_ERROR("bad read_uint32"); else { *res = be_to_uint32(p); } @@ -180,7 +180,7 @@ class StringReader { void read_uint64(uint64_t *const res) { const uchar *p; if (!(p = reinterpret_cast(read(sizeof(uint64_t))))) { - STONEDB_ERROR("bad read_uint64"); + TIANMU_ERROR("bad read_uint64"); } else { *res = be_to_uint64(p); } @@ -252,6 +252,6 @@ inline bool NormalizeName(const std::string &path, std::string &name) { } } // namespace index -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_INDEX_RDB_UTILS_H_ +#endif // TIANMU_INDEX_RDB_UTILS_H_ diff --git a/storage/stonedb/loader/load_parser.cpp b/storage/tianmu/loader/load_parser.cpp similarity index 98% rename from storage/stonedb/loader/load_parser.cpp rename to storage/tianmu/loader/load_parser.cpp index 6b9e08b742..0848c60fc5 100644 --- a/storage/stonedb/loader/load_parser.cpp +++ b/storage/tianmu/loader/load_parser.cpp @@ -25,7 +25,7 @@ #include "system/io_parameters.h" #include "util/timer.h" -namespace stonedb { +namespace Tianmu { namespace loader { LoadParser::LoadParser(RCAttrPtrVect_t &attrs, const system::IOParameters &iop, uint packsize, std::unique_ptr &f) @@ -175,7 +175,7 @@ int LoadParser::ProcessInsertIndex(std::shared_ptr tab, std } if (tab->InsertIndex(current_tx, fields, no_obj + no_rows) == common::ErrorCode::DUPP_KEY) { - STONEDB_LOG(LogCtl_Level::INFO, "Load discard this row for duplicate key"); + TIANMU_LOG(LogCtl_Level::INFO, "Load discard this row for duplicate key"); return HA_ERR_FOUND_DUPP_KEY; } @@ -212,4 +212,4 @@ int LoadParser::binlog_loaded_block(const char *buf_start, const char *buf_end) } } // namespace loader -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/loader/load_parser.h b/storage/tianmu/loader/load_parser.h similarity index 93% rename from storage/stonedb/loader/load_parser.h rename to storage/tianmu/loader/load_parser.h index 8d9d953480..c9bd8c0d82 100644 --- a/storage/stonedb/loader/load_parser.h +++ b/storage/tianmu/loader/load_parser.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_LOADER_LOAD_PARSER_H_ -#define STONEDB_LOADER_LOAD_PARSER_H_ +#ifndef TIANMU_LOADER_LOAD_PARSER_H_ +#define TIANMU_LOADER_LOAD_PARSER_H_ #pragma once #include @@ -26,7 +26,7 @@ #include "loader/value_cache.h" #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace core { class RCAttr; @@ -82,6 +82,6 @@ class LoadParser final { }; } // namespace loader -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_LOADER_LOAD_PARSER_H_ +#endif // TIANMU_LOADER_LOAD_PARSER_H_ diff --git a/storage/stonedb/loader/parsing_strategy.cpp b/storage/tianmu/loader/parsing_strategy.cpp similarity index 98% rename from storage/stonedb/loader/parsing_strategy.cpp rename to storage/tianmu/loader/parsing_strategy.cpp index a98a487a0c..4212a512b3 100644 --- a/storage/stonedb/loader/parsing_strategy.cpp +++ b/storage/tianmu/loader/parsing_strategy.cpp @@ -27,7 +27,7 @@ #include "system/rc_system.h" #include "types/value_parser4txt.h" -namespace stonedb { +namespace Tianmu { namespace loader { static inline void PrepareKMP(ParsingStrategy::kmp_next_t &kmp_next, std::string const &pattern) { @@ -407,7 +407,7 @@ void ParsingStrategy::GetValue(const char *value_ptr, size_t value_size, ushort if (ati.CharLen() < (uint)value_size) { std::string valueStr(value_ptr, value_size); value_size = ati.CharLen(); - STONEDB_LOG(LogCtl_Level::DEBUG, "Data format error. DbName:%s ,TableName:%s ,Col %d, value:%s", dbname.c_str(), + TIANMU_LOG(LogCtl_Level::DEBUG, "Data format error. DbName:%s ,TableName:%s ,Col %d, value:%s", dbname.c_str(), tablename.c_str(), col, valueStr.c_str()); std::stringstream err_msg; err_msg << "data truncate,col num" << col << " value:" << valueStr << std::endl; @@ -459,4 +459,4 @@ void ParsingStrategy::GetValue(const char *value_ptr, size_t value_size, ushort } } // namespace loader -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/loader/parsing_strategy.h b/storage/tianmu/loader/parsing_strategy.h similarity index 93% rename from storage/stonedb/loader/parsing_strategy.h rename to storage/tianmu/loader/parsing_strategy.h index 2f17b17873..567ec4283f 100644 --- a/storage/stonedb/loader/parsing_strategy.h +++ b/storage/tianmu/loader/parsing_strategy.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_LOADER_PARSING_STRATEGY_H_ -#define STONEDB_LOADER_PARSING_STRATEGY_H_ +#ifndef TIANMU_LOADER_PARSING_STRATEGY_H_ +#define TIANMU_LOADER_PARSING_STRATEGY_H_ #pragma once #include "common/data_format.h" #include "core/rc_attr_typeinfo.h" #include "loader/value_cache.h" -namespace stonedb { +namespace Tianmu { namespace loader { class ParsingStrategy final { @@ -74,6 +74,6 @@ class ParsingStrategy final { }; } // namespace loader -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_LOADER_PARSING_STRATEGY_H_ +#endif // TIANMU_LOADER_PARSING_STRATEGY_H_ diff --git a/storage/stonedb/loader/read_buffer.cpp b/storage/tianmu/loader/read_buffer.cpp similarity index 85% rename from storage/stonedb/loader/read_buffer.cpp rename to storage/tianmu/loader/read_buffer.cpp index dbe942c28f..f1711e96d9 100644 --- a/storage/stonedb/loader/read_buffer.cpp +++ b/storage/tianmu/loader/read_buffer.cpp @@ -19,7 +19,7 @@ #include "core/transaction.h" -namespace stonedb { +namespace Tianmu { namespace loader { ReadBuffer::ReadBuffer(int num, int requested_size) : size_(requested_size), bufs_(num) { @@ -49,15 +49,15 @@ ReadBuffer::~ReadBuffer() { read_thread_.join(); } - if (sdb_stream_) sdb_stream_->Close(); + if (tianmu_stream_) tianmu_stream_->Close(); } bool ReadBuffer::BufOpen(std::unique_ptr &s) { - sdb_stream_ = std::move(s); + tianmu_stream_ = std::move(s); auto r = Read(buf_ + buf_used_, size_); if (r == -1) { - sdb_stream_->Close(); + tianmu_stream_->Close(); buf_incomplete_ = false; return false; } @@ -68,7 +68,7 @@ bool ReadBuffer::BufOpen(std::unique_ptr &s) { } buf_incomplete_ = true; } else { - sdb_stream_->Close(); + tianmu_stream_->Close(); buf_incomplete_ = false; } @@ -80,7 +80,7 @@ bool ReadBuffer::StartReadingThread() { if (!read_thread_buffer_) { read_thread_buffer_ = std::unique_ptr(new char[size_]); if (!read_thread_buffer_) { - STONEDB_LOG(LogCtl_Level::ERROR, "out of memory (%d bytes failed). (42)", size_); + TIANMU_LOG(LogCtl_Level::ERROR, "out of memory (%d bytes failed). (42)", size_); return false; } } @@ -99,12 +99,12 @@ int ReadBuffer::BufFetch(int unused_bytes) { std::scoped_lock guard(read_mutex_); if (bytes_in_read_thread_buffer_ == -1) { - sdb_stream_->Close(); + tianmu_stream_->Close(); buf_incomplete_ = false; throw common::FileException("Unable to read from the input file."); } - if ((!sdb_stream_->IsOpen() && bytes_in_read_thread_buffer_ == 0) || to_read == unused_bytes) return 0; + if ((!tianmu_stream_->IsOpen() && bytes_in_read_thread_buffer_ == 0) || to_read == unused_bytes) return 0; for (int i = 0; i < unused_bytes; i++) buf2_[i] = *(buf_ + ((buf_used_ - unused_bytes) + i)); to_read -= unused_bytes; @@ -120,19 +120,19 @@ int ReadBuffer::BufFetch(int unused_bytes) { to_read -= to_read_from_th_buf; buf_used_ = unused_bytes; - if (sdb_stream_->IsOpen()) { + if (tianmu_stream_->IsOpen()) { ushort no_steps = 0; int r = 0; while (no_steps < 15 && to_read > 0) { try { - r = sdb_stream_->Read(buf2_ + unused_bytes, to_read); + r = tianmu_stream_->Read(buf2_ + unused_bytes, to_read); } catch (common::DatabaseException &) { r = -1; } if (r != -1) { buf_used_ += r; if (r == 0) { - sdb_stream_->Close(); + tianmu_stream_->Close(); buf_incomplete_ = false; break; } else { @@ -145,12 +145,12 @@ int ReadBuffer::BufFetch(int unused_bytes) { break; } else { no_steps++; - STONEDB_LOG(LogCtl_Level::WARN, "Reading from the input file error: %s", std::strerror(errno)); + TIANMU_LOG(LogCtl_Level::WARN, "Reading from the input file error: %s", std::strerror(errno)); std::this_thread::sleep_for(std::chrono::milliseconds(500 + no_steps * 500)); } } if (r == -1) { - sdb_stream_->Close(); + tianmu_stream_->Close(); buf_incomplete_ = false; throw common::FileException("Unable to read from the input file."); } @@ -171,7 +171,7 @@ int ReadBuffer::Read(char *buffer, int bytes_to_read) { bool do_stop = false; while (!do_stop) { try { - read_b = sdb_stream_->Read(buffer + bytes_read, std::min(bytes_to_read, requested_size - bytes_read)); + read_b = tianmu_stream_->Read(buffer + bytes_read, std::min(bytes_to_read, requested_size - bytes_read)); } catch (common::DatabaseException &) { read_b = -1; } @@ -201,7 +201,7 @@ void ReadBuffer::ReadThread() { no_read_bytes = 0; { std::scoped_lock guard(read_mutex_); - if (!buf_incomplete_ || !sdb_stream_->IsOpen() || stop_reading_thread_) { + if (!buf_incomplete_ || !tianmu_stream_->IsOpen() || stop_reading_thread_) { break; } @@ -211,14 +211,14 @@ void ReadBuffer::ReadThread() { ushort no_steps = 0; while (no_steps < 15 && to_read > 0) { try { - no_read_bytes = sdb_stream_->Read(read_thread_buffer_.get() + bytes_in_read_thread_buffer_, to_read); + no_read_bytes = tianmu_stream_->Read(read_thread_buffer_.get() + bytes_in_read_thread_buffer_, to_read); } catch (common::DatabaseException &) { no_read_bytes = -1; } if (no_read_bytes == -1) { no_steps++; - STONEDB_LOG(LogCtl_Level::WARN, "Reading from the input file error: %s", std::strerror(errno)); + TIANMU_LOG(LogCtl_Level::WARN, "Reading from the input file error: %s", std::strerror(errno)); std::this_thread::sleep_for(std::chrono::milliseconds(500 + no_steps * 500)); do_stop = true; } else { @@ -227,7 +227,7 @@ void ReadBuffer::ReadThread() { if (no_read_bytes != 0) buf_incomplete_ = true; else { - sdb_stream_->Close(); + tianmu_stream_->Close(); buf_incomplete_ = false; do_stop = true; } @@ -272,4 +272,4 @@ int ReadBuffer::FindUnusedBuf() { } } // namespace loader -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/loader/read_buffer.h b/storage/tianmu/loader/read_buffer.h similarity index 90% rename from storage/stonedb/loader/read_buffer.h rename to storage/tianmu/loader/read_buffer.h index 58a8b6000a..2204ea1f54 100644 --- a/storage/stonedb/loader/read_buffer.h +++ b/storage/tianmu/loader/read_buffer.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_LOADER_READ_BUFFER_H_ -#define STONEDB_LOADER_READ_BUFFER_H_ +#ifndef TIANMU_LOADER_READ_BUFFER_H_ +#define TIANMU_LOADER_READ_BUFFER_H_ #pragma once #include @@ -26,7 +26,7 @@ #include "mm/traceable_object.h" #include "system/stream.h" -namespace stonedb { +namespace Tianmu { namespace loader { class ReadBuffer final : public mm::TraceableObject { @@ -53,7 +53,7 @@ class ReadBuffer final : public mm::TraceableObject { std::vector> bufs_; std::unique_ptr read_thread_buffer_; - std::unique_ptr sdb_stream_; + std::unique_ptr tianmu_stream_; std::mutex read_mutex_; @@ -71,6 +71,6 @@ class ReadBuffer final : public mm::TraceableObject { }; } // namespace loader -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_LOADER_READ_BUFFER_H_ +#endif // TIANMU_LOADER_READ_BUFFER_H_ diff --git a/storage/stonedb/loader/rejecter.cpp b/storage/tianmu/loader/rejecter.cpp similarity index 82% rename from storage/stonedb/loader/rejecter.cpp rename to storage/tianmu/loader/rejecter.cpp index 45789e7ec4..2993825fe4 100644 --- a/storage/stonedb/loader/rejecter.cpp +++ b/storage/tianmu/loader/rejecter.cpp @@ -19,7 +19,7 @@ #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace loader { Rejecter::Rejecter(int packrowSize, std::string const &path, int64_t abortOnCount, double abortOnThreshold) @@ -36,17 +36,17 @@ void Rejecter::ConsumeBadRow(char const *ptr, int64_t size, int64_t row_no, int if (!reject_file_.empty()) { if (!writer_.get()) { - writer_.reset(new system::StoneDBFile()); + writer_.reset(new system::TianmuFile()); writer_->OpenCreateNotExists(reject_file_); } writer_->WriteExact(ptr, static_cast(size)); } - STONEDB_LOG(LogCtl_Level::WARN, "Loading file error, row %ld, around:", row_no); - STONEDB_LOG(LogCtl_Level::WARN, "---------------------------------------------\n"); - STONEDB_LOG(LogCtl_Level::WARN, "%s", ptr); - STONEDB_LOG(LogCtl_Level::WARN, "---------------------------------------------"); + TIANMU_LOG(LogCtl_Level::WARN, "Loading file error, row %ld, around:", row_no); + TIANMU_LOG(LogCtl_Level::WARN, "---------------------------------------------\n"); + TIANMU_LOG(LogCtl_Level::WARN, "%s", ptr); + TIANMU_LOG(LogCtl_Level::WARN, "---------------------------------------------"); if (abort_on_threshold_ > 0) { if (row_no > packrow_size_) @@ -59,4 +59,4 @@ void Rejecter::ConsumeBadRow(char const *ptr, int64_t size, int64_t row_no, int } } // namespace loader -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/loader/rejecter.h b/storage/tianmu/loader/rejecter.h similarity index 85% rename from storage/stonedb/loader/rejecter.h rename to storage/tianmu/loader/rejecter.h index 9bb09c2d92..a1b612d55d 100644 --- a/storage/stonedb/loader/rejecter.h +++ b/storage/tianmu/loader/rejecter.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_LOADER_REJECTER_H_ -#define STONEDB_LOADER_REJECTER_H_ +#ifndef TIANMU_LOADER_REJECTER_H_ +#define TIANMU_LOADER_REJECTER_H_ #pragma once #include -#include "system/stonedb_file.h" +#include "system/tianmu_file.h" -namespace stonedb { +namespace Tianmu { namespace loader { class Rejecter { @@ -30,7 +30,7 @@ class Rejecter { std::string reject_file_; int64_t abort_on_count_; double abort_on_threshold_; - std::unique_ptr writer_; + std::unique_ptr writer_; int64_t packrow_size_; int64_t rejected_; @@ -46,6 +46,6 @@ class Rejecter { }; } // namespace loader -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_LOADER_REJECTER_H_ +#endif // TIANMU_LOADER_REJECTER_H_ diff --git a/storage/stonedb/loader/value_cache.cpp b/storage/tianmu/loader/value_cache.cpp similarity index 98% rename from storage/stonedb/loader/value_cache.cpp rename to storage/tianmu/loader/value_cache.cpp index 4ef708b73b..780d8f41f0 100644 --- a/storage/stonedb/loader/value_cache.cpp +++ b/storage/tianmu/loader/value_cache.cpp @@ -22,7 +22,7 @@ #include "common/assert.h" #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace loader { ValueCache::ValueCache(size_t valueCount, size_t initialCapacity) : value_count_(valueCount) { @@ -117,4 +117,4 @@ void ValueCache::CalcStrStats(types::BString &min_s, types::BString &max_s, uint } } // namespace loader -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/loader/value_cache.h b/storage/tianmu/loader/value_cache.h similarity index 95% rename from storage/stonedb/loader/value_cache.h rename to storage/tianmu/loader/value_cache.h index 8077774755..5a15d651d7 100644 --- a/storage/stonedb/loader/value_cache.h +++ b/storage/tianmu/loader/value_cache.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_LOADER_VALUE_CACHE_H_ -#define STONEDB_LOADER_VALUE_CACHE_H_ +#ifndef TIANMU_LOADER_VALUE_CACHE_H_ +#define TIANMU_LOADER_VALUE_CACHE_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "common/common_definitions.h" #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace loader { class ValueCache final { @@ -130,6 +130,6 @@ class ValueCache final { }; } // namespace loader -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_LOADER_VALUE_CACHE_H_ +#endif // TIANMU_LOADER_VALUE_CACHE_H_ diff --git a/storage/stonedb/mm/heap_policy.h b/storage/tianmu/mm/heap_policy.h similarity index 90% rename from storage/stonedb/mm/heap_policy.h rename to storage/tianmu/mm/heap_policy.h index 1c3dabb21e..a2c41ba269 100644 --- a/storage/stonedb/mm/heap_policy.h +++ b/storage/tianmu/mm/heap_policy.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_HEAP_POLICY_H_ -#define STONEDB_MM_HEAP_POLICY_H_ +#ifndef TIANMU_MM_HEAP_POLICY_H_ +#define TIANMU_MM_HEAP_POLICY_H_ #pragma once #include "mm/memory_block.h" -namespace stonedb { +namespace Tianmu { namespace mm { enum class HEAP_STATUS { HEAP_SUCCESS, HEAP_OUT_OF_MEMORY, HEAP_CORRUPTED, HEAP_ERROR }; @@ -43,6 +43,6 @@ class HeapPolicy { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_HEAP_POLICY_H_ +#endif // TIANMU_MM_HEAP_POLICY_H_ diff --git a/storage/stonedb/mm/huge_heap_policy.cpp b/storage/tianmu/mm/huge_heap_policy.cpp similarity index 96% rename from storage/stonedb/mm/huge_heap_policy.cpp rename to storage/tianmu/mm/huge_heap_policy.cpp index a0af5fe716..d61142658c 100644 --- a/storage/stonedb/mm/huge_heap_policy.cpp +++ b/storage/tianmu/mm/huge_heap_policy.cpp @@ -24,7 +24,7 @@ #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace mm { HugeHeap::HugeHeap(std::string hugedir, size_t size) : TCMHeap(0) { @@ -38,7 +38,7 @@ HugeHeap::HugeHeap(std::string hugedir, size_t size) : TCMHeap(0) { char pidtext[12]; std::strcpy(huge_filename_, hugedir.c_str()); std::sprintf(pidtext, "%d", getpid()); - std::strcat(huge_filename_, "/sdbhuge."); + std::strcat(huge_filename_, "/tianmuhuge."); std::strcat(huge_filename_, pidtext); fd_ = open(huge_filename_, O_CREAT | O_RDWR, 0700); if (fd_ < 0) { @@ -79,4 +79,4 @@ HugeHeap::~HugeHeap() { } } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/huge_heap_policy.h b/storage/tianmu/mm/huge_heap_policy.h similarity index 86% rename from storage/stonedb/mm/huge_heap_policy.h rename to storage/tianmu/mm/huge_heap_policy.h index 3abfb062f9..f4d3cc8dbd 100644 --- a/storage/stonedb/mm/huge_heap_policy.h +++ b/storage/tianmu/mm/huge_heap_policy.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_HUGE_HEAP_POLICY_H_ -#define STONEDB_MM_HUGE_HEAP_POLICY_H_ +#ifndef TIANMU_MM_HUGE_HEAP_POLICY_H_ +#define TIANMU_MM_HUGE_HEAP_POLICY_H_ #pragma once #include #include "mm/tcm_heap_policy.h" -namespace stonedb { +namespace Tianmu { namespace mm { class HugeHeap : public TCMHeap { @@ -37,6 +37,6 @@ class HugeHeap : public TCMHeap { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_HUGE_HEAP_POLICY_H_ +#endif // TIANMU_MM_HUGE_HEAP_POLICY_H_ diff --git a/storage/stonedb/mm/initializer.cpp b/storage/tianmu/mm/initializer.cpp similarity index 95% rename from storage/stonedb/mm/initializer.cpp rename to storage/tianmu/mm/initializer.cpp index b795183049..b2ecce934a 100644 --- a/storage/stonedb/mm/initializer.cpp +++ b/storage/tianmu/mm/initializer.cpp @@ -17,7 +17,7 @@ #include "initializer.h" -namespace stonedb { +namespace Tianmu { namespace mm { MemoryManagerInitializer *MemoryManagerInitializer::instance = NULL; @@ -25,4 +25,4 @@ MemoryManagerInitializer *MemoryManagerInitializer::instance = NULL; bool MemoryManagerInitializer::m_report_leaks = false; } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/initializer.h b/storage/tianmu/mm/initializer.h similarity index 93% rename from storage/stonedb/mm/initializer.h rename to storage/tianmu/mm/initializer.h index 22e50b4c75..674eadff59 100644 --- a/storage/stonedb/mm/initializer.h +++ b/storage/tianmu/mm/initializer.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_INITIALIZER_H_ -#define STONEDB_MM_INITIALIZER_H_ +#ifndef TIANMU_MM_INITIALIZER_H_ +#define TIANMU_MM_INITIALIZER_H_ #pragma once #include "common/assert.h" #include "common/exception.h" #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace mm { class MemoryManagerInitializer : public TraceableObject { @@ -56,6 +56,6 @@ class MemoryManagerInitializer : public TraceableObject { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_INITIALIZER_H_ +#endif // TIANMU_MM_INITIALIZER_H_ diff --git a/storage/stonedb/mm/memory_block.h b/storage/tianmu/mm/memory_block.h similarity index 86% rename from storage/stonedb/mm/memory_block.h rename to storage/tianmu/mm/memory_block.h index d7a904300e..1920321cf1 100644 --- a/storage/stonedb/mm/memory_block.h +++ b/storage/tianmu/mm/memory_block.h @@ -14,11 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_MEMORY_BLOCK_H_ -#define STONEDB_MM_MEMORY_BLOCK_H_ +#ifndef TIANMU_MM_MEMORY_BLOCK_H_ +#define TIANMU_MM_MEMORY_BLOCK_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace mm { enum class BLOCK_TYPE : char { @@ -30,6 +30,6 @@ enum class BLOCK_TYPE : char { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_MEMORY_BLOCK_H_ +#endif // TIANMU_MM_MEMORY_BLOCK_H_ diff --git a/storage/stonedb/mm/memory_handling_policy.cpp b/storage/tianmu/mm/memory_handling_policy.cpp similarity index 94% rename from storage/stonedb/mm/memory_handling_policy.cpp rename to storage/tianmu/mm/memory_handling_policy.cpp index 045edb872f..8524214f29 100644 --- a/storage/stonedb/mm/memory_handling_policy.cpp +++ b/storage/tianmu/mm/memory_handling_policy.cpp @@ -42,7 +42,7 @@ #include "system/rc_system.h" #include "tcm/page_heap.h" -namespace stonedb { +namespace Tianmu { namespace mm { unsigned long long MemoryHandling::getReleaseCount1() { return _releasePolicy->getCount1(); } @@ -72,10 +72,10 @@ MemoryHandling::MemoryHandling([[maybe_unused]] size_t comp_heap_size, size_t un m_free_size(0) { int64_t adj_mh_size, lt_size; std::string conf_error; - std::string rpolicy = stonedb_sysvar_mm_releasepolicy; - std::string hpolicy = stonedb_sysvar_mm_policy; - int hlimit = stonedb_sysvar_mm_hardlimit; - float ltemp = stonedb_sysvar_mm_largetempratio / 100.0f; + std::string rpolicy = tianmu_sysvar_mm_releasepolicy; + std::string hpolicy = tianmu_sysvar_mm_policy; + int hlimit = tianmu_sysvar_mm_hardlimit; + float ltemp = tianmu_sysvar_mm_largetempratio / 100.0f; // rccontrol << lock << "Large Temp Ratio: " << ltemp << unlock; @@ -91,8 +91,8 @@ MemoryHandling::MemoryHandling([[maybe_unused]] size_t comp_heap_size, size_t un lt_size = 0; } - STONEDB_LOG(LogCtl_Level::INFO, "Adjusted Main Heap size = %ld", adj_mh_size); - STONEDB_LOG(LogCtl_Level::INFO, "Adjusted LT Heap size = %ld", lt_size); + TIANMU_LOG(LogCtl_Level::INFO, "Adjusted Main Heap size = %ld", adj_mh_size); + TIANMU_LOG(LogCtl_Level::INFO, "Adjusted LT Heap size = %ld", lt_size); // Which heaps to use if (hpolicy == "system") { @@ -178,7 +178,7 @@ void *MemoryHandling::alloc(size_t size, BLOCK_TYPE type, TraceableObject *owner // 2. it is hardcoded off // if (m_huge_heap->getHeapStatus() == HEAP_STATUS::HEAP_SUCCESS) // heap = m_huge_heap; - if ((m_large_temp != NULL) && (size >= (stonedb_sysvar_mm_large_threshold * 1_MB))) + if ((m_large_temp != NULL) && (size >= (tianmu_sysvar_mm_large_threshold * 1_MB))) switch (owner->TraceableType()) { case TO_TYPE::TO_SORTER: case TO_TYPE::TO_CACHEDBUFFER: @@ -225,9 +225,9 @@ void *MemoryHandling::alloc(size_t size, BLOCK_TYPE type, TraceableObject *owner } else { m_alloc_objs++; // TBD: pool these objects - auto stonedb = new PtrHeapMap(); - stonedb->insert(std::make_pair((void *)res, heap)); - m_objs.insert(std::make_pair(owner, stonedb)); + auto tianmu = new PtrHeapMap(); + tianmu->insert(std::make_pair((void *)res, heap)); + m_objs.insert(std::make_pair(owner, tianmu)); } size_t bsize = heap->getBlockSize(res); m_alloc_blocks++; @@ -321,8 +321,8 @@ bool MemoryHandling::ReleaseMemory(size_t size, [[maybe_unused]] TraceableObject // - release all packs that have an allocation outside of main heap on // non-small size alloc // - dont do this everytime because walking through the entire heap is slow - if (size > static_cast(stonedb_sysvar_cachesizethreshold * 1_MB) || - m_release_count > stonedb_sysvar_cachereleasethreshold) { + if (size > static_cast(tianmu_sysvar_cachesizethreshold * 1_MB) || + m_release_count > tianmu_sysvar_cachereleasethreshold) { m_release_count = 0; std::vector dps; @@ -392,7 +392,7 @@ void MemoryHandling::ReportLeaks() { size += it2.second->getBlockSize(it2.first); } } - if (blocks > 0) STONEDB_LOG(LogCtl_Level::WARN, "%d memory block(s) leaked total size = %ld", blocks, size); + if (blocks > 0) TIANMU_LOG(LogCtl_Level::WARN, "%d memory block(s) leaked total size = %ld", blocks, size); } void MemoryHandling::EnsureNoLeakedTraceableObject() { @@ -400,7 +400,7 @@ void MemoryHandling::EnsureNoLeakedTraceableObject() { for (auto it : m_objs) { if (it.first->IsLocked() && (it.first->NumOfLocks() > 1 || it.first->TraceableType() == TO_TYPE::TO_PACK)) { error_found = true; - STONEDB_LOG(LogCtl_Level::ERROR, "Object @[%ld] locked too many times. Object type: %d, no. locks: %d", + TIANMU_LOG(LogCtl_Level::ERROR, "Object @[%ld] locked too many times. Object type: %d, no. locks: %d", long(it.first), int(it.first->TraceableType()), int(it.first->NumOfLocks())); } } @@ -560,4 +560,4 @@ void MemoryHandling::StopAccessTracking(TraceableObject *o) { } } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/memory_handling_policy.h b/storage/tianmu/mm/memory_handling_policy.h similarity index 95% rename from storage/stonedb/mm/memory_handling_policy.h rename to storage/tianmu/mm/memory_handling_policy.h index d674113795..3e033f8b14 100644 --- a/storage/stonedb/mm/memory_handling_policy.h +++ b/storage/tianmu/mm/memory_handling_policy.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_MEMORY_HANDLING_POLICY_H_ -#define STONEDB_MM_MEMORY_HANDLING_POLICY_H_ +#ifndef TIANMU_MM_MEMORY_HANDLING_POLICY_H_ +#define TIANMU_MM_MEMORY_HANDLING_POLICY_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "common/assert.h" #include "mm/memory_block.h" -namespace stonedb { +namespace Tianmu { namespace core { class DataCache; } // namespace core @@ -105,6 +105,6 @@ class MemoryHandling { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_MEMORY_HANDLING_POLICY_H_ +#endif // TIANMU_MM_MEMORY_HANDLING_POLICY_H_ diff --git a/storage/stonedb/mm/mm_guard.h b/storage/tianmu/mm/mm_guard.h similarity index 95% rename from storage/stonedb/mm/mm_guard.h rename to storage/tianmu/mm/mm_guard.h index 06cb7db7cf..0fc78dddc6 100644 --- a/storage/stonedb/mm/mm_guard.h +++ b/storage/tianmu/mm/mm_guard.h @@ -14,12 +14,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_MM_GUARD_H_ -#define STONEDB_MM_MM_GUARD_H_ +#ifndef TIANMU_MM_MM_GUARD_H_ +#define TIANMU_MM_MM_GUARD_H_ #pragma once #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace mm { template @@ -122,6 +122,6 @@ class MMGuard final : public TraceableAccounting { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_MM_GUARD_H_ +#endif // TIANMU_MM_MM_GUARD_H_ diff --git a/storage/stonedb/mm/mysql_heap_policy.cpp b/storage/tianmu/mm/mysql_heap_policy.cpp similarity index 97% rename from storage/stonedb/mm/mysql_heap_policy.cpp rename to storage/tianmu/mm/mysql_heap_policy.cpp index 8d5b74f5f4..bec708d5c9 100644 --- a/storage/stonedb/mm/mysql_heap_policy.cpp +++ b/storage/tianmu/mm/mysql_heap_policy.cpp @@ -21,7 +21,7 @@ #include "my_sys.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace mm { MySQLHeap::~MySQLHeap() {} @@ -51,4 +51,4 @@ size_t MySQLHeap::getBlockSize(void *mh) { } } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/mysql_heap_policy.h b/storage/tianmu/mm/mysql_heap_policy.h similarity index 88% rename from storage/stonedb/mm/mysql_heap_policy.h rename to storage/tianmu/mm/mysql_heap_policy.h index b67fc920ca..cf3e96ac8f 100644 --- a/storage/stonedb/mm/mysql_heap_policy.h +++ b/storage/tianmu/mm/mysql_heap_policy.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_MYSQL_HEAP_POLICY_H_ -#define STONEDB_MM_MYSQL_HEAP_POLICY_H_ +#ifndef TIANMU_MM_MYSQL_HEAP_POLICY_H_ +#define TIANMU_MM_MYSQL_HEAP_POLICY_H_ #pragma once #include #include "mm/heap_policy.h" -namespace stonedb { +namespace Tianmu { namespace mm { class MySQLHeap : public HeapPolicy { @@ -45,6 +45,6 @@ class MySQLHeap : public HeapPolicy { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_MYSQL_HEAP_POLICY_H_ +#endif // TIANMU_MM_MYSQL_HEAP_POLICY_H_ diff --git a/storage/stonedb/mm/numa_heap_policy.cpp b/storage/tianmu/mm/numa_heap_policy.cpp similarity index 98% rename from storage/stonedb/mm/numa_heap_policy.cpp rename to storage/tianmu/mm/numa_heap_policy.cpp index d3cb479ca6..f66a9819b7 100644 --- a/storage/stonedb/mm/numa_heap_policy.cpp +++ b/storage/tianmu/mm/numa_heap_policy.cpp @@ -25,7 +25,7 @@ #define NUMA_VERSION1_COMPATIBILITY #include -namespace stonedb { +namespace Tianmu { namespace mm { NUMAHeap::NUMAHeap(size_t size) : HeapPolicy(size) { m_avail = (numa_available() != -1); @@ -116,6 +116,6 @@ size_t NUMAHeap::getBlockSize(void *mh) { return h->second->getBlockSize(mh); } } // namespace mm -} // namespace stonedb +} // namespace Tianmu #endif diff --git a/storage/stonedb/mm/numa_heap_policy.h b/storage/tianmu/mm/numa_heap_policy.h similarity index 89% rename from storage/stonedb/mm/numa_heap_policy.h rename to storage/tianmu/mm/numa_heap_policy.h index 4a7aceb9fa..a1c33e8f2a 100644 --- a/storage/stonedb/mm/numa_heap_policy.h +++ b/storage/tianmu/mm/numa_heap_policy.h @@ -15,15 +15,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_NUMA_HEAP_POLICY_H_ -#define STONEDB_MM_NUMA_HEAP_POLICY_H_ +#ifndef TIANMU_MM_NUMA_HEAP_POLICY_H_ +#define TIANMU_MM_NUMA_HEAP_POLICY_H_ #pragma once #include #include "mm/heap_policy.h" #include "mm/tcm_heap_policy.h" -namespace stonedb { +namespace Tianmu { namespace mm { #ifdef USE_NUMA @@ -53,6 +53,6 @@ class NUMAHeap : public HeapPolicy { using NUMAHeap = TCMHeap; #endif } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_NUMA_HEAP_POLICY_H_ +#endif // TIANMU_MM_NUMA_HEAP_POLICY_H_ diff --git a/storage/stonedb/mm/reference_object.h b/storage/tianmu/mm/reference_object.h similarity index 89% rename from storage/stonedb/mm/reference_object.h rename to storage/tianmu/mm/reference_object.h index f4e747eef9..55fed0f0a3 100644 --- a/storage/stonedb/mm/reference_object.h +++ b/storage/tianmu/mm/reference_object.h @@ -15,14 +15,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_REFERENCE_OBJECT_H_ -#define STONEDB_MM_REFERENCE_OBJECT_H_ +#ifndef TIANMU_MM_REFERENCE_OBJECT_H_ +#define TIANMU_MM_REFERENCE_OBJECT_H_ #pragma once #include "core/tools.h" #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace mm { class ReferenceObject : public TraceableObject { @@ -40,6 +40,6 @@ class ReferenceObject : public TraceableObject { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_REFERENCE_OBJECT_H_ +#endif // TIANMU_MM_REFERENCE_OBJECT_H_ diff --git a/storage/stonedb/mm/release2q.cpp b/storage/tianmu/mm/release2q.cpp similarity index 96% rename from storage/stonedb/mm/release2q.cpp rename to storage/tianmu/mm/release2q.cpp index 6bc9bcb172..26305409a0 100644 --- a/storage/stonedb/mm/release2q.cpp +++ b/storage/tianmu/mm/release2q.cpp @@ -24,7 +24,7 @@ #include "mm/release_strategy.h" #include "mm/release_tracker.h" -namespace stonedb { +namespace Tianmu { namespace mm { void Release2Q::Access(TraceableObject *o) { @@ -61,7 +61,7 @@ void Release2Q::Release(unsigned num_objs) { } else { ReferenceObject *to = new ReferenceObject(o->GetCoordinate()); ASSERT(!to->IsTracked(), "Tracking error"); - // ASSERT(to->GetCoordinate().ID == sdb::COORD_TYPE::PACK, + // ASSERT(to->GetCoordinate().ID == tianmu::COORD_TYPE::PACK, // "ReferenceObject improperly constructed"); A1out.insert(to); A1outLookup.insert(std::make_pair(to->GetCoordinate(), to)); @@ -114,4 +114,4 @@ void Release2Q::ReleaseFull() { } } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/release2q.h b/storage/tianmu/mm/release2q.h similarity index 95% rename from storage/stonedb/mm/release2q.h rename to storage/tianmu/mm/release2q.h index 49cf59b7e4..1b78e56592 100644 --- a/storage/stonedb/mm/release2q.h +++ b/storage/tianmu/mm/release2q.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_RELEASE2Q_H_ -#define STONEDB_MM_RELEASE2Q_H_ +#ifndef TIANMU_MM_RELEASE2Q_H_ +#define TIANMU_MM_RELEASE2Q_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "mm/release_strategy.h" #include "mm/release_tracker.h" -namespace stonedb { +namespace Tianmu { namespace mm { class TraceableObject; @@ -101,6 +101,6 @@ class Release2Q : public ReleaseStrategy { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_RELEASE2Q_H_ +#endif // TIANMU_MM_RELEASE2Q_H_ diff --git a/storage/stonedb/mm/release_all.cpp b/storage/tianmu/mm/release_all.cpp similarity index 96% rename from storage/stonedb/mm/release_all.cpp rename to storage/tianmu/mm/release_all.cpp index 412251c30e..e2b0203c22 100644 --- a/storage/stonedb/mm/release_all.cpp +++ b/storage/tianmu/mm/release_all.cpp @@ -20,7 +20,7 @@ #include "core/data_cache.h" #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace mm { void ReleaseALL::Access(TraceableObject *o) { trackable.touch(o); } @@ -42,4 +42,4 @@ void ReleaseALL::Release([[maybe_unused]] unsigned sz) { void ReleaseALL::ReleaseFull() { Release(0); } } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/release_all.h b/storage/tianmu/mm/release_all.h similarity index 90% rename from storage/stonedb/mm/release_all.h rename to storage/tianmu/mm/release_all.h index 3a35f7da24..3df3efe85e 100644 --- a/storage/stonedb/mm/release_all.h +++ b/storage/tianmu/mm/release_all.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_RELEASE_ALL_H_ -#define STONEDB_MM_RELEASE_ALL_H_ +#ifndef TIANMU_MM_RELEASE_ALL_H_ +#define TIANMU_MM_RELEASE_ALL_H_ #pragma once #include "mm/release_strategy.h" #include "mm/release_tracker.h" -namespace stonedb { +namespace Tianmu { namespace mm { class TraceableObject; @@ -44,6 +44,6 @@ class ReleaseALL : public ReleaseStrategy { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_RELEASE_ALL_H_ +#endif // TIANMU_MM_RELEASE_ALL_H_ diff --git a/storage/stonedb/mm/release_fifo.cpp b/storage/tianmu/mm/release_fifo.cpp similarity index 97% rename from storage/stonedb/mm/release_fifo.cpp rename to storage/tianmu/mm/release_fifo.cpp index bee57102f8..3f713c1746 100644 --- a/storage/stonedb/mm/release_fifo.cpp +++ b/storage/tianmu/mm/release_fifo.cpp @@ -20,7 +20,7 @@ #include "core/data_cache.h" #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace mm { void ReleaseFIFO::Access(TraceableObject *o) { tracker.touch(o); } @@ -53,4 +53,4 @@ void ReleaseFIFO::ReleaseFull() { } } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/release_fifo.h b/storage/tianmu/mm/release_fifo.h similarity index 90% rename from storage/stonedb/mm/release_fifo.h rename to storage/tianmu/mm/release_fifo.h index 511459d142..43060cecb1 100644 --- a/storage/stonedb/mm/release_fifo.h +++ b/storage/tianmu/mm/release_fifo.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_RELEASE_FIFO_H_ -#define STONEDB_MM_RELEASE_FIFO_H_ +#ifndef TIANMU_MM_RELEASE_FIFO_H_ +#define TIANMU_MM_RELEASE_FIFO_H_ #pragma once #include "mm/release_strategy.h" #include "mm/release_tracker.h" -namespace stonedb { +namespace Tianmu { namespace mm { class ReleaseFIFO : public ReleaseStrategy { @@ -42,6 +42,6 @@ class ReleaseFIFO : public ReleaseStrategy { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_RELEASE_FIFO_H_ +#endif // TIANMU_MM_RELEASE_FIFO_H_ diff --git a/storage/stonedb/mm/release_lru.cpp b/storage/tianmu/mm/release_lru.cpp similarity index 97% rename from storage/stonedb/mm/release_lru.cpp rename to storage/tianmu/mm/release_lru.cpp index c2dd038bac..d4bc44ffdf 100644 --- a/storage/stonedb/mm/release_lru.cpp +++ b/storage/tianmu/mm/release_lru.cpp @@ -20,7 +20,7 @@ #include "core/data_cache.h" #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace mm { void ReleaseLRU::Access(TraceableObject *o) { tracker.touch(o); } @@ -53,4 +53,4 @@ void ReleaseLRU::ReleaseFull() { } } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/release_lru.h b/storage/tianmu/mm/release_lru.h similarity index 90% rename from storage/stonedb/mm/release_lru.h rename to storage/tianmu/mm/release_lru.h index b748853e4b..1675c031f8 100644 --- a/storage/stonedb/mm/release_lru.h +++ b/storage/tianmu/mm/release_lru.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_RELEASE_LRU_H_ -#define STONEDB_MM_RELEASE_LRU_H_ +#ifndef TIANMU_MM_RELEASE_LRU_H_ +#define TIANMU_MM_RELEASE_LRU_H_ #pragma once #include "mm/release_strategy.h" #include "mm/release_tracker.h" -namespace stonedb { +namespace Tianmu { namespace mm { class TraceableObject; @@ -44,6 +44,6 @@ class ReleaseLRU : public ReleaseStrategy { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_RELEASE_LRU_H_ +#endif // TIANMU_MM_RELEASE_LRU_H_ diff --git a/storage/stonedb/mm/release_null.h b/storage/tianmu/mm/release_null.h similarity index 90% rename from storage/stonedb/mm/release_null.h rename to storage/tianmu/mm/release_null.h index 78640063c2..96938da1da 100644 --- a/storage/stonedb/mm/release_null.h +++ b/storage/tianmu/mm/release_null.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_RELEASE_NULL_H_ -#define STONEDB_MM_RELEASE_NULL_H_ +#ifndef TIANMU_MM_RELEASE_NULL_H_ +#define TIANMU_MM_RELEASE_NULL_H_ #pragma once #include "mm/release_strategy.h" #include "mm/release_tracker.h" -namespace stonedb { +namespace Tianmu { namespace mm { class TraceableObject; @@ -42,6 +42,6 @@ class ReleaseNULL : public ReleaseStrategy { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_RELEASE_NULL_H_ +#endif // TIANMU_MM_RELEASE_NULL_H_ diff --git a/storage/stonedb/mm/release_strategy.h b/storage/tianmu/mm/release_strategy.h similarity index 90% rename from storage/stonedb/mm/release_strategy.h rename to storage/tianmu/mm/release_strategy.h index 677bcc4587..59d6cdcd14 100644 --- a/storage/stonedb/mm/release_strategy.h +++ b/storage/tianmu/mm/release_strategy.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_RELEASE_STRATEGY_H_ -#define STONEDB_MM_RELEASE_STRATEGY_H_ +#ifndef TIANMU_MM_RELEASE_STRATEGY_H_ +#define TIANMU_MM_RELEASE_STRATEGY_H_ #pragma once #include "mm/release_tracker.h" #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace mm { class ReleaseStrategy { @@ -48,6 +48,6 @@ class ReleaseStrategy { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_RELEASE_STRATEGY_H_ +#endif // TIANMU_MM_RELEASE_STRATEGY_H_ diff --git a/storage/stonedb/mm/release_tracker.cpp b/storage/tianmu/mm/release_tracker.cpp similarity index 98% rename from storage/stonedb/mm/release_tracker.cpp rename to storage/tianmu/mm/release_tracker.cpp index 173510528d..3da541369b 100644 --- a/storage/stonedb/mm/release_tracker.cpp +++ b/storage/tianmu/mm/release_tracker.cpp @@ -20,7 +20,7 @@ #include "common/assert.h" #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace mm { void FIFOTracker::insert(TraceableObject *o) { @@ -101,4 +101,4 @@ void LRUTracker::touch(TraceableObject *o) { } } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/release_tracker.h b/storage/tianmu/mm/release_tracker.h similarity index 93% rename from storage/stonedb/mm/release_tracker.h rename to storage/tianmu/mm/release_tracker.h index cdab591f66..76eff3492f 100644 --- a/storage/stonedb/mm/release_tracker.h +++ b/storage/tianmu/mm/release_tracker.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_RELEASE_TRACKER_H_ -#define STONEDB_MM_RELEASE_TRACKER_H_ +#ifndef TIANMU_MM_RELEASE_TRACKER_H_ +#define TIANMU_MM_RELEASE_TRACKER_H_ #pragma once #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace mm { class ReleaseTracker { @@ -66,6 +66,6 @@ class LRUTracker : public FIFOTracker { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_RELEASE_TRACKER_H_ +#endif // TIANMU_MM_RELEASE_TRACKER_H_ diff --git a/storage/stonedb/mm/sys_heap_policy.cpp b/storage/tianmu/mm/sys_heap_policy.cpp similarity index 97% rename from storage/stonedb/mm/sys_heap_policy.cpp rename to storage/tianmu/mm/sys_heap_policy.cpp index 4ddb0abcdc..ab7fa1b088 100644 --- a/storage/stonedb/mm/sys_heap_policy.cpp +++ b/storage/tianmu/mm/sys_heap_policy.cpp @@ -20,7 +20,7 @@ #include "common/assert.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace mm { SystemHeap::~SystemHeap() {} @@ -56,4 +56,4 @@ size_t SystemHeap::getBlockSize(void *mh) { } } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/sys_heap_policy.h b/storage/tianmu/mm/sys_heap_policy.h similarity index 89% rename from storage/stonedb/mm/sys_heap_policy.h rename to storage/tianmu/mm/sys_heap_policy.h index 67fa9cfa9f..afc87d1433 100644 --- a/storage/stonedb/mm/sys_heap_policy.h +++ b/storage/tianmu/mm/sys_heap_policy.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_SYS_HEAP_POLICY_H_ -#define STONEDB_MM_SYS_HEAP_POLICY_H_ +#ifndef TIANMU_MM_SYS_HEAP_POLICY_H_ +#define TIANMU_MM_SYS_HEAP_POLICY_H_ #pragma once #include #include "mm/heap_policy.h" -namespace stonedb { +namespace Tianmu { namespace mm { class SystemHeap : public HeapPolicy { @@ -46,6 +46,6 @@ class SystemHeap : public HeapPolicy { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_SYS_HEAP_POLICY_H_ +#endif // TIANMU_MM_SYS_HEAP_POLICY_H_ diff --git a/storage/stonedb/mm/tcm/linked_list.h b/storage/tianmu/mm/tcm/linked_list.h similarity index 93% rename from storage/stonedb/mm/tcm/linked_list.h rename to storage/tianmu/mm/tcm/linked_list.h index 2f64a61284..35f352a1ed 100755 --- a/storage/stonedb/mm/tcm/linked_list.h +++ b/storage/tianmu/mm/tcm/linked_list.h @@ -28,11 +28,11 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef STONEDB_MM_LINKED_LIST_H_ -#define STONEDB_MM_LINKED_LIST_H_ +#ifndef TIANMU_MM_LINKED_LIST_H_ +#define TIANMU_MM_LINKED_LIST_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace mm { namespace tcm { @@ -59,6 +59,6 @@ inline void SLL_PushRange(void **head, void *start, void *end) { } // namespace tcm } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_LINKED_LIST_H_ +#endif // TIANMU_MM_LINKED_LIST_H_ diff --git a/storage/stonedb/mm/tcm/page_heap.cpp b/storage/tianmu/mm/tcm/page_heap.cpp similarity index 99% rename from storage/stonedb/mm/tcm/page_heap.cpp rename to storage/tianmu/mm/tcm/page_heap.cpp index b1dee07bb1..e3063188c4 100755 --- a/storage/stonedb/mm/tcm/page_heap.cpp +++ b/storage/tianmu/mm/tcm/page_heap.cpp @@ -33,7 +33,7 @@ #include "mm/tcm/tccommon.h" -namespace stonedb { +namespace Tianmu { namespace mm { namespace tcm { @@ -375,4 +375,4 @@ bool PageHeap::Check() { } // namespace tcm } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/tcm/page_heap.h b/storage/tianmu/mm/tcm/page_heap.h similarity index 98% rename from storage/stonedb/mm/tcm/page_heap.h rename to storage/tianmu/mm/tcm/page_heap.h index 0509b7866b..10ad24489f 100755 --- a/storage/stonedb/mm/tcm/page_heap.h +++ b/storage/tianmu/mm/tcm/page_heap.h @@ -28,8 +28,8 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef STONEDB_MM_PAGE_HEAP_H_ -#define STONEDB_MM_PAGE_HEAP_H_ +#ifndef TIANMU_MM_PAGE_HEAP_H_ +#define TIANMU_MM_PAGE_HEAP_H_ #pragma once #include @@ -37,7 +37,7 @@ #include "mm/tcm/span.h" #include "mm/tcm/tccommon.h" -namespace stonedb { +namespace Tianmu { namespace mm { // change the namespace so if we ever try to link with the real tcmalloc we // don't get strangeness @@ -216,6 +216,6 @@ class PageHeap final { } // namespace tcm } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_PAGE_HEAP_H_ +#endif // TIANMU_MM_PAGE_HEAP_H_ diff --git a/storage/stonedb/mm/tcm/page_heap_allocator.h b/storage/tianmu/mm/tcm/page_heap_allocator.h similarity index 95% rename from storage/stonedb/mm/tcm/page_heap_allocator.h rename to storage/tianmu/mm/tcm/page_heap_allocator.h index 0fce7abf74..ee774a71ca 100755 --- a/storage/stonedb/mm/tcm/page_heap_allocator.h +++ b/storage/tianmu/mm/tcm/page_heap_allocator.h @@ -31,8 +31,8 @@ // --- // Author: Sanjay Ghemawat -#ifndef STONEDB_MM_PAGE_HEAP_ALLOCATOR_H_ -#define STONEDB_MM_PAGE_HEAP_ALLOCATOR_H_ +#ifndef TIANMU_MM_PAGE_HEAP_ALLOCATOR_H_ +#define TIANMU_MM_PAGE_HEAP_ALLOCATOR_H_ #pragma once #include @@ -40,7 +40,7 @@ #include "mm/tcm/tccommon.h" -namespace stonedb { +namespace Tianmu { namespace mm { namespace tcm { // Simple allocator for objects of a specified type. External locking @@ -112,6 +112,6 @@ class PageHeapAllocator { } // namespace tcm } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_PAGE_HEAP_ALLOCATOR_H_ +#endif // TIANMU_MM_PAGE_HEAP_ALLOCATOR_H_ diff --git a/storage/stonedb/mm/tcm/pagemap.h b/storage/tianmu/mm/tcm/pagemap.h similarity index 98% rename from storage/stonedb/mm/tcm/pagemap.h rename to storage/tianmu/mm/tcm/pagemap.h index 059a53852b..1736b4350a 100755 --- a/storage/stonedb/mm/tcm/pagemap.h +++ b/storage/tianmu/mm/tcm/pagemap.h @@ -45,8 +45,8 @@ // The BITS parameter should be the number of bits required to hold // a page number. E.g., with 32 bit pointers and 4K pages (i.e., // page offset fits in lower 12 bits), BITS == 20. -#ifndef STONEDB_MM_PAGEMAP_H_ -#define STONEDB_MM_PAGEMAP_H_ +#ifndef TIANMU_MM_PAGEMAP_H_ +#define TIANMU_MM_PAGEMAP_H_ #pragma once #include @@ -54,7 +54,7 @@ #include "mm/tcm/tccommon.h" -namespace stonedb { +namespace Tianmu { namespace mm { // Single-level array template @@ -236,6 +236,6 @@ class TCMalloc_PageMap3 { } }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_PAGEMAP_H_ +#endif // TIANMU_MM_PAGEMAP_H_ diff --git a/storage/stonedb/mm/tcm/span.cpp b/storage/tianmu/mm/tcm/span.cpp similarity index 98% rename from storage/stonedb/mm/tcm/span.cpp rename to storage/tianmu/mm/tcm/span.cpp index a487c2e9f1..63263324ae 100755 --- a/storage/stonedb/mm/tcm/span.cpp +++ b/storage/tianmu/mm/tcm/span.cpp @@ -31,7 +31,7 @@ #include "span.h" -namespace stonedb { +namespace Tianmu { namespace mm { namespace tcm { PageHeapAllocator _span_allocator; @@ -98,4 +98,4 @@ void DLL_Prepend(Span *list, Span *span) { } // namespace tcm } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/tcm/span.h b/storage/tianmu/mm/tcm/span.h similarity index 96% rename from storage/stonedb/mm/tcm/span.h rename to storage/tianmu/mm/tcm/span.h index 31141f810f..67fc6b4faa 100755 --- a/storage/stonedb/mm/tcm/span.h +++ b/storage/tianmu/mm/tcm/span.h @@ -28,14 +28,14 @@ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef STONEDB_MM_SPAN_H_ -#define STONEDB_MM_SPAN_H_ +#ifndef TIANMU_MM_SPAN_H_ +#define TIANMU_MM_SPAN_H_ #pragma once #include "mm/tcm/page_heap_allocator.h" #include "mm/tcm/tccommon.h" -namespace stonedb { +namespace Tianmu { namespace mm { namespace tcm { @@ -100,6 +100,6 @@ extern PageHeapAllocator _span_allocator; } // namespace tcm } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_SPAN_H_ +#endif // TIANMU_MM_SPAN_H_ diff --git a/storage/stonedb/mm/tcm/tccommon.cpp b/storage/tianmu/mm/tcm/tccommon.cpp similarity index 99% rename from storage/stonedb/mm/tcm/tccommon.cpp rename to storage/tianmu/mm/tcm/tccommon.cpp index 9d588fe4f3..2f77a010a1 100755 --- a/storage/stonedb/mm/tcm/tccommon.cpp +++ b/storage/tianmu/mm/tcm/tccommon.cpp @@ -34,7 +34,7 @@ #include "tccommon.h" -namespace stonedb { +namespace Tianmu { #define CRASH(_format, ...) #define CHECK_CONDITION(cond_) (void)0 @@ -179,4 +179,4 @@ void *TCMalloc_SystemAlloc(size_t size, size_t *actual_size, size_t alignment) { } // namespace tcm } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/tcm/tccommon.h b/storage/tianmu/mm/tcm/tccommon.h similarity index 97% rename from storage/stonedb/mm/tcm/tccommon.h rename to storage/tianmu/mm/tcm/tccommon.h index 0eb49cca55..6cda9f5993 100755 --- a/storage/stonedb/mm/tcm/tccommon.h +++ b/storage/tianmu/mm/tcm/tccommon.h @@ -33,8 +33,8 @@ // Author: Sanjay Ghemawat // // Common definitions for tcmalloc code. -#ifndef STONEDB_MM_TCCOMMON_H_ -#define STONEDB_MM_TCCOMMON_H_ +#ifndef TIANMU_MM_TCCOMMON_H_ +#define TIANMU_MM_TCCOMMON_H_ #pragma once #include @@ -43,7 +43,7 @@ #include #include -namespace stonedb { +namespace Tianmu { namespace mm { // Type that can hold a page number @@ -150,6 +150,6 @@ void *TCMalloc_SystemAlloc(size_t size, size_t *actual_size, size_t alignment); } // namespace tcm } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_TCCOMMON_H_ +#endif // TIANMU_MM_TCCOMMON_H_ diff --git a/storage/stonedb/mm/tcm_heap_policy.cpp b/storage/tianmu/mm/tcm_heap_policy.cpp similarity index 98% rename from storage/stonedb/mm/tcm_heap_policy.cpp rename to storage/tianmu/mm/tcm_heap_policy.cpp index 146d7577a3..0dcdba50b9 100644 --- a/storage/stonedb/mm/tcm_heap_policy.cpp +++ b/storage/tianmu/mm/tcm_heap_policy.cpp @@ -23,7 +23,7 @@ #include "core/tools.h" #include "tcm/span.h" -namespace stonedb { +namespace Tianmu { namespace mm { TCMHeap::TCMHeap(size_t heap_size) : HeapPolicy(heap_size) { @@ -140,4 +140,4 @@ void *TCMHeap::rc_realloc(void *mh, size_t size) { } } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/tcm_heap_policy.h b/storage/tianmu/mm/tcm_heap_policy.h similarity index 94% rename from storage/stonedb/mm/tcm_heap_policy.h rename to storage/tianmu/mm/tcm_heap_policy.h index de02c128cc..39a7f93f87 100644 --- a/storage/stonedb/mm/tcm_heap_policy.h +++ b/storage/tianmu/mm/tcm_heap_policy.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_TCM_HEAP_POLICY_H_ -#define STONEDB_MM_TCM_HEAP_POLICY_H_ +#ifndef TIANMU_MM_TCM_HEAP_POLICY_H_ +#define TIANMU_MM_TCM_HEAP_POLICY_H_ #pragma once #include @@ -29,7 +29,7 @@ #include "tcm/page_heap_allocator.h" #include "tcm/tccommon.h" -namespace stonedb { +namespace Tianmu { namespace mm { class TCMHeap : public HeapPolicy { @@ -102,6 +102,6 @@ class TCMHeap : public HeapPolicy { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_TCM_HEAP_POLICY_H_ +#endif // TIANMU_MM_TCM_HEAP_POLICY_H_ diff --git a/storage/stonedb/mm/traceable_object.cpp b/storage/tianmu/mm/traceable_object.cpp similarity index 96% rename from storage/stonedb/mm/traceable_object.cpp rename to storage/tianmu/mm/traceable_object.cpp index f08c882b40..690fdb08bb 100644 --- a/storage/stonedb/mm/traceable_object.cpp +++ b/storage/tianmu/mm/traceable_object.cpp @@ -27,7 +27,7 @@ #include "system/rc_system.h" #include "system/res_manager.h" -namespace stonedb { +namespace Tianmu { namespace mm { MemoryHandling *TraceableObject::m_MemHandling = NULL; @@ -151,7 +151,7 @@ void TraceableObject::Lock() { std::string message = "TraceableObject locked too many times. Object type: " + std::to_string((int)this->TraceableType()); rccontrol << system::lock << message << system::unlock; - STONEDB_ERROR(message.c_str()); + TIANMU_ERROR(message.c_str()); } } @@ -175,7 +175,7 @@ void TraceableObject::SetNumOfLocks(int n) { std::string message = "TraceableObject locked too many times. Object type: " + std::to_string((int)this->TraceableType()); rccontrol << system::lock << message << system::unlock; - STONEDB_ERROR(message.c_str()); + TIANMU_ERROR(message.c_str()); } } @@ -184,7 +184,7 @@ void TraceableObject::Unlock() { std::scoped_lock locking_guard(m_locking_mutex); m_lock_count--; if (m_lock_count < 0) { - STONEDB_LOG(LogCtl_Level::ERROR, "Internal error: An object unlocked too many times in memory manager."); + TIANMU_LOG(LogCtl_Level::ERROR, "Internal error: An object unlocked too many times in memory manager."); DEBUG_ASSERT(!"Internal error: An object unlocked too many times in memory manager."); m_lock_count = 0; } @@ -226,7 +226,7 @@ int TraceableObject::MemorySettingsScale() { return rceng->getResourceManager()- void TraceableObject::deinitialize(bool detect_leaks) { if (TraceableType() != TO_TYPE::TO_INITIALIZER) { - STONEDB_ERROR("TraceableType() not equals 'TO_TYPE::TO_INITIALIZER'"); + TIANMU_ERROR("TraceableType() not equals 'TO_TYPE::TO_INITIALIZER'"); return; } @@ -296,4 +296,4 @@ int64_t TraceableObject::MaxBufferSizeForAggr(int64_t size) // how much bytes m core::TOCoordinate &TraceableObject::GetCoordinate() { return m_coord; } } // namespace mm -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/mm/traceable_object.h b/storage/tianmu/mm/traceable_object.h similarity index 94% rename from storage/stonedb/mm/traceable_object.h rename to storage/tianmu/mm/traceable_object.h index b8fcaa50c2..d07449bfd4 100644 --- a/storage/stonedb/mm/traceable_object.h +++ b/storage/tianmu/mm/traceable_object.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_MM_TRACEABLE_OBJECT_H_ -#define STONEDB_MM_TRACEABLE_OBJECT_H_ +#ifndef TIANMU_MM_TRACEABLE_OBJECT_H_ +#define TIANMU_MM_TRACEABLE_OBJECT_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "core/tools.h" #include "mm/memory_handling_policy.h" -namespace stonedb { +namespace Tianmu { namespace core { class TOCoordinate; @@ -106,7 +106,7 @@ class TraceableObject { if (!m_MemHandling) { // m_MemHandling = new MemoryHandling >(COMP_SIZE, // UNCOMP_SIZE, COMPRESSED_HEAP_RELEASE, UNCOMPRESSED_HEAP_RELEASE); - STONEDB_ERROR("Memory manager is not instantiated"); + TIANMU_ERROR("Memory manager is not instantiated"); return NULL; } else return m_MemHandling; @@ -115,7 +115,7 @@ class TraceableObject { void TrackAccess() { Instance()->TrackAccess(this); } void StopAccessTracking() { Instance()->StopAccessTracking(this); } bool IsTracked() { return tracker != NULL; } - virtual void Release() { STONEDB_ERROR("Release functionality not implemented for this object"); } + virtual void Release() { TIANMU_ERROR("Release functionality not implemented for this object"); } core::TOCoordinate &GetCoordinate(); size_t SizeAllocated() const { return m_sizeAllocated; } @@ -162,6 +162,6 @@ class TraceableObject { }; } // namespace mm -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_MM_TRACEABLE_OBJECT_H_ +#endif // TIANMU_MM_TRACEABLE_OBJECT_H_ diff --git a/storage/stonedb/system/cacheable_item.cpp b/storage/tianmu/system/cacheable_item.cpp similarity index 96% rename from storage/stonedb/system/cacheable_item.cpp rename to storage/tianmu/system/cacheable_item.cpp index e744a42bac..dad7909570 100644 --- a/storage/stonedb/system/cacheable_item.cpp +++ b/storage/tianmu/system/cacheable_item.cpp @@ -21,7 +21,7 @@ #include "system/fet.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace system { CacheableItem::CacheableItem(char const *owner_name, char const *object_id, int _default_block_size) { default_block_size = _default_block_size; @@ -32,9 +32,9 @@ CacheableItem::CacheableItem(char const *owner_name, char const *object_id, int { // read the configuration parameter - std::string temp_filename = stonedb_sysvar_cachefolder; + std::string temp_filename = tianmu_sysvar_cachefolder; filename_n_position = temp_filename.length(); - filename = new char[filename_n_position + 37]; // "...path.../XXXXXXnnnnnnAAAAAAAABBBBBBBB.sdb_tmp" + filename = new char[filename_n_position + 37]; // "...path.../XXXXXXnnnnnnAAAAAAAABBBBBBBB.tianmu_tmp" std::strcpy(filename, temp_filename.c_str()); if (filename[filename_n_position - 1] != '/' && filename[filename_n_position - 1] != '\\') { filename[filename_n_position] = '/'; @@ -45,7 +45,7 @@ CacheableItem::CacheableItem(char const *owner_name, char const *object_id, int if (filename == NULL) { // if the temporary path is not set, use the current folder - filename = new char[36]; // "XXXXXXnnnnnnAAAAAAAABBBBBBBB.sdb_tmp" + filename = new char[36]; // "XXXXXXnnnnnnAAAAAAAABBBBBBBB.tianmu_tmp" filename_n_position = 6; } max_file_id = 0; @@ -71,7 +71,7 @@ CacheableItem::CacheableItem(char const *owner_name, char const *object_id, int std::sprintf(buf, "%p", this); std::strcpy(filename + filename_n_position + 14 + (8 - std::strlen(buf)), buf); if (std::strlen(buf) < 8) std::memset(filename + filename_n_position + 14, '0', 8 - std::strlen(buf)); - std::strcpy(filename + filename_n_position + 22, ".sdb_tmp"); + std::strcpy(filename + filename_n_position + 22, ".tianmu_tmp"); } CacheableItem::~CacheableItem() { @@ -195,4 +195,4 @@ void CacheableItem::SetFilename(int i) // char -> void temporary change to enab } } // namespace system -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/system/cacheable_item.h b/storage/tianmu/system/cacheable_item.h similarity index 91% rename from storage/stonedb/system/cacheable_item.h rename to storage/tianmu/system/cacheable_item.h index 74fc0bb1a7..031c8a52a7 100644 --- a/storage/stonedb/system/cacheable_item.h +++ b/storage/tianmu/system/cacheable_item.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_CACHEABLE_ITEM_H_ -#define STONEDB_SYSTEM_CACHEABLE_ITEM_H_ +#ifndef TIANMU_SYSTEM_CACHEABLE_ITEM_H_ +#define TIANMU_SYSTEM_CACHEABLE_ITEM_H_ #pragma once #include -#include "system/stonedb_file.h" +#include "system/tianmu_file.h" -namespace stonedb { +namespace Tianmu { namespace system { ////////////////////////////////////////////////////////////////////////////////////////// /////////////////// CacheableItem: @@ -60,7 +60,7 @@ class CacheableItem { void SetFilename(int i); // set the current filename to the i-th file char *filename; // the current filename with the full path // the filename template is as follows: - // "..path../XXXXXXnnnnnnAAAAAAAABBBBBBBB.sdb_tmp" where X..X is an id. of + // "..path../XXXXXXnnnnnnAAAAAAAABBBBBBBB.tianmu_tmp" where X..X is an id. of // object manager and object type (filled with "_") n..n is the number of file // (0..999999), A..A is the random session number (hex), B..B is the // semi-random object number (its memory address while creating, hex) @@ -75,12 +75,12 @@ class CacheableItem { std::vector file_size; // a size of the i-th data block int default_block_size; - StoneDBFile cur_file_handle; + TianmuFile cur_file_handle; int cur_file_number; // the number of currently opened file void *cur_map_addr; static const size_t cur_map_size; }; } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_CACHEABLE_ITEM_H_ +#endif // TIANMU_SYSTEM_CACHEABLE_ITEM_H_ diff --git a/storage/stonedb/system/channel.cpp b/storage/tianmu/system/channel.cpp similarity index 99% rename from storage/stonedb/system/channel.cpp rename to storage/tianmu/system/channel.cpp index 6b012c18aa..8f2a3129c2 100644 --- a/storage/stonedb/system/channel.cpp +++ b/storage/tianmu/system/channel.cpp @@ -23,7 +23,7 @@ #include "core/tools.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace system { Channel::Channel(bool time_stamp_at_lock) : time_stamp_at_lock_(time_stamp_at_lock) {} @@ -186,4 +186,4 @@ Channel &Channel::flush() { } } // namespace system -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/system/channel.h b/storage/tianmu/system/channel.h similarity index 94% rename from storage/stonedb/system/channel.h rename to storage/tianmu/system/channel.h index f79ab90877..03ef314665 100644 --- a/storage/stonedb/system/channel.h +++ b/storage/tianmu/system/channel.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_CHANNEL_H_ -#define STONEDB_SYSTEM_CHANNEL_H_ +#ifndef TIANMU_SYSTEM_CHANNEL_H_ +#define TIANMU_SYSTEM_CHANNEL_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "channel_out.h" -namespace stonedb { +namespace Tianmu { namespace system { class Channel { @@ -85,6 +85,6 @@ inline Channel &unlock(Channel &report) { inline Channel &flush(Channel &report) { return report.flush(); } } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_CHANNEL_H_ +#endif // TIANMU_SYSTEM_CHANNEL_H_ diff --git a/storage/stonedb/system/channel_out.h b/storage/tianmu/system/channel_out.h similarity index 93% rename from storage/stonedb/system/channel_out.h rename to storage/tianmu/system/channel_out.h index 3b9a22a5dd..27a06bbaf7 100644 --- a/storage/stonedb/system/channel_out.h +++ b/storage/tianmu/system/channel_out.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_CHANNEL_OUT_H_ -#define STONEDB_SYSTEM_CHANNEL_OUT_H_ +#ifndef TIANMU_SYSTEM_CHANNEL_OUT_H_ +#define TIANMU_SYSTEM_CHANNEL_OUT_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "common/common_definitions.h" #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace system { class ChannelOut { @@ -77,6 +77,6 @@ inline ChannelOut &endl(ChannelOut &inout) { inline ChannelOut &fixed(ChannelOut &inout) { return inout.fixed(); } } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_CHANNEL_OUT_H_ +#endif // TIANMU_SYSTEM_CHANNEL_OUT_H_ diff --git a/storage/tianmu/system/configuration.cpp b/storage/tianmu/system/configuration.cpp new file mode 100644 index 0000000000..6b25d4b1c3 --- /dev/null +++ b/storage/tianmu/system/configuration.cpp @@ -0,0 +1,83 @@ +/* Copyright (c) 2022 StoneAtom, Inc. All rights reserved. + Use is subject to license terms + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA +*/ + +#include "system/rc_system.h" + +// Variables to show config through mysql 'show variables' command +char tianmu_sysvar_pushdown; +char tianmu_sysvar_refresh_sys_table; +char tianmu_sysvar_usemysqlimportexportdefaults; +char *tianmu_sysvar_cachefolder; +char *tianmu_sysvar_hugefiledir; +char *tianmu_sysvar_mm_policy; +char *tianmu_sysvar_mm_releasepolicy; +int tianmu_sysvar_allowmysqlquerypath; +int tianmu_sysvar_bg_load_threads; +int tianmu_sysvar_cachereleasethreshold; +int tianmu_sysvar_cachesizethreshold; +int tianmu_sysvar_cachinglevel; +int tianmu_sysvar_controlquerylog; +int tianmu_sysvar_controltrace; +int tianmu_sysvar_disk_usage_threshold; +int tianmu_sysvar_distcache_size; +int tianmu_sysvar_global_debug_level; +int tianmu_sysvar_insert_buffer_size; +int tianmu_sysvar_insert_cntthreshold; +int tianmu_sysvar_insert_max_buffered; +int tianmu_sysvar_insert_numthreshold; +int tianmu_sysvar_insert_wait_ms; +int tianmu_sysvar_insert_wait_time; +int tianmu_sysvar_knlevel; +int tianmu_sysvar_load_threads; +int tianmu_sysvar_max_execution_time; +int tianmu_sysvar_mm_hardlimit; +int tianmu_sysvar_mm_large_threshold; +int tianmu_sysvar_mm_largetempratio; +int tianmu_sysvar_query_threads; +int tianmu_sysvar_servermainheapsize; +int tianmu_sysvar_sync_buffers; +int tianmu_sysvar_threadpoolsize; +int tianmu_sysvar_join_parallel; +int tianmu_sysvar_join_splitrows; +my_bool tianmu_sysvar_compensation_start; +my_bool tianmu_sysvar_filterevaluation_speedup; +my_bool tianmu_sysvar_groupby_speedup; +unsigned int tianmu_sysvar_index_cache_size; +my_bool tianmu_sysvar_index_search; +my_bool tianmu_sysvar_enable_rowstore; +my_bool tianmu_sysvar_insert_delayed; +my_bool tianmu_sysvar_minmax_speedup; +my_bool tianmu_sysvar_orderby_speedup; +my_bool tianmu_sysvar_parallel_filloutput; +my_bool tianmu_sysvar_parallel_mapjoin; +my_bool tianmu_sysvar_qps_log; +unsigned int tianmu_sysvar_lookup_max_size; +unsigned long tianmu_sysvar_dist_policy; +char tianmu_sysvar_force_hashjoin; +int tianmu_sysvar_start_async; +char *tianmu_sysvar_async_join; +char tianmu_sysvar_join_disable_switch_side; +char tianmu_sysvar_enable_histogram_cmap_bloom; +unsigned int tianmu_sysvar_result_sender_rows; + +async_join_setting tianmu_sysvar_async_join_setting; + +void ConfigureRCControl() { + using namespace Tianmu; + int control_level = tianmu_sysvar_controltrace; + (control_level > 0) ? rccontrol.setOn() : rccontrol.setOff(); +} diff --git a/storage/tianmu/system/configuration.h b/storage/tianmu/system/configuration.h new file mode 100644 index 0000000000..c2e77de571 --- /dev/null +++ b/storage/tianmu/system/configuration.h @@ -0,0 +1,102 @@ +/* Copyright (c) 2022 StoneAtom, Inc. All rights reserved. + Use is subject to license terms + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA +*/ +#ifndef TIANMU_SYSTEM_CONFIGURATION_H_ +#define TIANMU_SYSTEM_CONFIGURATION_H_ +#pragma once + +extern char tianmu_sysvar_compensation_start; +extern char tianmu_sysvar_filterevaluation_speedup; +extern char tianmu_sysvar_groupby_speedup; +extern unsigned int tianmu_sysvar_index_cache_size; +extern char tianmu_sysvar_index_search; +extern char tianmu_sysvar_enable_rowstore; +extern char tianmu_sysvar_insert_delayed; +extern char tianmu_sysvar_minmax_speedup; +extern char tianmu_sysvar_orderby_speedup; +extern char tianmu_sysvar_parallel_filloutput; +extern char tianmu_sysvar_parallel_mapjoin; +extern char tianmu_sysvar_pushdown; +extern char tianmu_sysvar_qps_log; +extern char tianmu_sysvar_refresh_sys_table; +extern char tianmu_sysvar_usemysqlimportexportdefaults; +extern char *tianmu_sysvar_cachefolder; +extern char *tianmu_sysvar_hugefiledir; +extern char *tianmu_sysvar_mm_policy; +extern char *tianmu_sysvar_mm_releasepolicy; +extern int tianmu_sysvar_allowmysqlquerypath; +extern int tianmu_sysvar_bg_load_threads; +extern int tianmu_sysvar_cachereleasethreshold; +extern int tianmu_sysvar_cachesizethreshold; +extern int tianmu_sysvar_cachinglevel; +extern int tianmu_sysvar_controlquerylog; +extern int tianmu_sysvar_controltrace; +extern int tianmu_sysvar_disk_usage_threshold; +extern int tianmu_sysvar_distcache_size; +extern int tianmu_sysvar_global_debug_level; +extern int tianmu_sysvar_insert_buffer_size; +extern int tianmu_sysvar_insert_cntthreshold; +extern int tianmu_sysvar_insert_max_buffered; +extern int tianmu_sysvar_insert_numthreshold; +extern int tianmu_sysvar_insert_wait_ms; +extern int tianmu_sysvar_insert_wait_time; +extern int tianmu_sysvar_join_parallel; +extern int tianmu_sysvar_join_splitrows; +extern int tianmu_sysvar_knlevel; +extern int tianmu_sysvar_load_threads; +extern unsigned int tianmu_sysvar_lookup_max_size; +extern int tianmu_sysvar_max_execution_time; +extern int tianmu_sysvar_mm_hardlimit; +extern int tianmu_sysvar_mm_large_threshold; +extern int tianmu_sysvar_mm_largetempratio; +extern int tianmu_sysvar_query_threads; +extern int tianmu_sysvar_servermainheapsize; +extern int tianmu_sysvar_sync_buffers; +extern int tianmu_sysvar_threadpoolsize; +extern unsigned long tianmu_sysvar_dist_policy; +extern char tianmu_sysvar_force_hashjoin; +extern int tianmu_sysvar_start_async; +// Format: a;b;c;d +// a : iterator pack count one step,default 1, 0 is disable +// b : iterator rows count one step,default 0, 0 is disable,if a and b all is +// setted, use a priority c : traverse slices count, default 0 is the async +// thread count d : match slices count, default 0 is the async thread count +extern char *tianmu_sysvar_async_join; +// If there is too much conflict in the hash join building hash table, program +// will automatically switching another table to make a hash table, +// tianmu_sysvar_join_disable_switch_side is the option to avoid this switching +// process. +extern char tianmu_sysvar_join_disable_switch_side; +// enable histogram/cmap/bloom filtering +extern char tianmu_sysvar_enable_histogram_cmap_bloom; +// The number of rows to load at a time when processing queries like select xxx +// from yyy +extern unsigned int tianmu_sysvar_result_sender_rows; + +void ConfigureRCControl(); + +struct async_join_setting { + int pack_per_step = 1; + int rows_per_step = 0; + int traverse_slices = 0; + int match_slices = 0; + + bool is_enabled() const { return (pack_per_step > 0) || (rows_per_step > 0); } +}; + +extern async_join_setting tianmu_sysvar_async_join_setting; + +#endif // TIANMU_SYSTEM_CONFIGURATION_H_ diff --git a/storage/stonedb/system/fet.cpp b/storage/tianmu/system/fet.cpp similarity index 96% rename from storage/stonedb/system/fet.cpp rename to storage/tianmu/system/fet.cpp index a753576df5..2c02ea93db 100644 --- a/storage/stonedb/system/fet.cpp +++ b/storage/tianmu/system/fet.cpp @@ -19,7 +19,7 @@ #include -namespace stonedb { +namespace Tianmu { namespace system { #ifdef FUNCTIONS_EXECUTION_TIMES @@ -37,4 +37,4 @@ void NotifyDataPackDecompression(const core::PackCoordinate &coord) { #endif } // namespace system -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/system/fet.h b/storage/tianmu/system/fet.h similarity index 87% rename from storage/stonedb/system/fet.h rename to storage/tianmu/system/fet.h index 15ce822a84..2147dbcc9b 100644 --- a/storage/stonedb/system/fet.h +++ b/storage/tianmu/system/fet.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_FET_H_ -#define STONEDB_SYSTEM_FET_H_ +#ifndef TIANMU_SYSTEM_FET_H_ +#define TIANMU_SYSTEM_FET_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "core/tools.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace system { #ifdef FUNCTIONS_EXECUTION_TIMES @@ -106,7 +106,7 @@ class FunctionsExecutionTimes { private: void Clear() { times_->clear(); } void Print() { - STONEDB_LOG(LogCtl_Level::INFO, + TIANMU_LOG(LogCtl_Level::INFO, "***** Function Execution Times " "************************************************************"); std::priority_queue, SortEntryLess> sq; @@ -115,16 +115,16 @@ class FunctionsExecutionTimes { while (!sq.empty()) { std::sprintf(str, "%-60s \t%6llu \t%8.2fs", sq.top().n.c_str(), sq.top().e.call, sq.top().e.time / 1000000.0); - STONEDB_LOG(LogCtl_Level::INFO, "%s", str); + TIANMU_LOG(LogCtl_Level::INFO, "%s", str); sq.pop(); } - STONEDB_LOG(LogCtl_Level::INFO, "Number of distinct Data Packs loads: %u", (uint)count_distinct_dp_loads.size()); - STONEDB_LOG(LogCtl_Level::INFO, "Number of distinct Data Packs decompressions: %u", + TIANMU_LOG(LogCtl_Level::INFO, "Number of distinct Data Packs loads: %u", (uint)count_distinct_dp_loads.size()); + TIANMU_LOG(LogCtl_Level::INFO, "Number of distinct Data Packs decompressions: %u", (uint)count_distinct_dp_decompressions.size()); - STONEDB_LOG(LogCtl_Level::INFO, "Size of DP read from disk: %fMB", ((double)NoBytesReadByDPs / 1_MB)); - STONEDB_LOG(LogCtl_Level::INFO, "Size of uncompressed DPs: %fMB", ((double)SizeOfUncompressedDP / 1_MB)); - STONEDB_LOG(LogCtl_Level::INFO, + TIANMU_LOG(LogCtl_Level::INFO, "Size of DP read from disk: %fMB", ((double)NoBytesReadByDPs / 1_MB)); + TIANMU_LOG(LogCtl_Level::INFO, "Size of uncompressed DPs: %fMB", ((double)SizeOfUncompressedDP / 1_MB)); + TIANMU_LOG(LogCtl_Level::INFO, "**************************************************************" "***********" "******************"); @@ -177,6 +177,6 @@ inline void FunctionsExecutionTimes::InstallFlushSignal() { #endif } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_FET_H_ +#endif // TIANMU_SYSTEM_FET_H_ diff --git a/storage/stonedb/system/file.cpp b/storage/tianmu/system/file.cpp similarity index 67% rename from storage/stonedb/system/file.cpp rename to storage/tianmu/system/file.cpp index 26ffa7b167..72de2bb54e 100644 --- a/storage/stonedb/system/file.cpp +++ b/storage/tianmu/system/file.cpp @@ -15,14 +15,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#include "stonedb_file.h" +#include "tianmu_file.h" #include "common/assert.h" -namespace stonedb { +namespace Tianmu { namespace system { -int StoneDBFile::Open(std::string const &file, int flags, mode_t mode) { +int TianmuFile::Open(std::string const &file, int flags, mode_t mode) { DEBUG_ASSERT(file.length()); name_ = file; @@ -31,14 +31,14 @@ int StoneDBFile::Open(std::string const &file, int flags, mode_t mode) { return fd_; } -size_t StoneDBFile::Read(void *buf, size_t count) { +size_t TianmuFile::Read(void *buf, size_t count) { DEBUG_ASSERT(fd_ != -1); auto read_bytes = read(fd_, buf, count); if (read_bytes == -1) ThrowError(errno); return read_bytes; } -int StoneDBFile::Flush() { +int TianmuFile::Flush() { int ret; #ifdef HAVE_FDATASYNC ret = fdatasync(fd_); @@ -48,27 +48,27 @@ int StoneDBFile::Flush() { return ret; } -int StoneDBFile::OpenCreate(std::string const &file) { - return Open(file, O_CREAT | O_RDWR | O_LARGEFILE | O_BINARY, sdb_umask); +int TianmuFile::OpenCreate(std::string const &file) { + return Open(file, O_CREAT | O_RDWR | O_LARGEFILE | O_BINARY, tianmu_umask); } -int StoneDBFile::OpenCreateNotExists(std::string const &file) { - return Open(file, O_CREAT | O_EXCL | O_RDWR | O_LARGEFILE | O_BINARY, sdb_umask); +int TianmuFile::OpenCreateNotExists(std::string const &file) { + return Open(file, O_CREAT | O_EXCL | O_RDWR | O_LARGEFILE | O_BINARY, tianmu_umask); } -int StoneDBFile::OpenCreateEmpty(std::string const &file) { - return Open(file, O_CREAT | O_RDWR | O_TRUNC | O_LARGEFILE | O_BINARY, sdb_umask); +int TianmuFile::OpenCreateEmpty(std::string const &file) { + return Open(file, O_CREAT | O_RDWR | O_TRUNC | O_LARGEFILE | O_BINARY, tianmu_umask); } -int StoneDBFile::OpenReadOnly(std::string const &file) { - return Open(file, O_RDONLY | O_LARGEFILE | O_BINARY, sdb_umask); +int TianmuFile::OpenReadOnly(std::string const &file) { + return Open(file, O_RDONLY | O_LARGEFILE | O_BINARY, tianmu_umask); } -int StoneDBFile::OpenReadWrite(std::string const &file) { - return Open(file, O_RDWR | O_LARGEFILE | O_BINARY, sdb_umask); +int TianmuFile::OpenReadWrite(std::string const &file) { + return Open(file, O_RDWR | O_LARGEFILE | O_BINARY, tianmu_umask); } -void StoneDBFile::ReadExact(void *buf, size_t count) { +void TianmuFile::ReadExact(void *buf, size_t count) { size_t read_bytes = 0; while (read_bytes < count) { auto rb = Read((char *)buf + read_bytes, count - read_bytes); @@ -81,7 +81,7 @@ void StoneDBFile::ReadExact(void *buf, size_t count) { } } -void StoneDBFile::WriteExact(const void *buf, size_t count) { +void TianmuFile::WriteExact(const void *buf, size_t count) { DEBUG_ASSERT(fd_ != -1); size_t total_writen_bytes = 0; while (total_writen_bytes < count) { @@ -91,7 +91,7 @@ void StoneDBFile::WriteExact(const void *buf, size_t count) { } } -off_t StoneDBFile::Seek(off_t pos, int whence) { +off_t TianmuFile::Seek(off_t pos, int whence) { off_t new_pos = -1; DEBUG_ASSERT(fd_ != -1); @@ -101,7 +101,7 @@ off_t StoneDBFile::Seek(off_t pos, int whence) { return new_pos; } -off_t StoneDBFile::Tell() { +off_t TianmuFile::Tell() { off_t pos; DEBUG_ASSERT(fd_ != -1); pos = lseek(fd_, 0, SEEK_CUR); @@ -109,17 +109,17 @@ off_t StoneDBFile::Tell() { return pos; } -bool StoneDBFile::IsOpen() const { return (fd_ != -1 ? true : false); } +bool TianmuFile::IsOpen() const { return (fd_ != -1 ? true : false); } -int StoneDBFile::Close() { - int sdb_err = 0; +int TianmuFile::Close() { + int tianmu_err = 0; if (fd_ != -1) { - sdb_err = close(fd_); + tianmu_err = close(fd_); name_ = ""; fd_ = -1; } - return sdb_err; + return tianmu_err; } } // namespace system -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/system/file_out.h b/storage/tianmu/system/file_out.h similarity index 95% rename from storage/stonedb/system/file_out.h rename to storage/tianmu/system/file_out.h index 6a521a65db..1033d15512 100644 --- a/storage/stonedb/system/file_out.h +++ b/storage/tianmu/system/file_out.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_FILE_OUT_H_ -#define STONEDB_SYSTEM_FILE_OUT_H_ +#ifndef TIANMU_SYSTEM_FILE_OUT_H_ +#define TIANMU_SYSTEM_FILE_OUT_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "common/exception.h" #include "system/channel_out.h" -namespace stonedb { +namespace Tianmu { namespace system { class FileOut : public ChannelOut { @@ -134,6 +134,6 @@ class FileOut : public ChannelOut { }; } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_FILE_OUT_H_ +#endif // TIANMU_SYSTEM_FILE_OUT_H_ diff --git a/storage/stonedb/system/file_system.cpp b/storage/tianmu/system/file_system.cpp similarity index 85% rename from storage/stonedb/system/file_system.cpp rename to storage/tianmu/system/file_system.cpp index 83dc2c01d3..8d133a6dc8 100644 --- a/storage/stonedb/system/file_system.cpp +++ b/storage/tianmu/system/file_system.cpp @@ -28,11 +28,11 @@ #include #include "common/assert.h" -#include "system/stonedb_file.h" +#include "system/tianmu_file.h" #include "util/fs.h" #include "util/log_ctl.h" -namespace stonedb { +namespace Tianmu { namespace system { int ClearDirectory(std::string const &path) { @@ -41,11 +41,11 @@ int ClearDirectory(std::string const &path) { fs::remove_all(p); } } catch (fs::filesystem_error &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to ClearDirectory(%s). filesystem_error: %s %s %s", path.c_str(), e.what(), + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to ClearDirectory(%s). filesystem_error: %s %s %s", path.c_str(), e.what(), e.path1().native().c_str(), e.path2().native().c_str()); return 1; } catch (std::exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to ClearDirectory(%s). error: %s", path.c_str(), e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to ClearDirectory(%s). error: %s", path.c_str(), e.what()); return 1; } return 0; @@ -65,13 +65,13 @@ void DeleteDirectory(std::string const &path) { // been removed fs::remove_all(t, ec); if (ec && ec != std::errc::no_such_file_or_directory) - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to delete %s", t.c_str()); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to delete %s", t.c_str()); } } catch (fs::filesystem_error &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to delete directory(%s). filesystem_error: %s %s %s", path.c_str(), + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to delete directory(%s). filesystem_error: %s %s %s", path.c_str(), e.what(), e.path1().native().c_str(), e.path2().native().c_str()); } catch (std::exception &e) { - STONEDB_LOG(LogCtl_Level::ERROR, "Failed to delete directory(%s). error: %s", path.c_str(), e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "Failed to delete directory(%s). error: %s", path.c_str(), e.what()); } } @@ -131,7 +131,7 @@ void FlushDirectoryChanges(std::string const &path) { } void FlushFileChanges(std::string const &path) { - StoneDBFile fb; + TianmuFile fb; fb.OpenReadOnly(path); fb.Flush(); fb.Close(); @@ -143,4 +143,4 @@ bool IsReadWriteAllowed(std::string const &path) { } } // namespace system -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/system/file_system.h b/storage/tianmu/system/file_system.h similarity index 94% rename from storage/stonedb/system/file_system.h rename to storage/tianmu/system/file_system.h index ff43097017..a17be148d0 100644 --- a/storage/stonedb/system/file_system.h +++ b/storage/tianmu/system/file_system.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_FILE_SYSTEM_H_ -#define STONEDB_SYSTEM_FILE_SYSTEM_H_ +#ifndef TIANMU_SYSTEM_FILE_SYSTEM_H_ +#define TIANMU_SYSTEM_FILE_SYSTEM_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace system { /** \brief Deletes a directory defined by path @@ -81,6 +81,6 @@ bool IsReadWriteAllowed(std::string const &path); int ClearDirectory(std::string const &path); } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_FILE_SYSTEM_H_ +#endif // TIANMU_SYSTEM_FILE_SYSTEM_H_ diff --git a/storage/stonedb/system/io_parameters.h b/storage/tianmu/system/io_parameters.h similarity index 97% rename from storage/stonedb/system/io_parameters.h rename to storage/tianmu/system/io_parameters.h index ab6ea19ac0..8cabe48af5 100644 --- a/storage/stonedb/system/io_parameters.h +++ b/storage/tianmu/system/io_parameters.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_IO_PARAMETERS_H_ -#define STONEDB_SYSTEM_IO_PARAMETERS_H_ +#ifndef TIANMU_SYSTEM_IO_PARAMETERS_H_ +#define TIANMU_SYSTEM_IO_PARAMETERS_H_ #pragma once #include @@ -26,7 +26,7 @@ #include "core/rc_attr_typeinfo.h" #include "system/file_system.h" -namespace stonedb { +namespace Tianmu { namespace system { enum class Parameter { @@ -219,6 +219,6 @@ class IOParameters { }; } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_IO_PARAMETERS_H_ +#endif // TIANMU_SYSTEM_IO_PARAMETERS_H_ diff --git a/storage/stonedb/system/large_buffer.cpp b/storage/tianmu/system/large_buffer.cpp similarity index 84% rename from storage/stonedb/system/large_buffer.cpp rename to storage/tianmu/system/large_buffer.cpp index 7704be2059..c6382f18f8 100644 --- a/storage/stonedb/system/large_buffer.cpp +++ b/storage/tianmu/system/large_buffer.cpp @@ -23,9 +23,9 @@ #include "core/tools.h" #include "system/io_parameters.h" #include "system/rc_system.h" -#include "system/stonedb_file.h" +#include "system/tianmu_file.h" -namespace stonedb { +namespace Tianmu { namespace system { static int const D_OVERRUN_GUARDIAN = -66; @@ -48,14 +48,14 @@ LargeBuffer::LargeBuffer(int num, int requested_size) : size_(requested_size), b LargeBuffer::~LargeBuffer() { if (flush_thread_.joinable()) flush_thread_.join(); - if (sdb_stream_) sdb_stream_->Close(); + if (tianmu_stream_) tianmu_stream_->Close(); } bool LargeBuffer::BufOpen(const IOParameters &iop) { try { - sdb_stream_ = std::unique_ptr(new StoneDBFile()); - sdb_stream_->OpenCreateEmpty(iop.Path()); - if (!sdb_stream_ || !sdb_stream_->IsOpen()) { + tianmu_stream_ = std::unique_ptr(new TianmuFile()); + tianmu_stream_->OpenCreateEmpty(iop.Path()); + if (!tianmu_stream_ || !tianmu_stream_->IsOpen()) { BufClose(); return false; } @@ -69,15 +69,15 @@ bool LargeBuffer::BufOpen(const IOParameters &iop) { } void LargeBuffer::BufFlush() { - if (buf_used_ > size_) STONEDB_LOG(LogCtl_Level::ERROR, "LargeBuffer error: Buffer overrun (Flush)"); + if (buf_used_ > size_) TIANMU_LOG(LogCtl_Level::ERROR, "LargeBuffer error: Buffer overrun (Flush)"); if (flush_thread_.joinable()) { flush_thread_.join(); } if (failed_) { - STONEDB_LOG(LogCtl_Level::ERROR, "Write operation to file or pipe failed_."); + TIANMU_LOG(LogCtl_Level::ERROR, "Write operation to file or pipe failed_."); throw common::FileException("Write operation to file or pipe failed_."); } - flush_thread_ = std::thread(std::bind(&LargeBuffer::BufFlushThread, this, sdb_stream_.get(), buf_, buf_used_, &failed_)); + flush_thread_ = std::thread(std::bind(&LargeBuffer::BufFlushThread, this, tianmu_stream_.get(), buf_, buf_used_, &failed_)); UseNextBuf(); } @@ -104,11 +104,11 @@ void LargeBuffer::BufClose() // close the buffer; warning: does not flush data { if (flush_thread_.joinable()) flush_thread_.join(); - if (sdb_stream_) sdb_stream_->Close(); + if (tianmu_stream_) tianmu_stream_->Close(); buf_used_ = 0; if (buf_[size_ + 1] != D_OVERRUN_GUARDIAN) { - STONEDB_LOG(LogCtl_Level::WARN, "buffer overrun detected in LargeBuffer::BufClose."); + TIANMU_LOG(LogCtl_Level::WARN, "buffer overrun detected in LargeBuffer::BufClose."); DEBUG_ASSERT(0); } } @@ -120,7 +120,7 @@ void LargeBuffer::FlushAndClose() { char *LargeBuffer::BufAppend(unsigned int len) { if ((int)len > size_) { - STONEDB_LOG(LogCtl_Level::ERROR, "Error: LargeBuffer buffer overrun (BufAppend)"); + TIANMU_LOG(LogCtl_Level::ERROR, "Error: LargeBuffer buffer overrun (BufAppend)"); return NULL; } int buf_pos = buf_used_; @@ -164,4 +164,4 @@ int LargeBuffer::FindUnusedBuf() { return -1; } } // namespace system -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/system/large_buffer.h b/storage/tianmu/system/large_buffer.h similarity index 92% rename from storage/stonedb/system/large_buffer.h rename to storage/tianmu/system/large_buffer.h index 0ebd743dc3..eec843eaab 100644 --- a/storage/stonedb/system/large_buffer.h +++ b/storage/tianmu/system/large_buffer.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_LARGE_BUFFER_H_ -#define STONEDB_SYSTEM_LARGE_BUFFER_H_ +#ifndef TIANMU_SYSTEM_LARGE_BUFFER_H_ +#define TIANMU_SYSTEM_LARGE_BUFFER_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "common/common_definitions.h" #include "mm/traceable_object.h" -namespace stonedb { +namespace Tianmu { namespace system { class IOParameters; @@ -80,7 +80,7 @@ class LargeBuffer final : public mm::TraceableObject { char *buf2next_; // buf to be used next int curr_buf2next_num_; - std::unique_ptr sdb_stream_; + std::unique_ptr tianmu_stream_; std::mutex mutex_; std::condition_variable cond_var_; @@ -88,5 +88,5 @@ class LargeBuffer final : public mm::TraceableObject { bool failed_; }; } // namespace system -} // namespace stonedb -#endif // STONEDB_SYSTEM_LARGE_BUFFER_H_ +} // namespace Tianmu +#endif // TIANMU_SYSTEM_LARGE_BUFFER_H_ diff --git a/storage/stonedb/system/mag_memory_policy.h b/storage/tianmu/system/mag_memory_policy.h similarity index 89% rename from storage/stonedb/system/mag_memory_policy.h rename to storage/tianmu/system/mag_memory_policy.h index ec32bbcd36..ced28b3814 100644 --- a/storage/stonedb/system/mag_memory_policy.h +++ b/storage/tianmu/system/mag_memory_policy.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_MAG_MEMORY_POLICY_H_ -#define STONEDB_SYSTEM_MAG_MEMORY_POLICY_H_ +#ifndef TIANMU_SYSTEM_MAG_MEMORY_POLICY_H_ +#define TIANMU_SYSTEM_MAG_MEMORY_POLICY_H_ #pragma once #include "system/res_manager_policy.h" -namespace stonedb { +namespace Tianmu { namespace system { // Estimate memory policy from magnitude of configured main heap size @@ -49,6 +49,6 @@ class MagMemoryPolicy : public ResourceManagerPolicy { }; } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_MAG_MEMORY_POLICY_H_ +#endif // TIANMU_SYSTEM_MAG_MEMORY_POLICY_H_ diff --git a/storage/stonedb/system/net_stream.cpp b/storage/tianmu/system/net_stream.cpp similarity index 94% rename from storage/stonedb/system/net_stream.cpp rename to storage/tianmu/system/net_stream.cpp index 82dc1bbcc6..e6c3435daa 100644 --- a/storage/stonedb/system/net_stream.cpp +++ b/storage/tianmu/system/net_stream.cpp @@ -23,7 +23,7 @@ #include "core/transaction.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace system { NetStream::NetStream(const IOParameters &iop) : net_(¤t_tx->Thd()->net), cached_size_(0), cached_offset_(0) { //net_request_file(net_, iop.Path()); @@ -69,7 +69,7 @@ size_t NetStream::Read(void *buf, size_t count) { if (len == packet_error) { opened_ = false; std::chrono::duration diff = std::chrono::system_clock::now() - start; - STONEDB_LOG(LogCtl_Level::INFO, "Failed to read from network: %s. Used %f seconds", std::strerror(errno), + TIANMU_LOG(LogCtl_Level::INFO, "Failed to read from network: %s. Used %f seconds", std::strerror(errno), diff.count()); return copied; } @@ -94,4 +94,4 @@ size_t NetStream::Read(void *buf, size_t count) { return copied; } } // namespace system -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/system/net_stream.h b/storage/tianmu/system/net_stream.h similarity index 91% rename from storage/stonedb/system/net_stream.h rename to storage/tianmu/system/net_stream.h index 74fc59bc07..d90f1f4cff 100644 --- a/storage/stonedb/system/net_stream.h +++ b/storage/tianmu/system/net_stream.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_NET_STREAM_H_ -#define STONEDB_SYSTEM_NET_STREAM_H_ +#ifndef TIANMU_SYSTEM_NET_STREAM_H_ +#define TIANMU_SYSTEM_NET_STREAM_H_ #pragma once #include @@ -25,7 +25,7 @@ #include "system/io_parameters.h" #include "system/stream.h" -namespace stonedb { +namespace Tianmu { namespace system { class NetStream : public Stream { @@ -53,6 +53,6 @@ class NetStream : public Stream { }; } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_NET_STREAM_H_ +#endif // TIANMU_SYSTEM_NET_STREAM_H_ diff --git a/storage/stonedb/system/rc_system.cpp b/storage/tianmu/system/rc_system.cpp similarity index 96% rename from storage/stonedb/system/rc_system.cpp rename to storage/tianmu/system/rc_system.cpp index f44124df0c..5685feff3e 100644 --- a/storage/stonedb/system/rc_system.cpp +++ b/storage/tianmu/system/rc_system.cpp @@ -22,7 +22,7 @@ #include "core/tools.h" #include "system/fet.h" -namespace stonedb { +namespace Tianmu { system::Channel rccontrol(true); system::Channel rcquerylog(true); @@ -42,4 +42,4 @@ uint64_t NoBytesReadByDPs = 0; uint64_t SizeOfUncompressedDP = 0; #endif -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/system/rc_system.h b/storage/tianmu/system/rc_system.h similarity index 90% rename from storage/stonedb/system/rc_system.h rename to storage/tianmu/system/rc_system.h index 5249a404e0..42fbcf672c 100644 --- a/storage/stonedb/system/rc_system.h +++ b/storage/tianmu/system/rc_system.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_RC_SYSTEM_H_ -#define STONEDB_SYSTEM_RC_SYSTEM_H_ +#ifndef TIANMU_SYSTEM_RC_SYSTEM_H_ +#define TIANMU_SYSTEM_RC_SYSTEM_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "system/configuration.h" #include "util/log_ctl.h" -namespace stonedb { +namespace Tianmu { namespace core { class Engine; class Transaction; @@ -45,6 +45,6 @@ extern std::mutex global_mutex; extern std::shared_mutex drop_rename_mutex; extern thread_local core::Transaction *current_tx; -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_RC_SYSTEM_H_ +#endif // TIANMU_SYSTEM_RC_SYSTEM_H_ diff --git a/storage/stonedb/system/res_manager.cpp b/storage/tianmu/system/res_manager.cpp similarity index 89% rename from storage/stonedb/system/res_manager.cpp rename to storage/tianmu/system/res_manager.cpp index dddc9ff116..1a36ed976c 100644 --- a/storage/stonedb/system/res_manager.cpp +++ b/storage/tianmu/system/res_manager.cpp @@ -20,15 +20,15 @@ #include "system/configuration.h" #include "system/mag_memory_policy.h" -namespace stonedb { +namespace Tianmu { namespace system { ResourceManager::ResourceManager() { // Instantiate policies based on ConfigurationManager settings - res_manage_policy_ = new MagMemoryPolicy(stonedb_sysvar_servermainheapsize); + res_manage_policy_ = new MagMemoryPolicy(tianmu_sysvar_servermainheapsize); } ResourceManager::~ResourceManager() { delete res_manage_policy_; } } // namespace system -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/system/res_manager.h b/storage/tianmu/system/res_manager.h similarity index 87% rename from storage/stonedb/system/res_manager.h rename to storage/tianmu/system/res_manager.h index 280da58732..1d637d4b6b 100644 --- a/storage/stonedb/system/res_manager.h +++ b/storage/tianmu/system/res_manager.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_RES_MANAGER_H_ -#define STONEDB_SYSTEM_RES_MANAGER_H_ +#ifndef TIANMU_SYSTEM_RES_MANAGER_H_ +#define TIANMU_SYSTEM_RES_MANAGER_H_ #pragma once #include "system/res_manager_base.h" #include "system/res_manager_policy.h" -namespace stonedb { +namespace Tianmu { namespace system { class ResourceManager : public ResourceManagerBase { @@ -35,6 +35,6 @@ class ResourceManager : public ResourceManagerBase { }; } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_RES_MANAGER_H_ +#endif // TIANMU_SYSTEM_RES_MANAGER_H_ diff --git a/storage/stonedb/system/res_manager_base.cpp b/storage/tianmu/system/res_manager_base.cpp similarity index 95% rename from storage/stonedb/system/res_manager_base.cpp rename to storage/tianmu/system/res_manager_base.cpp index 23910aa10d..a4fdb294ba 100644 --- a/storage/stonedb/system/res_manager_base.cpp +++ b/storage/tianmu/system/res_manager_base.cpp @@ -17,10 +17,10 @@ #include "res_manager_base.h" -namespace stonedb { +namespace Tianmu { namespace system { ResourceManagerBase::~ResourceManagerBase() {} } // namespace system -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/system/res_manager_base.h b/storage/tianmu/system/res_manager_base.h similarity index 84% rename from storage/stonedb/system/res_manager_base.h rename to storage/tianmu/system/res_manager_base.h index eae6857fda..a0a8692a7b 100644 --- a/storage/stonedb/system/res_manager_base.h +++ b/storage/tianmu/system/res_manager_base.h @@ -14,11 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_RES_MANAGER_BASE_H_ -#define STONEDB_SYSTEM_RES_MANAGER_BASE_H_ +#ifndef TIANMU_SYSTEM_RES_MANAGER_BASE_H_ +#define TIANMU_SYSTEM_RES_MANAGER_BASE_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace system { class ResourceManagerBase { @@ -29,6 +29,6 @@ class ResourceManagerBase { }; } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_RES_MANAGER_BASE_H_ +#endif // TIANMU_SYSTEM_RES_MANAGER_BASE_H_ diff --git a/storage/stonedb/system/res_manager_policy.h b/storage/tianmu/system/res_manager_policy.h similarity index 83% rename from storage/stonedb/system/res_manager_policy.h rename to storage/tianmu/system/res_manager_policy.h index 48775fe16d..38e4580a60 100644 --- a/storage/stonedb/system/res_manager_policy.h +++ b/storage/tianmu/system/res_manager_policy.h @@ -14,11 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_RES_MANAGER_POLICY_H_ -#define STONEDB_SYSTEM_RES_MANAGER_POLICY_H_ +#ifndef TIANMU_SYSTEM_RES_MANAGER_POLICY_H_ +#define TIANMU_SYSTEM_RES_MANAGER_POLICY_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace system { class ResourceManagerPolicy { @@ -28,6 +28,6 @@ class ResourceManagerPolicy { }; } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_RES_MANAGER_POLICY_H_ +#endif // TIANMU_SYSTEM_RES_MANAGER_POLICY_H_ diff --git a/storage/stonedb/system/stdout.h b/storage/tianmu/system/stdout.h similarity index 95% rename from storage/stonedb/system/stdout.h rename to storage/tianmu/system/stdout.h index 7fdb781a76..01c6d07d29 100644 --- a/storage/stonedb/system/stdout.h +++ b/storage/tianmu/system/stdout.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_STDOUT_H_ -#define STONEDB_SYSTEM_STDOUT_H_ +#ifndef TIANMU_SYSTEM_STDOUT_H_ +#define TIANMU_SYSTEM_STDOUT_H_ #pragma once #include "system/channel_out.h" -namespace stonedb { +namespace Tianmu { namespace system { class StdOut : public ChannelOut { @@ -119,6 +119,6 @@ class StdOut : public ChannelOut { }; } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_STDOUT_H_ +#endif // TIANMU_SYSTEM_STDOUT_H_ diff --git a/storage/stonedb/system/stream.cpp b/storage/tianmu/system/stream.cpp similarity index 96% rename from storage/stonedb/system/stream.cpp rename to storage/tianmu/system/stream.cpp index d06d937697..53683ad0bc 100644 --- a/storage/stonedb/system/stream.cpp +++ b/storage/tianmu/system/stream.cpp @@ -21,7 +21,7 @@ #include "common/exception.h" -namespace stonedb { +namespace Tianmu { namespace system { void Stream::ThrowError(int errnum) { ThrowError(std::strerror(errnum)); } @@ -36,4 +36,4 @@ void Stream::ThrowError(std::string serror) { } } // namespace system -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/system/stream.h b/storage/tianmu/system/stream.h similarity index 91% rename from storage/stonedb/system/stream.h rename to storage/tianmu/system/stream.h index e29b0be9d1..43805ec951 100644 --- a/storage/stonedb/system/stream.h +++ b/storage/tianmu/system/stream.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_STREAM_H_ -#define STONEDB_SYSTEM_STREAM_H_ +#ifndef TIANMU_SYSTEM_STREAM_H_ +#define TIANMU_SYSTEM_STREAM_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace system { class Stream { @@ -45,6 +45,6 @@ class Stream { }; } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_STREAM_H_ +#endif // TIANMU_SYSTEM_STREAM_H_ diff --git a/storage/stonedb/system/stonedb_file.h b/storage/tianmu/system/tianmu_file.h similarity index 85% rename from storage/stonedb/system/stonedb_file.h rename to storage/tianmu/system/tianmu_file.h index a1535df3ee..9a207d8b55 100644 --- a/storage/stonedb/system/stonedb_file.h +++ b/storage/tianmu/system/tianmu_file.h @@ -14,33 +14,33 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_STONEDB_FILE_H_ -#define STONEDB_SYSTEM_STONEDB_FILE_H_ +#ifndef TIANMU_SYSTEM_TIANMU_FILE_H_ +#define TIANMU_SYSTEM_TIANMU_FILE_H_ #pragma once #include "common/exception.h" #include "system/file_system.h" #include "system/stream.h" -namespace stonedb { +namespace Tianmu { namespace system { #define O_BINARY 0 -#define sdb_umask S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP +#define tianmu_umask S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP /* A portable wrapper class for low level file I/O. Note - Most of the functions throws exception if it fails. So caller must handle exception appropriately. */ -class StoneDBFile : public Stream { +class TianmuFile : public Stream { private: int fd_; public: - StoneDBFile() { fd_ = -1; } - ~StoneDBFile() { + TianmuFile() { fd_ = -1; } + ~TianmuFile() { if (fd_ != -1) Close(); } @@ -63,6 +63,6 @@ class StoneDBFile : public Stream { }; } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_STONEDB_FILE_H_ +#endif // TIANMU_SYSTEM_TIANMU_FILE_H_ diff --git a/storage/stonedb/system/txt_utils.cpp b/storage/tianmu/system/txt_utils.cpp similarity index 98% rename from storage/stonedb/system/txt_utils.cpp rename to storage/tianmu/system/txt_utils.cpp index a30931d9a2..2bbb1ea121 100644 --- a/storage/stonedb/system/txt_utils.cpp +++ b/storage/tianmu/system/txt_utils.cpp @@ -19,7 +19,7 @@ #include "common/assert.h" -namespace stonedb { +namespace Tianmu { namespace system { inline char Convert2Hex(int index) { @@ -149,4 +149,4 @@ bool CanBeDTSeparator(char c) { } } // namespace system -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/system/txt_utils.h b/storage/tianmu/system/txt_utils.h similarity index 90% rename from storage/stonedb/system/txt_utils.h rename to storage/tianmu/system/txt_utils.h index aa1896671e..6905522830 100644 --- a/storage/stonedb/system/txt_utils.h +++ b/storage/tianmu/system/txt_utils.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_SYSTEM_TXT_UTILS_H_ -#define STONEDB_SYSTEM_TXT_UTILS_H_ +#ifndef TIANMU_SYSTEM_TXT_UTILS_H_ +#define TIANMU_SYSTEM_TXT_UTILS_H_ #pragma once #include "common/exception.h" #include "compress/defs.h" -namespace stonedb { +namespace Tianmu { namespace system { // bool TcharToAscii(const TCHAR* src, char* dest, unsigned long destSize); // @@ -37,6 +37,6 @@ common::ErrorCode EatUInt64(char *&ptr, int &len, uint64_t &out_value); bool CanBeDTSeparator(char c); } // namespace system -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_SYSTEM_TXT_UTILS_H_ +#endif // TIANMU_SYSTEM_TXT_UTILS_H_ diff --git a/storage/stonedb/types/bstring.cpp b/storage/tianmu/types/bstring.cpp similarity index 98% rename from storage/stonedb/types/bstring.cpp rename to storage/tianmu/types/bstring.cpp index 53d32e46b9..38e8c19487 100644 --- a/storage/stonedb/types/bstring.cpp +++ b/storage/tianmu/types/bstring.cpp @@ -20,7 +20,7 @@ #include "core/tools.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace types { BString::BString() // null string @@ -79,7 +79,7 @@ BString &BString::operator=(const RCDataType &rcdt) { if (rcdt.GetValueType() == ValueTypeEnum::STRING_TYPE) *this = (BString &)rcdt; else - STONEDB_ERROR("bad cast"); + TIANMU_ERROR("bad cast"); return *this; } @@ -119,7 +119,7 @@ void BString::PutVarchar(char *&dest, uchar prefixlen, bool move_ptr) const { *(uint *)dest = (uint)len; break; default: - STONEDB_ERROR("not implemented"); + TIANMU_ERROR("not implemented"); } std::memcpy(dest + prefixlen, val, len); if (move_ptr) dest += prefixlen + len; @@ -457,7 +457,7 @@ size_t BString::RoundUpTo8Bytes(const DTCollation &dt) const { next_char_len = dt.collation->cset->mbcharlen(dt.collation, (uchar)val[useful_len + pos]); if (next_char_len == 0) { - STONEDB_LOG(LogCtl_Level::WARN, "RoundUpTo8Bytes() detect non-UTF8 character"); + TIANMU_LOG(LogCtl_Level::WARN, "RoundUpTo8Bytes() detect non-UTF8 character"); next_char_len = 1; } @@ -472,4 +472,4 @@ size_t BString::RoundUpTo8Bytes(const DTCollation &dt) const { } } // namespace types -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/types/rc_data_types.cpp b/storage/tianmu/types/rc_data_types.cpp similarity index 99% rename from storage/stonedb/types/rc_data_types.cpp rename to storage/tianmu/types/rc_data_types.cpp index dcd6680f87..9a0e996ec0 100644 --- a/storage/stonedb/types/rc_data_types.cpp +++ b/storage/tianmu/types/rc_data_types.cpp @@ -20,7 +20,7 @@ #include "core/rc_attr.h" #include "core/rc_attr_typeinfo.h" -namespace stonedb { +namespace Tianmu { namespace types { RCDataType::~RCDataType() {} @@ -131,4 +131,4 @@ ValueTypeEnum RCDataType::GetValueType(common::CT attr_type) { } } // namespace types -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/types/rc_data_types.h b/storage/tianmu/types/rc_data_types.h similarity index 97% rename from storage/stonedb/types/rc_data_types.h rename to storage/tianmu/types/rc_data_types.h index 176c104571..d8ac5b0f65 100644 --- a/storage/stonedb/types/rc_data_types.h +++ b/storage/tianmu/types/rc_data_types.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_TYPES_RC_DATA_TYPES_H_ -#define STONEDB_TYPES_RC_DATA_TYPES_H_ +#ifndef TIANMU_TYPES_RC_DATA_TYPES_H_ +#define TIANMU_TYPES_RC_DATA_TYPES_H_ #pragma once #include @@ -27,7 +27,7 @@ #include "core/rc_attr_typeinfo.h" #include "system/txt_utils.h" -namespace stonedb { +namespace Tianmu { namespace types { class BString; @@ -368,11 +368,11 @@ class RCDateTime : public ValueBasic { static bool IsLeapYear(short year); static ushort NoDaysInMonth(short year, ushort month); - static bool IsCorrectSDBYear(short year); - static bool IsCorrectSDBDate(short year, short month, short day); - static bool IsCorrectSDBTime(short hour, short minute, short second); - static bool IsCorrectSDBTimestamp(short year, short month, short day, short hour, short minute, short second); - static bool IsCorrectSDBDatetime(short year, short month, short day, short hour, short minute, short second); + static bool IsCorrectTIANMUYear(short year); + static bool IsCorrectTIANMUDate(short year, short month, short day); + static bool IsCorrectTIANMUTime(short hour, short minute, short second); + static bool IsCorrectTIANMUTimestamp(short year, short month, short day, short hour, short minute, short second); + static bool IsCorrectTIANMUDatetime(short year, short month, short day, short hour, short minute, short second); static short ToCorrectYear(uint v, common::CT at, bool is_year_2 = false); static RCDateTime GetSpecialValue(common::CT at); @@ -638,6 +638,6 @@ const static RCDateTime RC_TIMESTAMP_MAX(2038, 01, 01, 00, 59, 59, common::CT::T const static RCDateTime RC_TIMESTAMP_SPEC(0, common::CT::TIMESTAMP); } // namespace types -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_TYPES_RC_DATA_TYPES_H_ +#endif // TIANMU_TYPES_RC_DATA_TYPES_H_ diff --git a/storage/stonedb/types/rc_datetime.cpp b/storage/tianmu/types/rc_datetime.cpp similarity index 92% rename from storage/stonedb/types/rc_datetime.cpp rename to storage/tianmu/types/rc_datetime.cpp index 2c3e119f2f..caebca8e9e 100644 --- a/storage/stonedb/types/rc_datetime.cpp +++ b/storage/tianmu/types/rc_datetime.cpp @@ -23,7 +23,7 @@ #include "system/rc_system.h" #include "types/value_parser4txt.h" -namespace stonedb { +namespace Tianmu { namespace types { static_assert(sizeof(DT) == 8); @@ -65,7 +65,7 @@ RCDateTime::RCDateTime(short yh, short mm, short ds, common::CT at) : at(at) { dt.time_hour = std::abs(yh); if (yh < 0 || mm < 0 || ds < 0) dt.neg = 1; } else - STONEDB_ERROR("type not supported"); + TIANMU_ERROR("type not supported"); } RCDateTime::RCDateTime(short year, short month, short day, short hour, short minute, short second, common::CT at) @@ -100,11 +100,11 @@ RCDateTime::RCDateTime(RCNum &rcn, common::CT at) : at(at) { null = rcn.null; if (!null) { if (core::ATI::IsRealType(rcn.Type())) - throw common::DataTypeConversionException(common::SDBError(common::ErrorCode::DATACONVERSION)); + throw common::DataTypeConversionException(common::TIANMUError(common::ErrorCode::DATACONVERSION)); if (rcn.Type() == common::CT::NUM && rcn.Scale() > 0) - throw common::DataTypeConversionException(common::SDBError(common::ErrorCode::DATACONVERSION)); + throw common::DataTypeConversionException(common::TIANMUError(common::ErrorCode::DATACONVERSION)); if (Parse((int64_t)rcn, *this, at) != common::ErrorCode::SUCCESS) - throw common::DataTypeConversionException(common::SDBError(common::ErrorCode::DATACONVERSION)); + throw common::DataTypeConversionException(common::TIANMUError(common::ErrorCode::DATACONVERSION)); } } @@ -123,7 +123,7 @@ RCDateTime &RCDateTime::operator=(const RCDataType &rcv) { if (rcv.GetValueType() == ValueTypeEnum::DATE_TIME_TYPE) *this = (RCDateTime &)rcv; else { - STONEDB_ERROR("bad cast"); + TIANMU_ERROR("bad cast"); null = true; } return *this; @@ -184,7 +184,7 @@ BString RCDateTime::ToBString() const { std::sprintf(buf, "%04d-%02d-%02d %02d:%02d:%02d.%06d", (int)std::abs(Year()), (int)std::abs(Month()), (int)std::abs(Day()), (int)Hour(), (int)Minute(), (int)Second(), (int)MicroSecond()); } else - STONEDB_ERROR("type not supported"); + TIANMU_ERROR("type not supported"); rcs.len = (uint)std::strlen(rcs.val); return rcs; } @@ -210,7 +210,7 @@ common::ErrorCode RCDateTime::Parse(const int64_t &v, RCDateTime &rcv, common::C if (at == common::CT::YEAR) { uint vv = (uint)v; vv = ToCorrectYear(vv, at, (precision >= 0 && precision < 4)); - if (IsCorrectSDBYear((short)vv)) { + if (IsCorrectTIANMUYear((short)vv)) { rcv.dt.year = (short)vv; return common::ErrorCode::SUCCESS; } @@ -234,7 +234,7 @@ common::ErrorCode RCDateTime::Parse(const int64_t &v, RCDateTime &rcv, common::C return common::ErrorCode::OUT_OF_RANGE; } rcv.dt.year = vv; - if (sign == 1 && IsCorrectSDBDate(short(rcv.dt.year), short(rcv.dt.month), short(rcv.dt.day))) + if (sign == 1 && IsCorrectTIANMUDate(short(rcv.dt.year), short(rcv.dt.month), short(rcv.dt.day))) return common::ErrorCode::SUCCESS; } else if (at == common::CT::TIME) { if (!CanBeSecond(tmp_v % 100)) { @@ -260,7 +260,7 @@ common::ErrorCode RCDateTime::Parse(const int64_t &v, RCDateTime &rcv, common::C rcv.dt.hour = tmp_v; - if (IsCorrectSDBTime(short(rcv.dt.hour * sign), short(rcv.dt.minute * sign), short(rcv.dt.second * sign))) { + if (IsCorrectTIANMUTime(short(rcv.dt.hour * sign), short(rcv.dt.minute * sign), short(rcv.dt.second * sign))) { if (sign == -1) rcv.dt.neg = 1; return common::ErrorCode::SUCCESS; } else { @@ -306,14 +306,14 @@ common::ErrorCode RCDateTime::Parse(const int64_t &v, RCDateTime &rcv, common::C } rcv.dt.year = RCDateTime::ToCorrectYear((uint)tmp_v, at); if (sign == 1 && at == common::CT::DATETIME && - IsCorrectSDBDatetime(rcv.dt.year, rcv.dt.month, rcv.dt.day, rcv.dt.hour, rcv.dt.minute, rcv.dt.second)) + IsCorrectTIANMUDatetime(rcv.dt.year, rcv.dt.month, rcv.dt.day, rcv.dt.hour, rcv.dt.minute, rcv.dt.second)) return common::ErrorCode::SUCCESS; if (sign == 1 && at == common::CT::TIMESTAMP && - IsCorrectSDBTimestamp(short(rcv.dt.year), short(rcv.dt.month), short(rcv.dt.day), short(rcv.dt.hour), + IsCorrectTIANMUTimestamp(short(rcv.dt.year), short(rcv.dt.month), short(rcv.dt.day), short(rcv.dt.hour), short(rcv.dt.minute), short(rcv.dt.second))) return common::ErrorCode::SUCCESS; } else - STONEDB_ERROR("type not supported"); + TIANMU_ERROR("type not supported"); rcv = GetSpecialValue(at); return common::ErrorCode::OUT_OF_RANGE; @@ -380,11 +380,11 @@ bool RCDateTime::CanBeDatetime(int64_t year, int64_t month, int64_t day, int64_t return false; } -bool RCDateTime::IsCorrectSDBYear(short year) { +bool RCDateTime::IsCorrectTIANMUYear(short year) { return year == RC_YEAR_SPEC.Year() || (CanBeYear(year) && (year >= RC_YEAR_MIN.Year() && year <= RC_YEAR_MAX.Year())); } -bool RCDateTime::IsCorrectSDBDate(short year, short month, short day) { +bool RCDateTime::IsCorrectTIANMUDate(short year, short month, short day) { if (year == RC_DATE_SPEC.Year() && month == RC_DATE_SPEC.Month() && day == RC_DATE_SPEC.Day()) return true; if (CanBeYear(year) && CanBeMonth(month) && (day > 0 && (day <= NoDaysInMonth(year, month)))) { if (((year >= RC_DATE_MIN.Year() && month >= RC_DATE_MIN.Month() && day >= RC_DATE_MIN.Day()) && @@ -394,7 +394,7 @@ bool RCDateTime::IsCorrectSDBDate(short year, short month, short day) { return false; } -bool RCDateTime::IsCorrectSDBTime(short hour, short minute, short second) { +bool RCDateTime::IsCorrectTIANMUTime(short hour, short minute, short second) { if (hour == RC_TIME_SPEC.Hour() && minute == RC_TIME_SPEC.Minute() && second == RC_TIME_SPEC.Second()) return true; bool haspositive = false; bool hasnegative = false; @@ -409,7 +409,7 @@ bool RCDateTime::IsCorrectSDBTime(short hour, short minute, short second) { return false; } -bool RCDateTime::IsCorrectSDBTimestamp(short year, short month, short day, short hour, short minute, short second) { +bool RCDateTime::IsCorrectTIANMUTimestamp(short year, short month, short day, short hour, short minute, short second) { if (year == RC_TIMESTAMP_SPEC.Year() && month == RC_TIMESTAMP_SPEC.Month() && day == RC_TIMESTAMP_SPEC.Day() && hour == RC_TIMESTAMP_SPEC.Hour() && minute == RC_TIMESTAMP_SPEC.Minute() && second == RC_TIMESTAMP_SPEC.Second()) return true; @@ -421,7 +421,7 @@ bool RCDateTime::IsCorrectSDBTimestamp(short year, short month, short day, short return false; } -bool RCDateTime::IsCorrectSDBDatetime(short year, short month, short day, short hour, short minute, short second) { +bool RCDateTime::IsCorrectTIANMUDatetime(short year, short month, short day, short hour, short minute, short second) { if (year == RC_DATETIME_SPEC.Year() && month == RC_DATETIME_SPEC.Month() && day == RC_DATETIME_SPEC.Day() && hour == RC_DATETIME_SPEC.Hour() && minute == RC_DATETIME_SPEC.Minute() && second == RC_DATETIME_SPEC.Second()) return true; @@ -472,7 +472,7 @@ short RCDateTime::ToCorrectYear(uint v, common::CT at, bool is_year_2 /*= false* } return (short)v; default: - STONEDB_ERROR("type not supported"); + TIANMU_ERROR("type not supported"); } return 0; // to avoid errors in release version } @@ -490,7 +490,7 @@ RCDateTime RCDateTime::GetSpecialValue(common::CT at) { case common::CT::TIMESTAMP: return RC_TIMESTAMP_SPEC; default: - STONEDB_ERROR("type not supported"); + TIANMU_ERROR("type not supported"); } return RC_DATETIME_SPEC; // to avoid errors in release version } @@ -641,14 +641,14 @@ void RCDateTime::AdjustTimezone(RCDateTime &dt) { // since EPOCHE MYSQL_TIME time_tmp; thd->variables.time_zone->gmt_sec_to_TIME( - &time_tmp, stonedb_sec_since_epoch(t.year, t.month, t.day, t.hour, t.minute, t.second)); - secs = stonedb_sec_since_epoch(time_tmp.year, time_tmp.month, time_tmp.day, time_tmp.hour, time_tmp.minute, + &time_tmp, tianmu_sec_since_epoch(t.year, t.month, t.day, t.hour, t.minute, t.second)); + secs = tianmu_sec_since_epoch(time_tmp.year, time_tmp.month, time_tmp.day, time_tmp.hour, time_tmp.minute, time_tmp.second); } else { // time in client time zone is converted into UTC and expressed as seconds // since EPOCHE - secs = stonedb_sec_since_epoch(t.year, t.month, t.day, t.hour, t.minute, t.second) - sign * minutes * 60; + secs = tianmu_sec_since_epoch(t.year, t.month, t.day, t.hour, t.minute, t.second) - sign * minutes * 60; } // UTC seconds converted to UTC struct tm struct tm utc_t; @@ -660,4 +660,4 @@ void RCDateTime::AdjustTimezone(RCDateTime &dt) { } } } // namespace types -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/types/rc_item_types.cpp b/storage/tianmu/types/rc_item_types.cpp similarity index 97% rename from storage/stonedb/types/rc_item_types.cpp rename to storage/tianmu/types/rc_item_types.cpp index cb564f0767..48190269ab 100644 --- a/storage/stonedb/types/rc_item_types.cpp +++ b/storage/tianmu/types/rc_item_types.cpp @@ -20,7 +20,7 @@ #include "item_sum.h" #include "common/common_definitions.h" -namespace stonedb { +namespace Tianmu { namespace types { Item_sum_int_rcbase::Item_sum_int_rcbase() : Item_sum_num() {} @@ -142,7 +142,7 @@ double Item_sum_hybrid_rcbase::val_real() { case ROW_RESULT: default: // This case should never be chosen - STONEDB_ERROR("type not supported"); + TIANMU_ERROR("type not supported"); return 0; } } @@ -182,7 +182,7 @@ my_decimal *Item_sum_hybrid_rcbase::val_decimal(my_decimal *val) { case ROW_RESULT: default: // This case should never be chosen - STONEDB_ERROR("type not supported"); + TIANMU_ERROR("type not supported"); break; } return val; // Keep compiler happy @@ -209,7 +209,7 @@ String *Item_sum_hybrid_rcbase::val_str(String *str) { case ROW_RESULT: default: // This case should never be chosen - STONEDB_ERROR("type not supported"); + TIANMU_ERROR("type not supported"); break; } return str; // Keep compiler happy @@ -237,4 +237,4 @@ bool Item_sum_hybrid_rcbase::add() { return false; } void Item_sum_hybrid_rcbase::update_field() {} } // namespace types -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/types/rc_item_types.h b/storage/tianmu/types/rc_item_types.h similarity index 95% rename from storage/stonedb/types/rc_item_types.h rename to storage/tianmu/types/rc_item_types.h index 03d593a3a4..46489ec5ac 100644 --- a/storage/stonedb/types/rc_item_types.h +++ b/storage/tianmu/types/rc_item_types.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_TYPES_RC_ITEM_TYPES_H_ -#define STONEDB_TYPES_RC_ITEM_TYPES_H_ +#ifndef TIANMU_TYPES_RC_ITEM_TYPES_H_ +#define TIANMU_TYPES_RC_ITEM_TYPES_H_ #pragma once #include "common/assert.h" #include "common/common_definitions.h" -namespace stonedb { +namespace Tianmu { namespace types { class Item_sum_int_rcbase : public Item_sum_num { @@ -128,6 +128,6 @@ class Item_sum_hybrid_rcbase : public Item_sum { }; } // namespace types -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_TYPES_RC_ITEM_TYPES_H_ +#endif // TIANMU_TYPES_RC_ITEM_TYPES_H_ diff --git a/storage/stonedb/types/rc_num.cpp b/storage/tianmu/types/rc_num.cpp similarity index 97% rename from storage/stonedb/types/rc_num.cpp rename to storage/tianmu/types/rc_num.cpp index ba4c8938f7..9de7f0e766 100644 --- a/storage/stonedb/types/rc_num.cpp +++ b/storage/tianmu/types/rc_num.cpp @@ -25,7 +25,7 @@ #include "types/rc_data_types.h" #include "types/value_parser4txt.h" -namespace stonedb { +namespace Tianmu { namespace types { RCNum::RCNum(common::CT attrt) : value_(0), scale_(0), is_double_(false), is_dot_(false), attr_type_(attrt) {} @@ -106,7 +106,7 @@ RCNum &RCNum::operator=(const RCDataType &rcdt) { if (common::IsError(RCNum::Parse(rcdt.ToBString(), rcn1, this->attr_type_))) { *this = rcn1; } else { - STONEDB_ERROR("Unsupported assign operation!"); + TIANMU_ERROR("Unsupported assign operation!"); null = true; } } @@ -254,7 +254,7 @@ bool RCNum::operator==(const RCDataType &rcdt) const { if (rcdt.GetValueType() == ValueTypeEnum::NUMERIC_TYPE) return (compare((RCNum &)rcdt) == 0); if (rcdt.GetValueType() == ValueTypeEnum::DATE_TIME_TYPE) return (compare((RCDateTime &)rcdt) == 0); if (rcdt.GetValueType() == ValueTypeEnum::STRING_TYPE) return (rcdt == this->ToBString()); - STONEDB_ERROR("Bad cast inside RCNum"); + TIANMU_ERROR("Bad cast inside RCNum"); return false; } @@ -263,7 +263,7 @@ bool RCNum::operator!=(const RCDataType &rcdt) const { if (rcdt.GetValueType() == ValueTypeEnum::NUMERIC_TYPE) return (compare((RCNum &)rcdt) != 0); if (rcdt.GetValueType() == ValueTypeEnum::DATE_TIME_TYPE) return (compare((RCDateTime &)rcdt) != 0); if (rcdt.GetValueType() == ValueTypeEnum::STRING_TYPE) return (rcdt != this->ToBString()); - STONEDB_ERROR("Bad cast inside RCNum"); + TIANMU_ERROR("Bad cast inside RCNum"); return false; } @@ -272,7 +272,7 @@ bool RCNum::operator<(const RCDataType &rcdt) const { if (rcdt.GetValueType() == ValueTypeEnum::NUMERIC_TYPE) return (compare((RCNum &)rcdt) < 0); if (rcdt.GetValueType() == ValueTypeEnum::DATE_TIME_TYPE) return (compare((RCDateTime &)rcdt) < 0); if (rcdt.GetValueType() == ValueTypeEnum::STRING_TYPE) return (this->ToBString() < rcdt); - STONEDB_ERROR("Bad cast inside RCNum"); + TIANMU_ERROR("Bad cast inside RCNum"); return false; } @@ -281,7 +281,7 @@ bool RCNum::operator>(const RCDataType &rcdt) const { if (rcdt.GetValueType() == ValueTypeEnum::NUMERIC_TYPE) return (compare((RCNum &)rcdt) > 0); if (rcdt.GetValueType() == ValueTypeEnum::DATE_TIME_TYPE) return (compare((RCDateTime &)rcdt) > 0); if (rcdt.GetValueType() == ValueTypeEnum::STRING_TYPE) return (this->ToBString() > rcdt); - STONEDB_ERROR("Bad cast inside RCNum"); + TIANMU_ERROR("Bad cast inside RCNum"); return false; } @@ -290,7 +290,7 @@ bool RCNum::operator<=(const RCDataType &rcdt) const { if (rcdt.GetValueType() == ValueTypeEnum::NUMERIC_TYPE) return (compare((RCNum &)rcdt) <= 0); if (rcdt.GetValueType() == ValueTypeEnum::DATE_TIME_TYPE) return (compare((RCDateTime &)rcdt) <= 0); if (rcdt.GetValueType() == ValueTypeEnum::STRING_TYPE) return (this->ToBString() <= rcdt); - STONEDB_ERROR("Bad cast inside RCNum"); + TIANMU_ERROR("Bad cast inside RCNum"); return false; } @@ -299,7 +299,7 @@ bool RCNum::operator>=(const RCDataType &rcdt) const { if (rcdt.GetValueType() == ValueTypeEnum::NUMERIC_TYPE) return (compare((RCNum &)rcdt) >= 0); if (rcdt.GetValueType() == ValueTypeEnum::DATE_TIME_TYPE) return (compare((RCDateTime &)rcdt) >= 0); if (rcdt.GetValueType() == ValueTypeEnum::STRING_TYPE) return (this->ToBString() >= rcdt); - STONEDB_ERROR("Bad cast inside RCNum"); + TIANMU_ERROR("Bad cast inside RCNum"); return false; } @@ -543,4 +543,4 @@ void RCNum::Negate() { } } // namespace types -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/types/rc_num.h b/storage/tianmu/types/rc_num.h similarity index 96% rename from storage/stonedb/types/rc_num.h rename to storage/tianmu/types/rc_num.h index 14bf77475d..ec3f293eb2 100644 --- a/storage/stonedb/types/rc_num.h +++ b/storage/tianmu/types/rc_num.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_TYPES_RC_NUM_H_ -#define STONEDB_TYPES_RC_NUM_H_ +#ifndef TIANMU_TYPES_RC_NUM_H_ +#define TIANMU_TYPES_RC_NUM_H_ #pragma once #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace types { class BString; @@ -111,6 +111,6 @@ class RCNum : public ValueBasic { }; } // namespace types -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_TYPES_RC_NUM_H_ +#endif // TIANMU_TYPES_RC_NUM_H_ diff --git a/storage/stonedb/types/rc_value_object.cpp b/storage/tianmu/types/rc_value_object.cpp similarity index 96% rename from storage/stonedb/types/rc_value_object.cpp rename to storage/tianmu/types/rc_value_object.cpp index b1425b317e..3374dc849b 100644 --- a/storage/stonedb/types/rc_value_object.cpp +++ b/storage/tianmu/types/rc_value_object.cpp @@ -17,7 +17,7 @@ #include "types/rc_num.h" -namespace stonedb { +namespace Tianmu { namespace types { RCValueObject::RCValueObject() {} @@ -121,7 +121,7 @@ RCValueObject::operator RCNum &() const { if (GetValueType() == ValueTypeEnum::NUMERIC_TYPE || GetValueType() == ValueTypeEnum::DATE_TIME_TYPE) return static_cast(*value); - STONEDB_ERROR("Bad cast in RCValueObject::RCNum&()"); + TIANMU_ERROR("Bad cast in RCValueObject::RCNum&()"); return static_cast(*value); } @@ -129,7 +129,7 @@ RCValueObject::operator RCDateTime &() const { if (IsNull()) return RCDateTime::NullValue(); if (GetValueType() == ValueTypeEnum::DATE_TIME_TYPE) return static_cast(*value); - STONEDB_ERROR("Bad cast in RCValueObject::RCDateTime&()"); + TIANMU_ERROR("Bad cast in RCValueObject::RCDateTime&()"); return static_cast(*value); } @@ -144,4 +144,4 @@ uint RCValueObject::GetHashCode() const { } } // namespace types -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/types/text_stat.cpp b/storage/tianmu/types/text_stat.cpp similarity index 99% rename from storage/stonedb/types/text_stat.cpp rename to storage/tianmu/types/text_stat.cpp index 0628e78d6f..9b4067f886 100644 --- a/storage/stonedb/types/text_stat.cpp +++ b/storage/tianmu/types/text_stat.cpp @@ -17,7 +17,7 @@ #include "types/text_stat.h" -namespace stonedb { +namespace Tianmu { namespace types { TextStat::TextStat() { @@ -213,4 +213,4 @@ BString TextStat::Decode(int64_t code) { } } // namespace types -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/types/text_stat.h b/storage/tianmu/types/text_stat.h similarity index 95% rename from storage/stonedb/types/text_stat.h rename to storage/tianmu/types/text_stat.h index 835991ef20..b61ce8f38e 100644 --- a/storage/stonedb/types/text_stat.h +++ b/storage/tianmu/types/text_stat.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_TYPES_TEXT_STAT_H_ -#define STONEDB_TYPES_TEXT_STAT_H_ +#ifndef TIANMU_TYPES_TEXT_STAT_H_ +#define TIANMU_TYPES_TEXT_STAT_H_ #pragma once #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace types { class TextStat final { @@ -77,6 +77,6 @@ class TextStat final { }; } // namespace types -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_TYPES_TEXT_STAT_H_ +#endif // TIANMU_TYPES_TEXT_STAT_H_ diff --git a/storage/stonedb/types/value_parser4txt.cpp b/storage/tianmu/types/value_parser4txt.cpp similarity index 86% rename from storage/stonedb/types/value_parser4txt.cpp rename to storage/tianmu/types/value_parser4txt.cpp index d876ff744f..6b5830be3d 100644 --- a/storage/stonedb/types/value_parser4txt.cpp +++ b/storage/tianmu/types/value_parser4txt.cpp @@ -22,7 +22,7 @@ #include "my_time.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace types { const uint PARS_BUF_SIZE = 128; @@ -111,7 +111,7 @@ common::ErrorCode ValueParserForText::ParseNum(const BString &rcs, RCNum &rcn, s short sign = 1; bool last_set = false; short last = 0; - common::ErrorCode sdbret = common::ErrorCode::SUCCESS; + common::ErrorCode tianmuret = common::ErrorCode::SUCCESS; if (ptr_len > 0 && *val_ptr == '-') { val_ptr++; ptr_len--; @@ -130,7 +130,7 @@ common::ErrorCode ValueParserForText::ParseNum(const BString &rcs, RCNum &rcn, s no_digs--; if (has_dot) { no_digs_after_dot--; - if (*val_ptr != '0') sdbret = common::ErrorCode::VALUE_TRUNCATED; + if (*val_ptr != '0') tianmuret = common::ErrorCode::VALUE_TRUNCATED; if (!last_set) { last_set = true; if (*val_ptr > '4') { @@ -152,9 +152,9 @@ common::ErrorCode ValueParserForText::ParseNum(const BString &rcs, RCNum &rcn, s if (ptr_len > 0) has_unexpected_sign = true; break; } else if (*val_ptr == 'd' || *val_ptr == 'D' || *val_ptr == 'e' || *val_ptr == 'E') { - sdbret = RCNum::ParseReal(rcs, rcn, common::CT::REAL); + tianmuret = RCNum::ParseReal(rcs, rcn, common::CT::REAL); rcn = rcn.ToDecimal(scale); - return sdbret; + return tianmuret; } else { has_unexpected_sign = true; break; @@ -183,7 +183,7 @@ common::ErrorCode ValueParserForText::ParseNum(const BString &rcs, RCNum &rcn, s rcn.value_ = v * sign; rcn.scale_ = scale; if (has_unexpected_sign || no_digs > 18) return common::ErrorCode::VALUE_TRUNCATED; - return sdbret; + return tianmuret; } common::ErrorCode ValueParserForText::Parse(const BString &rcs, RCNum &rcn, common::CT at) { @@ -220,8 +220,8 @@ common::ErrorCode ValueParserForText::Parse(const BString &rcs, RCNum &rcn, comm can_be_minus = true; has_exp = true; int tmp_len = ptr_len; - common::ErrorCode sdbrc = system::EatInt(val_ptr, ptr_len, exponent); - if (sdbrc == common::ErrorCode::SUCCESS) return common::ErrorCode::FAILED; + common::ErrorCode tianmu_rc = system::EatInt(val_ptr, ptr_len, exponent); + if (tianmu_rc == common::ErrorCode::SUCCESS) return common::ErrorCode::FAILED; if (tmp_len != ptr_len) { can_be_minus = false; if (exponent == 0 && tmp_len - ptr_len == 1) { @@ -309,35 +309,35 @@ common::ErrorCode ValueParserForText::Parse(const BString &rcs, RCNum &rcn, comm int64_t v = rcn.value_; if (at == common::CT::BYTEINT) { - if (v > SDB_TINYINT_MAX) { - v = SDB_TINYINT_MAX; + if (v > TIANMU_TINYINT_MAX) { + v = TIANMU_TINYINT_MAX; ret = common::ErrorCode::OUT_OF_RANGE; - } else if (v < SDB_TINYINT_MIN) { - v = SDB_TINYINT_MIN; + } else if (v < TIANMU_TINYINT_MIN) { + v = TIANMU_TINYINT_MIN; ret = common::ErrorCode::OUT_OF_RANGE; } } else if (at == common::CT::SMALLINT) { - if (v > SDB_SMALLINT_MAX) { - v = SDB_SMALLINT_MAX; + if (v > TIANMU_SMALLINT_MAX) { + v = TIANMU_SMALLINT_MAX; ret = common::ErrorCode::OUT_OF_RANGE; - } else if (v < SDB_SMALLINT_MIN) { - v = SDB_SMALLINT_MIN; + } else if (v < TIANMU_SMALLINT_MIN) { + v = TIANMU_SMALLINT_MIN; ret = common::ErrorCode::OUT_OF_RANGE; } } else if (at == common::CT::MEDIUMINT) { - if (v > SDB_MEDIUMINT_MAX) { - v = SDB_MEDIUMINT_MAX; + if (v > TIANMU_MEDIUMINT_MAX) { + v = TIANMU_MEDIUMINT_MAX; ret = common::ErrorCode::OUT_OF_RANGE; - } else if (v < SDB_MEDIUMINT_MIN) { - v = SDB_MEDIUMINT_MIN; + } else if (v < TIANMU_MEDIUMINT_MIN) { + v = TIANMU_MEDIUMINT_MIN; ret = common::ErrorCode::OUT_OF_RANGE; } } else if (at == common::CT::INT) { if (v > std::numeric_limits::max()) { v = std::numeric_limits::max(); ret = common::ErrorCode::OUT_OF_RANGE; - } else if (v < SDB_INT_MIN) { - v = SDB_INT_MIN; + } else if (v < TIANMU_INT_MIN) { + v = TIANMU_INT_MIN; ret = common::ErrorCode::OUT_OF_RANGE; } } @@ -487,7 +487,7 @@ common::ErrorCode ValueParserForText::ParseBigInt(const BString &rcs, RCNum &rcn if (rc != common::ErrorCode::SUCCESS) { if (rc == common::ErrorCode::OUT_OF_RANGE) { ret = rc; - v = common::SDB_BIGINT_MAX; + v = common::TIANMU_BIGINT_MAX; } else { ret = common::ErrorCode::VALUE_TRUNCATED; v = 0; @@ -497,11 +497,11 @@ common::ErrorCode ValueParserForText::ParseBigInt(const BString &rcs, RCNum &rcn if (*val_ptr == 'd' || *val_ptr == 'D' || *val_ptr == 'e' || *val_ptr == 'E') { ret = RCNum::ParseReal(rcs, rcn, common::CT::REAL); if (rcn.GetDecFractLen() != 0 || ret != common::ErrorCode::SUCCESS) ret = common::ErrorCode::VALUE_TRUNCATED; - if (rcn.GetIntPartAsDouble() > common::SDB_BIGINT_MAX) { - v = common::SDB_BIGINT_MAX; + if (rcn.GetIntPartAsDouble() > common::TIANMU_BIGINT_MAX) { + v = common::TIANMU_BIGINT_MAX; ret = common::ErrorCode::OUT_OF_RANGE; - } else if (rcn.GetIntPartAsDouble() < common::SDB_BIGINT_MIN) { - v = common::SDB_BIGINT_MIN; + } else if (rcn.GetIntPartAsDouble() < common::TIANMU_BIGINT_MIN) { + v = common::TIANMU_BIGINT_MIN; ret = common::ErrorCode::OUT_OF_RANGE; } else { v = (int64_t)rcn; @@ -521,11 +521,11 @@ common::ErrorCode ValueParserForText::ParseBigInt(const BString &rcs, RCNum &rcn ret = RCNum::ParseReal(rcs, rcn, common::CT::REAL); if (rcn.GetDecFractLen() != 0 || ret != common::ErrorCode::SUCCESS) ret = common::ErrorCode::VALUE_TRUNCATED; - if (rcn.GetIntPartAsDouble() > common::SDB_BIGINT_MAX) { - v = common::SDB_BIGINT_MAX; + if (rcn.GetIntPartAsDouble() > common::TIANMU_BIGINT_MAX) { + v = common::TIANMU_BIGINT_MAX; ret = common::ErrorCode::OUT_OF_RANGE; - } else if (rcn.GetIntPartAsDouble() < common::SDB_BIGINT_MIN) { - v = common::SDB_BIGINT_MIN; + } else if (rcn.GetIntPartAsDouble() < common::TIANMU_BIGINT_MIN) { + v = common::TIANMU_BIGINT_MIN; ret = common::ErrorCode::OUT_OF_RANGE; } else { v = (int64_t)rcn; @@ -552,11 +552,11 @@ common::ErrorCode ValueParserForText::ParseBigInt(const BString &rcs, RCNum &rcn if (is_negative) v *= -1; - if (v > common::SDB_BIGINT_MAX) { - v = common::SDB_BIGINT_MAX; + if (v > common::TIANMU_BIGINT_MAX) { + v = common::TIANMU_BIGINT_MAX; ret = common::ErrorCode::OUT_OF_RANGE; - } else if (v < common::SDB_BIGINT_MIN) { - v = common::SDB_BIGINT_MIN; + } else if (v < common::TIANMU_BIGINT_MIN) { + v = common::TIANMU_BIGINT_MIN; ret = common::ErrorCode::OUT_OF_RANGE; } rcn.is_double_ = false; @@ -634,14 +634,14 @@ common::ErrorCode ValueParserForText::ParseDateTimeOrTimestamp(const BString &rc uint64_t year = 0; uint month = 0, day = 0, hour = 0, minute = 0, second = 0, microsecond = 0; - common::ErrorCode sdbrc = system::EatUInt64(buf, buflen, year); + common::ErrorCode tianmu_rc = system::EatUInt64(buf, buflen, year); EatWhiteSigns(buf, buflen); - if (sdbrc == common::ErrorCode::FAILED) { + if (tianmu_rc == common::ErrorCode::FAILED) { rcv = RCDateTime(RCDateTime::GetSpecialValue(at)); return common::ErrorCode::OUT_OF_RANGE; } - if (sdbrc != common::ErrorCode::OUT_OF_RANGE && buflen != 0) year = RCDateTime::ToCorrectYear((uint)year, at); + if (tianmu_rc != common::ErrorCode::OUT_OF_RANGE && buflen != 0) year = RCDateTime::ToCorrectYear((uint)year, at); if (buflen == 0) return RCDateTime::Parse(year, rcv, at); @@ -670,11 +670,11 @@ common::ErrorCode ValueParserForText::ParseDateTimeOrTimestamp(const BString &rc if (!EatWhiteSigns(buf, buflen) && !system::EatDTSeparators(buf, buflen)) { if ((at == common::CT::DATETIME && - RCDateTime::IsCorrectSDBDatetime((short)year, month, day, RCDateTime::GetSpecialValue(at).Hour(), + RCDateTime::IsCorrectTIANMUDatetime((short)year, month, day, RCDateTime::GetSpecialValue(at).Hour(), RCDateTime::GetSpecialValue(at).Minute(), RCDateTime::GetSpecialValue(at).Second())) || (at == common::CT::TIMESTAMP && - RCDateTime::IsCorrectSDBTimestamp((short)year, month, day, RCDateTime::GetSpecialValue(at).Hour(), + RCDateTime::IsCorrectTIANMUTimestamp((short)year, month, day, RCDateTime::GetSpecialValue(at).Hour(), RCDateTime::GetSpecialValue(at).Minute(), RCDateTime::GetSpecialValue(at).Second()))) rcv = RCDateTime((short)year, month, day, RCDateTime::GetSpecialValue(at).Hour(), @@ -687,19 +687,19 @@ common::ErrorCode ValueParserForText::ParseDateTimeOrTimestamp(const BString &rc eat1 = system::EatDTSeparators(buf, buflen); eat2 = EatWhiteSigns(buf, buflen); } - sdbrc = common::ErrorCode::SUCCESS; - sdbrc = system::EatUInt(buf, buflen, hour); - if (!common::IsError(sdbrc)) { + tianmu_rc = common::ErrorCode::SUCCESS; + tianmu_rc = system::EatUInt(buf, buflen, hour); + if (!common::IsError(tianmu_rc)) { if (!RCDateTime::CanBeHour(hour)) { rcv = RCDateTime(RCDateTime::GetSpecialValue(at)); return common::ErrorCode::OUT_OF_RANGE; } else if (!system::EatDTSeparators(buf, buflen)) { - sdbrc = common::ErrorCode::FAILED; + tianmu_rc = common::ErrorCode::FAILED; } } else hour = RCDateTime::GetSpecialValue(at).Hour(); - if (!common::IsError(sdbrc)) sdbrc = system::EatUInt(buf, buflen, minute); - if (!common::IsError(sdbrc)) { + if (!common::IsError(tianmu_rc)) tianmu_rc = system::EatUInt(buf, buflen, minute); + if (!common::IsError(tianmu_rc)) { if (!RCDateTime::CanBeMinute(minute)) { rcv = RCDateTime((short)year, (short)month, (short)day, (short)hour, (short)minute, (short)second, at); return common::ErrorCode::OUT_OF_RANGE; @@ -709,15 +709,15 @@ common::ErrorCode ValueParserForText::ParseDateTimeOrTimestamp(const BString &rc } } else minute = RCDateTime::GetSpecialValue(at).Minute(); - if (!common::IsError(sdbrc)) sdbrc = system::EatUInt(buf, buflen, second); - if (!common::IsError(sdbrc)) { + if (!common::IsError(tianmu_rc)) tianmu_rc = system::EatUInt(buf, buflen, second); + if (!common::IsError(tianmu_rc)) { if (!RCDateTime::CanBeSecond(second)) { rcv = RCDateTime((short)year, (short)month, (short)day, (short)hour, (short)minute, (short)second, at); return common::ErrorCode::OUT_OF_RANGE; } } else second = RCDateTime::GetSpecialValue(at).Second(); - if (sdbrc == common::ErrorCode::FAILED) sdbrc = common::ErrorCode::OUT_OF_RANGE; + if (tianmu_rc == common::ErrorCode::FAILED) tianmu_rc = common::ErrorCode::OUT_OF_RANGE; EatWhiteSigns(buf, buflen); @@ -737,18 +737,18 @@ common::ErrorCode ValueParserForText::ParseDateTimeOrTimestamp(const BString &rc try { if (at == common::CT::DATETIME) { - if (RCDateTime::IsCorrectSDBDatetime((short)year, (short)month, (short)day, (short)hour, (short)minute, + if (RCDateTime::IsCorrectTIANMUDatetime((short)year, (short)month, (short)day, (short)hour, (short)minute, (short)second)) { rcv = RCDateTime((short)year, (short)month, (short)day, (short)hour, (short)minute, (short)second, at); - return sdbrc; + return tianmu_rc; } else { rcv = RCDateTime((short)year, (short)month, (short)day, (short)RCDateTime::GetSpecialValue(at).Hour(), (short)RCDateTime::GetSpecialValue(at).Minute(), (short)RCDateTime::GetSpecialValue(at).Second(), at); - sdbrc = common::ErrorCode::OUT_OF_RANGE; + tianmu_rc = common::ErrorCode::OUT_OF_RANGE; } } else if (at == common::CT::TIMESTAMP) { - if (RCDateTime::IsCorrectSDBTimestamp((short)year, (short)month, (short)day, (short)hour, (short)minute, + if (RCDateTime::IsCorrectTIANMUTimestamp((short)year, (short)month, (short)day, (short)hour, (short)minute, (short)second)) { // convert to UTC MYSQL_TIME myt; @@ -768,15 +768,15 @@ common::ErrorCode ValueParserForText::ParseDateTimeOrTimestamp(const BString &rc myt.second_part = microsecond; } rcv = RCDateTime(myt, common::CT::TIMESTAMP); - return sdbrc; + return tianmu_rc; } else { rcv = RC_TIMESTAMP_SPEC; - sdbrc = common::ErrorCode::OUT_OF_RANGE; + tianmu_rc = common::ErrorCode::OUT_OF_RANGE; } } if (buflen != 0) return common::ErrorCode::OUT_OF_RANGE; - return sdbrc; + return tianmu_rc; } catch (common::DataTypeConversionException &) { rcv = RCDateTime(RCDateTime::GetSpecialValue(at)); return common::ErrorCode::OUT_OF_RANGE; @@ -816,13 +816,13 @@ common::ErrorCode ValueParserForText::ParseTime(const BString &rcs, RCDateTime & buflen--; } EatWhiteSigns(buf, buflen); - common::ErrorCode sdbrc = system::EatUInt64(buf, buflen, tmp); - if (sdbrc == common::ErrorCode::FAILED && buflen > 0 && *buf == ':') { // e.g. :12:34 + common::ErrorCode tianmu_rc = system::EatUInt64(buf, buflen, tmp); + if (tianmu_rc == common::ErrorCode::FAILED && buflen > 0 && *buf == ':') { // e.g. :12:34 colon = true; - } else if (sdbrc != common::ErrorCode::SUCCESS) { + } else if (tianmu_rc != common::ErrorCode::SUCCESS) { rcv = RCDateTime(RCDateTime::GetSpecialValue(common::CT::TIME)); return common::ErrorCode::VALUE_TRUNCATED; - } else if (sdbrc == common::ErrorCode::SUCCESS) { + } else if (tianmu_rc == common::ErrorCode::SUCCESS) { second = tmp; EatWhiteSigns(buf, buflen); if (buflen == 0) { // e.g. 235959 @@ -835,8 +835,8 @@ common::ErrorCode ValueParserForText::ParseTime(const BString &rcs, RCDateTime & buflen--; EatWhiteSigns(buf, buflen); uint tmp2 = 0; - sdbrc = system::EatUInt(buf, buflen, tmp2); - if (!common::IsError(sdbrc)) { // e.g. 01:02 + tianmu_rc = system::EatUInt(buf, buflen, tmp2); + if (!common::IsError(tianmu_rc)) { // e.g. 01:02 EatWhiteSigns(buf, buflen); if (colon) { // starts with ':' if (!RCDateTime::CanBeMinute(tmp2)) { @@ -850,12 +850,12 @@ common::ErrorCode ValueParserForText::ParseTime(const BString &rcs, RCDateTime & buf++; buflen--; EatWhiteSigns(buf, buflen); - sdbrc = system::EatUInt(buf, buflen, tmp2); - if (sdbrc == common::ErrorCode::SUCCESS && RCDateTime::CanBeSecond(tmp2)) + tianmu_rc = system::EatUInt(buf, buflen, tmp2); + if (tianmu_rc == common::ErrorCode::SUCCESS && RCDateTime::CanBeSecond(tmp2)) second = tmp2; else { second = RCDateTime::GetSpecialValue(common::CT::TIME).Second(); - sdbrc = common::ErrorCode::VALUE_TRUNCATED; + tianmu_rc = common::ErrorCode::VALUE_TRUNCATED; } } else { // e.g. :01: } @@ -870,12 +870,12 @@ common::ErrorCode ValueParserForText::ParseTime(const BString &rcs, RCDateTime & if (buflen > 0 && *buf == ':') { buf++; buflen--; - sdbrc = system::EatUInt(buf, buflen, tmp2); - if (sdbrc == common::ErrorCode::SUCCESS && RCDateTime::CanBeSecond(tmp2)) + tianmu_rc = system::EatUInt(buf, buflen, tmp2); + if (tianmu_rc == common::ErrorCode::SUCCESS && RCDateTime::CanBeSecond(tmp2)) second = tmp2; else { second = RCDateTime::GetSpecialValue(common::CT::TIME).Second(); - sdbrc = common::ErrorCode::VALUE_TRUNCATED; + tianmu_rc = common::ErrorCode::VALUE_TRUNCATED; } } } @@ -895,11 +895,11 @@ common::ErrorCode ValueParserForText::ParseTime(const BString &rcs, RCDateTime & hour += add_hours; EatWhiteSigns(buf, buflen); - if (sdbrc != common::ErrorCode::SUCCESS || buflen != 0) sdbrc = common::ErrorCode::VALUE_TRUNCATED; + if (tianmu_rc != common::ErrorCode::SUCCESS || buflen != 0) tianmu_rc = common::ErrorCode::VALUE_TRUNCATED; - if (RCDateTime::IsCorrectSDBTime(short(hour * sign), short(minute * sign), short(second * sign))) { + if (RCDateTime::IsCorrectTIANMUTime(short(hour * sign), short(minute * sign), short(second * sign))) { rcv = RCDateTime(short(hour * sign), short(minute * sign), short(second * sign), common::CT::TIME); - return sdbrc; + return tianmu_rc; } else { if (hour * sign < -RC_TIME_MIN.Hour()) rcv = RCDateTime(RC_TIME_MIN); @@ -913,8 +913,8 @@ common::ErrorCode ValueParserForText::ParseTime(const BString &rcs, RCDateTime & } else { // e.g. 01:a... or 01::... only second is set if (buflen > 0 && *buf == ':') { // 01:: EatWhiteSigns(buf, buflen); - sdbrc = system::EatUInt(buf, buflen, tmp2); - if (sdbrc == common::ErrorCode::SUCCESS) { + tianmu_rc = system::EatUInt(buf, buflen, tmp2); + if (tianmu_rc == common::ErrorCode::SUCCESS) { hour = (int)second; if (!RCDateTime::CanBeSecond(tmp2)) { rcv = RCDateTime(RCDateTime::GetSpecialValue(common::CT::TIME)); @@ -924,7 +924,7 @@ common::ErrorCode ValueParserForText::ParseTime(const BString &rcs, RCDateTime & } } else return RCDateTime::Parse(second * sign, rcv, common::CT::TIME); - if (RCDateTime::IsCorrectSDBTime(short(hour * sign), short(minute * sign), short(second * sign))) { + if (RCDateTime::IsCorrectTIANMUTime(short(hour * sign), short(minute * sign), short(second * sign))) { rcv = RCDateTime(short(hour * sign), short(minute * sign), short(second * sign), common::CT::TIME); return common::ErrorCode::VALUE_TRUNCATED; } else { @@ -933,7 +933,7 @@ common::ErrorCode ValueParserForText::ParseTime(const BString &rcs, RCDateTime & } } } else { - if (RCDateTime::IsCorrectSDBTime(short(hour * sign), short(minute * sign), short(second * sign))) { + if (RCDateTime::IsCorrectTIANMUTime(short(hour * sign), short(minute * sign), short(second * sign))) { rcv = RCDateTime(short(hour * sign), short(minute * sign), short(second * sign), common::CT::TIME); return common::ErrorCode::VALUE_TRUNCATED; } else { @@ -964,11 +964,11 @@ common::ErrorCode ValueParserForText::ParseDate(const BString &rcs, RCDateTime & } uint year = 0, month = 0, day = 0; - common::ErrorCode sdbrc = system::EatUInt(buf, buflen, year); - if (sdbrc == common::ErrorCode::FAILED) { + common::ErrorCode tianmu_rc = system::EatUInt(buf, buflen, year); + if (tianmu_rc == common::ErrorCode::FAILED) { rcv = RCDateTime(RCDateTime::GetSpecialValue(common::CT::DATE)); return common::ErrorCode::VALUE_TRUNCATED; - } else if (sdbrc != common::ErrorCode::OUT_OF_RANGE && buflen > 0) { + } else if (tianmu_rc != common::ErrorCode::OUT_OF_RANGE && buflen > 0) { year = RCDateTime::ToCorrectYear(year, common::CT::DATE); } @@ -1024,8 +1024,8 @@ common::ErrorCode ValueParserForText::ParseYear(const BString &rcs, RCDateTime & } uint year = 0; int tmp_buf_len = buflen; - common::ErrorCode sdbrc = system::EatUInt(buf, buflen, year); - if (sdbrc != common::ErrorCode::SUCCESS) { + common::ErrorCode tianmu_rc = system::EatUInt(buf, buflen, year); + if (tianmu_rc != common::ErrorCode::SUCCESS) { rcv = RCDateTime(RCDateTime::GetSpecialValue(common::CT::YEAR)); return common::ErrorCode::VALUE_TRUNCATED; } else if (year == 0 && (tmp_buf_len - buflen) < 4) { @@ -1034,7 +1034,7 @@ common::ErrorCode ValueParserForText::ParseYear(const BString &rcs, RCDateTime & year = RCDateTime::ToCorrectYear(year, common::CT::YEAR); } - if (RCDateTime::IsCorrectSDBYear(year)) { + if (RCDateTime::IsCorrectTIANMUYear(year)) { EatWhiteSigns(buf, buflen); rcv = RCDateTime(year); if (buflen) return common::ErrorCode::OUT_OF_RANGE; @@ -1068,4 +1068,4 @@ common::ErrorCode ValueParserForText::ParseDateTimeAdapter(BString const &rcs, i return return_code; } } // namespace types -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/types/value_parser4txt.h b/storage/tianmu/types/value_parser4txt.h similarity index 92% rename from storage/stonedb/types/value_parser4txt.h rename to storage/tianmu/types/value_parser4txt.h index 0b4496e9da..aa69025218 100644 --- a/storage/stonedb/types/value_parser4txt.h +++ b/storage/tianmu/types/value_parser4txt.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_TYPES_VALUE_PARSER4TXT_H_ -#define STONEDB_TYPES_VALUE_PARSER4TXT_H_ +#ifndef TIANMU_TYPES_VALUE_PARSER4TXT_H_ +#define TIANMU_TYPES_VALUE_PARSER4TXT_H_ #pragma once #include "common/assert.h" @@ -23,7 +23,7 @@ #include "core/rc_attr_typeinfo.h" #include "types/rc_data_types.h" -namespace stonedb { +namespace Tianmu { namespace types { class ValueParserForText { public: @@ -53,7 +53,7 @@ class ValueParserForText { return std::bind(&ParseDateTimeAdapter, std::placeholders::_1, std::placeholders::_2, at.Type()); default: - STONEDB_ERROR("type not supported:" + std::to_string(static_cast(at.Type()))); + TIANMU_ERROR("type not supported:" + std::to_string(static_cast(at.Type()))); break; } return NULL; @@ -78,6 +78,6 @@ class ValueParserForText { }; } // namespace types -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_TYPES_VALUE_PARSER4TXT_H_ +#endif // TIANMU_TYPES_VALUE_PARSER4TXT_H_ diff --git a/storage/stonedb/util/bitset.h b/storage/tianmu/util/bitset.h similarity index 92% rename from storage/stonedb/util/bitset.h rename to storage/tianmu/util/bitset.h index 4e9f053914..9a99f5e549 100644 --- a/storage/stonedb/util/bitset.h +++ b/storage/tianmu/util/bitset.h @@ -14,11 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_UTIL_BITSET_H_ -#define STONEDB_UTIL_BITSET_H_ +#ifndef TIANMU_UTIL_BITSET_H_ +#define TIANMU_UTIL_BITSET_H_ #pragma once -namespace stonedb { +namespace Tianmu { namespace utils { class BitSet { @@ -55,6 +55,6 @@ class BitSet { }; } // namespace utils -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_UTIL_BITSET_H_ +#endif // TIANMU_UTIL_BITSET_H_ diff --git a/storage/stonedb/util/circ_buf.h b/storage/tianmu/util/circ_buf.h similarity index 91% rename from storage/stonedb/util/circ_buf.h rename to storage/tianmu/util/circ_buf.h index 3557e20f7a..6a35f4cd9d 100644 --- a/storage/stonedb/util/circ_buf.h +++ b/storage/tianmu/util/circ_buf.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_UTIL_CIRC_BUF_H_ -#define STONEDB_UTIL_CIRC_BUF_H_ +#ifndef TIANMU_UTIL_CIRC_BUF_H_ +#define TIANMU_UTIL_CIRC_BUF_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace utils { template @@ -72,6 +72,6 @@ class FixedSizeBuffer { }; } // namespace utils -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_UTIL_CIRC_BUF_H_ +#endif // TIANMU_UTIL_CIRC_BUF_H_ diff --git a/storage/stonedb/util/fs.h b/storage/tianmu/util/fs.h similarity index 87% rename from storage/stonedb/util/fs.h rename to storage/tianmu/util/fs.h index 5360da8c68..92941003a2 100644 --- a/storage/stonedb/util/fs.h +++ b/storage/tianmu/util/fs.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_UTIL_FS_H_ -#define STONEDB_UTIL_FS_H_ +#ifndef TIANMU_UTIL_FS_H_ +#define TIANMU_UTIL_FS_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace fs = std::experimental::filesystem; -} //namespace stonedb +} //namespace Tianmu -#endif // STONEDB_UTIL_FS_H_ +#endif // TIANMU_UTIL_FS_H_ diff --git a/storage/stonedb/util/hash64.h b/storage/tianmu/util/hash64.h similarity index 95% rename from storage/stonedb/util/hash64.h rename to storage/tianmu/util/hash64.h index fb2669b9fe..dba42bc88c 100644 --- a/storage/stonedb/util/hash64.h +++ b/storage/tianmu/util/hash64.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_UTIL_HASH64_H_ -#define STONEDB_UTIL_HASH64_H_ +#ifndef TIANMU_UTIL_HASH64_H_ +#define TIANMU_UTIL_HASH64_H_ #pragma once #include #include -namespace stonedb { +namespace Tianmu { namespace utils { // Easy hash set for 64-bit values @@ -124,6 +124,6 @@ class Hash64 final { }; } // namespace utils -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_UTIL_HASH64_H_ +#endif // TIANMU_UTIL_HASH64_H_ diff --git a/storage/stonedb/util/log_ctl.cpp b/storage/tianmu/util/log_ctl.cpp similarity index 70% rename from storage/stonedb/util/log_ctl.cpp rename to storage/tianmu/util/log_ctl.cpp index a30c3f4417..59ec9df3e1 100644 --- a/storage/stonedb/util/log_ctl.cpp +++ b/storage/tianmu/util/log_ctl.cpp @@ -22,7 +22,7 @@ #include "system/file_out.h" #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace logger { // NOTICE: the order must be align with enum LogCtl_Level @@ -31,21 +31,21 @@ static const char *level_str[] = {"", "LogCtl_Level::FATAL", "ERROR", "WARN", "I static const char *get_level_str(LogCtl_Level level) { return level_str[static_cast(level)]; } } // namespace logger -static system::Channel stonedblog(true); +static system::Channel tianmulog(true); -void log_setup(const std::string &log_file) { stonedblog.addOutput(new system::FileOut(log_file)); } +void log_setup(const std::string &log_file) { tianmulog.addOutput(new system::FileOut(log_file)); } namespace utils { logger::LogCtl_Level LogCtl::GetSessionLevel() { if (current_tx == nullptr) { - stonedblog << system::lock << "ERROR" << __PRETTY_FUNCTION__ << " current_tx invalid" << system::unlock; + tianmulog << system::lock << "ERROR" << __PRETTY_FUNCTION__ << " current_tx invalid" << system::unlock; return logger::LogCtl_Level::DISABLED; } return static_cast(current_tx->DebugLevel()); } logger::LogCtl_Level LogCtl::GetGlobalLevel() { - return static_cast(stonedb_sysvar_global_debug_level); + return static_cast(tianmu_sysvar_global_debug_level); } bool LogCtl::LogEnabled(logger::LogCtl_Level level) { @@ -53,12 +53,12 @@ bool LogCtl::LogEnabled(logger::LogCtl_Level level) { // a fix is available. #if 0 if (current_tx == nullptr) { - //the session is not setup, will use stonedb_sysvar_global_debug_level only - return (stonedb_sysvar_global_debug_level >= level); + //the session is not setup, will use tianmu_sysvar_global_debug_level only + return (tianmu_sysvar_global_debug_level >= level); } - return ((current_tx->DebugLevel() >= level ) || (stonedb_sysvar_global_debug_level >= level)); + return ((current_tx->DebugLevel() >= level ) || (tianmu_sysvar_global_debug_level >= level)); #else - return stonedb_sysvar_global_debug_level >= static_cast(level); + return tianmu_sysvar_global_debug_level >= static_cast(level); #endif } @@ -71,7 +71,7 @@ void LogCtl::LogMsg(logger::LogCtl_Level level, const char *file, int line, cons auto length = std::vsnprintf(buff, sizeof(buff), format, args); if (static_cast(length) >= MAX_LOG_LEN) length = MAX_LOG_LEN - 1; buff[length] = '\0'; - stonedblog << system::lock << "[" << logger::get_level_str(level) << "] [" << basename(file) << ":" << line + tianmulog << system::lock << "[" << logger::get_level_str(level) << "] [" << basename(file) << ":" << line << "] MSG: " << buff << system::unlock; va_end(args); } @@ -79,32 +79,32 @@ void LogCtl::LogMsg(logger::LogCtl_Level level, const char *file, int line, cons void LogCtl::LogMsg(logger::LogCtl_Level level, const std::string &msg) { if (LogEnabled(level)) { - stonedblog << system::lock << logger::get_level_str(level) << " MSG: " << msg << system::unlock; + tianmulog << system::lock << logger::get_level_str(level) << " MSG: " << msg << system::unlock; } } void LogCtl::LogMsg(logger::LogCtl_Level level, const char *file, int line, const std::string &msg) { if (LogEnabled(level)) { - stonedblog << system::lock << "[" << logger::get_level_str(level) << "] [" << basename(file) << ":" << line + tianmulog << system::lock << "[" << logger::get_level_str(level) << "] [" << basename(file) << ":" << line << "] MSG: " << msg << system::unlock; } } void LogCtl::LogMsg(logger::LogCtl_Level level, std::stringstream &msg_ss) { if (LogEnabled(level)) { - stonedblog << system::lock << logger::get_level_str(level) << " MSG: " << msg_ss.str() << system::unlock; + tianmulog << system::lock << logger::get_level_str(level) << " MSG: " << msg_ss.str() << system::unlock; // NOTICE: will reset stringstream here msg_ss.str(""); } } } // namespace utils -} // namespace stonedb +} // namespace Tianmu -void stonedb_log(enum loglevel mysql_level, const char *buffer, [[maybe_unused]] size_t length) { - using namespace stonedb; +void tianmu_log(enum loglevel mysql_level, const char *buffer, [[maybe_unused]] size_t length) { + using namespace Tianmu; logger::LogCtl_Level level; - // mapping mysql log level to stonedb log level + // mapping mysql log level to tianmu log level switch (mysql_level) { case ERROR_LEVEL: level = logger::LogCtl_Level::ERROR; diff --git a/storage/stonedb/util/log_ctl.h b/storage/tianmu/util/log_ctl.h similarity index 78% rename from storage/stonedb/util/log_ctl.h rename to storage/tianmu/util/log_ctl.h index 4d73a91c2b..1c44a41e52 100644 --- a/storage/stonedb/util/log_ctl.h +++ b/storage/tianmu/util/log_ctl.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_UTIL_LOG_CTL_H_ -#define STONEDB_UTIL_LOG_CTL_H_ +#ifndef TIANMU_UTIL_LOG_CTL_H_ +#define TIANMU_UTIL_LOG_CTL_H_ #pragma once #include -namespace stonedb { +namespace Tianmu { namespace logger { enum class LogCtl_Level { DISABLED = 0, FATAL = 1, ERROR = 2, WARN = 3, INFO = 4, DEBUG = 5, TRACE = 6 }; @@ -45,14 +45,14 @@ class LogCtl { constexpr size_t MAX_LOG_LEN = 4096; -// StoneDB logger API -#define STONEDB_LOG(_level, ...) stonedb::utils::LogCtl::LogMsg(logger::_level, __FILE__, __LINE__, ##__VA_ARGS__) +// Tianmu logger API +#define TIANMU_LOG(_level, ...) Tianmu::utils::LogCtl::LogMsg(logger::_level, __FILE__, __LINE__, ##__VA_ARGS__) -#define STONEDB_LOGCHECK(_level) (stonedb::utils::LogCtl::LogEnabled(logger::_level)) -#define LOG_MSG(_level, msg) stonedb::utils::LogCtl::LogMsg(logger::_level, __FILE__, __LINE__, msg); +#define TIANMU_LOGCHECK(_level) (Tianmu::utils::LogCtl::LogEnabled(logger::_level)) +#define LOG_MSG(_level, msg) Tianmu::utils::LogCtl::LogMsg(logger::_level, __FILE__, __LINE__, msg); void log_setup(const std::string &log_file); -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_UTIL_LOG_CTL_H_ +#endif // TIANMU_UTIL_LOG_CTL_H_ diff --git a/storage/stonedb/util/mapped_circular_buffer.h b/storage/tianmu/util/mapped_circular_buffer.h similarity index 92% rename from storage/stonedb/util/mapped_circular_buffer.h rename to storage/tianmu/util/mapped_circular_buffer.h index 31da8b4246..6afdcaa77e 100644 --- a/storage/stonedb/util/mapped_circular_buffer.h +++ b/storage/tianmu/util/mapped_circular_buffer.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_UTIL_MAPPED_CIRCULAR_BUFFER_H_ -#define STONEDB_UTIL_MAPPED_CIRCULAR_BUFFER_H_ +#ifndef TIANMU_UTIL_MAPPED_CIRCULAR_BUFFER_H_ +#define TIANMU_UTIL_MAPPED_CIRCULAR_BUFFER_H_ #pragma once #include @@ -31,7 +31,7 @@ #include "util/log_ctl.h" -namespace stonedb { +namespace Tianmu { namespace utils { // a memory-mapped circular buffer, support single-read, multiple write @@ -72,19 +72,19 @@ class MappedCircularBuffer { throw std::invalid_argument("failed to truncate " + file + ". error " + std::to_string(errno) + ": " + std::strerror(errno)); } - STONEDB_LOG(LogCtl_Level::INFO, "created delayed buffer file %s with size %ldMB", file.c_str(), buf_size_ / 1_MB); + TIANMU_LOG(LogCtl_Level::INFO, "created delayed buffer file %s with size %ldMB", file.c_str(), buf_size_ / 1_MB); } else { // file already exists if (sb.st_size == static_cast(FileSize())) { file_exists = true; - STONEDB_LOG(LogCtl_Level::INFO, "use delayed buffer file %s with size %ldMB", file.c_str(), buf_size_ / 1_MB); + TIANMU_LOG(LogCtl_Level::INFO, "use delayed buffer file %s with size %ldMB", file.c_str(), buf_size_ / 1_MB); } else { // for now just drop the old file. if (::ftruncate(fd_, 0) == -1 || ::ftruncate(fd_, FileSize()) == -1) { throw std::invalid_argument("failed to truncate " + file + ". error " + std::to_string(errno) + ": " + std::strerror(errno)); } - STONEDB_LOG(LogCtl_Level::WARN, "old buffer file (size %ldM) purged!!! ", sb.st_size / 1_MB); + TIANMU_LOG(LogCtl_Level::WARN, "old buffer file (size %ldM) purged!!! ", sb.st_size / 1_MB); } } MapFile(file); @@ -208,7 +208,7 @@ class MappedCircularBuffer { throw std::runtime_error("failed to mmap file " + file + ". error " + std::to_string(errno) + ": " + std::strerror(errno)); } - STONEDB_LOG(LogCtl_Level::INFO, "insert buffer address %p", start_addr_); + TIANMU_LOG(LogCtl_Level::INFO, "insert buffer address %p", start_addr_); } void GetStat() { @@ -248,7 +248,7 @@ class MappedCircularBuffer { stat.write_cnt = cnt; } - const static uint64_t current_version = 0x31765348; // "STONEDBv1" + const static uint64_t current_version = 0x31765348; // "TIANMUv1" struct header { uint64_t version; @@ -273,6 +273,6 @@ class MappedCircularBuffer { }; } // namespace utils -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_UTIL_MAPPED_CIRCULAR_BUFFER_H_ +#endif // TIANMU_UTIL_MAPPED_CIRCULAR_BUFFER_H_ diff --git a/storage/stonedb/util/qsort.h b/storage/tianmu/util/qsort.h similarity index 74% rename from storage/stonedb/util/qsort.h rename to storage/tianmu/util/qsort.h index 6daa8261c1..a64a6d3888 100644 --- a/storage/stonedb/util/qsort.h +++ b/storage/tianmu/util/qsort.h @@ -14,13 +14,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_UTIL_QSORT_H_ -#define STONEDB_UTIL_QSORT_H_ +#ifndef TIANMU_UTIL_QSORT_H_ +#define TIANMU_UTIL_QSORT_H_ #pragma once -using comp_func_sdb = int (*)(const void *, const void *); +using comp_func_tianmu = int (*)(const void *, const void *); -inline void __sdb_swap_local(char *a, char *b, int len) { +inline void __tianmu_swap_local(char *a, char *b, int len) { for (int j = 0; j < len; j++) { char t = a[j]; a[j] = b[j]; @@ -28,7 +28,7 @@ inline void __sdb_swap_local(char *a, char *b, int len) { } } -static void __bubble_sort(char *b, int lo, int hi, int s, comp_func_sdb cmpsrt) { +static void __bubble_sort(char *b, int lo, int hi, int s, comp_func_tianmu cmpsrt) { bool swapped = true; int i; @@ -37,7 +37,7 @@ static void __bubble_sort(char *b, int lo, int hi, int s, comp_func_sdb cmpsrt) swapped = false; for (i = lo; i < hi; i++) { if (cmpsrt((void *)(b + i * s), (void *)(b + (i + 1) * s)) > 0) { - __sdb_swap_local(b + i * s, b + (i + 1) * s, s); + __tianmu_swap_local(b + i * s, b + (i + 1) * s, s); swapped = true; } } @@ -51,7 +51,7 @@ static void __bubble_sort(char *b, int lo, int hi, int s, comp_func_sdb cmpsrt) for (i = hi; i > lo; i--) { if (cmpsrt((void *)(b + i * s), (void *)(b + (i - 1) * s)) < 0) { - __sdb_swap_local(b + i * s, b + (i - 1) * s, s); + __tianmu_swap_local(b + i * s, b + (i - 1) * s, s); swapped = true; } } @@ -61,7 +61,7 @@ static void __bubble_sort(char *b, int lo, int hi, int s, comp_func_sdb cmpsrt) constexpr int PIVOT_SIZE = 32; -static void __quicksort_sdb(char *b, int lo, int hi, int s, comp_func_sdb cmpsrt, int call_seq) { +static void __quicksort_tianmu(char *b, int lo, int hi, int s, comp_func_tianmu cmpsrt, int call_seq) { if (call_seq > 8192) { __bubble_sort(b, lo, hi, s, cmpsrt); return; @@ -95,7 +95,7 @@ static void __quicksort_sdb(char *b, int lo, int hi, int s, comp_func_sdb cmpsrt jj -= s; }; if (i <= j) { - __sdb_swap_local(b + ii, b + jj, s); + __tianmu_swap_local(b + ii, b + jj, s); i++; ii += s; j--; @@ -103,13 +103,13 @@ static void __quicksort_sdb(char *b, int lo, int hi, int s, comp_func_sdb cmpsrt } } - if (lo < j) __quicksort_sdb(b, lo, j, s, cmpsrt, call_seq + 1); - if (i < hi) __quicksort_sdb(b, i, hi, s, cmpsrt, call_seq + 1); + if (lo < j) __quicksort_tianmu(b, lo, j, s, cmpsrt, call_seq + 1); + if (i < hi) __quicksort_tianmu(b, i, hi, s, cmpsrt, call_seq + 1); if (s > PIVOT_SIZE) free(pivot); } // buf, total elements, element size, compare function -static void qsort_sdb(void *b, int l, int s, comp_func_sdb cmpsrt) { __quicksort_sdb((char *)b, 0, l - 1, s, cmpsrt, 0); } +static void qsort_tianmu(void *b, int l, int s, comp_func_tianmu cmpsrt) { __quicksort_tianmu((char *)b, 0, l - 1, s, cmpsrt, 0); } -#endif // STONEDB_UTIL_QSORT_H_ +#endif // TIANMU_UTIL_QSORT_H_ diff --git a/storage/stonedb/util/stack_trace.cpp b/storage/tianmu/util/stack_trace.cpp similarity index 97% rename from storage/stonedb/util/stack_trace.cpp rename to storage/tianmu/util/stack_trace.cpp index a245cd4c2e..3367b9597d 100644 --- a/storage/stonedb/util/stack_trace.cpp +++ b/storage/tianmu/util/stack_trace.cpp @@ -21,7 +21,7 @@ #include "stack_trace.h" -namespace stonedb { +namespace Tianmu { namespace utils { // this function may modify the string pointed by name!!! static inline bool DemangelSymbol(char *name, std::string &result) { @@ -82,4 +82,4 @@ bool GetStackTrace(std::vector &v, int skip_level, bool demangle) { return true; } } // namespace utils -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/util/stack_trace.h b/storage/tianmu/util/stack_trace.h similarity index 85% rename from storage/stonedb/util/stack_trace.h rename to storage/tianmu/util/stack_trace.h index 65b2c6c886..f43619cbfc 100644 --- a/storage/stonedb/util/stack_trace.h +++ b/storage/tianmu/util/stack_trace.h @@ -14,19 +14,19 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_UTIL_STACK_TRACE_H_ -#define STONEDB_UTIL_STACK_TRACE_H_ +#ifndef TIANMU_UTIL_STACK_TRACE_H_ +#define TIANMU_UTIL_STACK_TRACE_H_ #pragma once #include #include -namespace stonedb { +namespace Tianmu { namespace utils { bool GetStackTrace(std::vector &v, int skip_level = 1, bool demangle = true); } // namespace utils -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_UTIL_STACK_TRACE_H_ +#endif // TIANMU_UTIL_STACK_TRACE_H_ diff --git a/storage/stonedb/util/thread_pool.cpp b/storage/tianmu/util/thread_pool.cpp similarity index 95% rename from storage/stonedb/util/thread_pool.cpp rename to storage/tianmu/util/thread_pool.cpp index 999aef6dfe..60c94d5d9a 100644 --- a/storage/stonedb/util/thread_pool.cpp +++ b/storage/tianmu/util/thread_pool.cpp @@ -17,10 +17,10 @@ #include "util/thread_pool.h" -namespace stonedb { +namespace Tianmu { namespace utils { thread_local thread_pool *thread_pool::tp_owner_; } // namespace utils -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/util/thread_pool.h b/storage/tianmu/util/thread_pool.h similarity index 92% rename from storage/stonedb/util/thread_pool.h rename to storage/tianmu/util/thread_pool.h index c72eb8f9ba..14cd1debfc 100644 --- a/storage/stonedb/util/thread_pool.h +++ b/storage/tianmu/util/thread_pool.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_UTIL_THREAD_POOL_H_ -#define STONEDB_UTIL_THREAD_POOL_H_ +#ifndef TIANMU_UTIL_THREAD_POOL_H_ +#define TIANMU_UTIL_THREAD_POOL_H_ #pragma once #include @@ -31,7 +31,7 @@ #include "common/exception.h" #include "util/log_ctl.h" -namespace stonedb { +namespace Tianmu { namespace utils { class thread_pool final { @@ -124,10 +124,10 @@ class result_set final { result.get(); } catch (std::exception &e) { no_except = false; - STONEDB_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); + TIANMU_LOG(LogCtl_Level::ERROR, "An exception is caught: %s", e.what()); } catch (...) { no_except = false; - STONEDB_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); + TIANMU_LOG(LogCtl_Level::ERROR, "An unknown system exception error caught."); } if (!no_except) { throw common::Exception("Parallel worker run failed."); @@ -139,6 +139,6 @@ class result_set final { }; } // namespace utils -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_UTIL_THREAD_POOL_H_ +#endif // TIANMU_UTIL_THREAD_POOL_H_ diff --git a/storage/stonedb/util/timer.cpp b/storage/tianmu/util/timer.cpp similarity index 88% rename from storage/stonedb/util/timer.cpp rename to storage/tianmu/util/timer.cpp index de6dd222b8..e3c1305b5f 100644 --- a/storage/stonedb/util/timer.cpp +++ b/storage/tianmu/util/timer.cpp @@ -19,14 +19,14 @@ #include "system/rc_system.h" -namespace stonedb { +namespace Tianmu { namespace utils { void Timer::DoPrint(const std::string &msg) const { using namespace std::chrono; auto diff = duration_cast>(high_resolution_clock::now() - start_); - STONEDB_LOG(LogCtl_Level::INFO, "Timer %f seconds: %s", diff.count(), msg.c_str()); + TIANMU_LOG(LogCtl_Level::INFO, "Timer %f seconds: %s", diff.count(), msg.c_str()); } } // namespace utils -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/util/timer.h b/storage/tianmu/util/timer.h similarity index 85% rename from storage/stonedb/util/timer.h rename to storage/tianmu/util/timer.h index 68b42e89af..5fc93245d4 100644 --- a/storage/stonedb/util/timer.h +++ b/storage/tianmu/util/timer.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_UTIL_TIMER_H_ -#define STONEDB_UTIL_TIMER_H_ +#ifndef TIANMU_UTIL_TIMER_H_ +#define TIANMU_UTIL_TIMER_H_ #pragma once #include @@ -23,7 +23,7 @@ #include "util/log_ctl.h" -namespace stonedb { +namespace Tianmu { namespace utils { class Timer { @@ -31,7 +31,7 @@ class Timer { Timer() = default; void Print(const std::string &msg) const { - if (STONEDB_LOGCHECK(LogCtl_Level::DEBUG)) DoPrint(msg); + if (TIANMU_LOGCHECK(LogCtl_Level::DEBUG)) DoPrint(msg); } private: @@ -41,6 +41,6 @@ class Timer { }; } // namespace utils -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_UTIL_TIMER_H_ +#endif // TIANMU_UTIL_TIMER_H_ diff --git a/storage/stonedb/vc/const_column.cpp b/storage/tianmu/vc/const_column.cpp similarity index 99% rename from storage/stonedb/vc/const_column.cpp rename to storage/tianmu/vc/const_column.cpp index 247dc60708..b7180386bc 100644 --- a/storage/stonedb/vc/const_column.cpp +++ b/storage/tianmu/vc/const_column.cpp @@ -22,7 +22,7 @@ #include "core/rc_attr.h" #include "core/transaction.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { ConstColumn::ConstColumn(core::ValueOrNull const &val, core::ColumnType const &c, bool shift_to_UTC) @@ -201,4 +201,4 @@ char *ConstColumn::ToString(char p_buf[], size_t buf_ct) const { } } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/vc/const_column.h b/storage/tianmu/vc/const_column.h similarity index 94% rename from storage/stonedb/vc/const_column.h rename to storage/tianmu/vc/const_column.h index c58bcba4c0..51720cbc55 100644 --- a/storage/stonedb/vc/const_column.h +++ b/storage/tianmu/vc/const_column.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_VC_CONST_COLUMN_H_ -#define STONEDB_VC_CONST_COLUMN_H_ +#ifndef TIANMU_VC_CONST_COLUMN_H_ +#define TIANMU_VC_CONST_COLUMN_H_ #pragma once #include "core/mi_updating_iterator.h" #include "core/pack_guardian.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { /*! \brief A column defined by an expression (including a subquery) or * encapsulating a PhysicalColumn ConstColumn is associated with an @@ -42,8 +42,8 @@ class ConstColumn : public VirtualColumn { ConstColumn(ConstColumn const &cc) : VirtualColumn(cc.ct, cc.mind), value(cc.value) {} ~ConstColumn() {} bool IsConst() const override { return true; } - const core::MysqlExpression::sdbfields_cache_t &GetSDBItems() const override { - static core::MysqlExpression::sdbfields_cache_t const dummy; + const core::MysqlExpression::tianmu_fields_cache_t &GetTIANMUItems() const override { + static core::MysqlExpression::tianmu_fields_cache_t const dummy; return dummy; } char *ToString(char p_buf[], size_t buf_ct) const override; @@ -105,6 +105,6 @@ class ConstColumn : public VirtualColumn { core::ValueOrNull value; }; } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_VC_CONST_COLUMN_H_ +#endif // TIANMU_VC_CONST_COLUMN_H_ diff --git a/storage/stonedb/vc/const_expr_column.cpp b/storage/tianmu/vc/const_expr_column.cpp similarity index 96% rename from storage/stonedb/vc/const_expr_column.cpp rename to storage/tianmu/vc/const_expr_column.cpp index 47fb74baf0..7bf10ca12b 100644 --- a/storage/stonedb/vc/const_expr_column.cpp +++ b/storage/tianmu/vc/const_expr_column.cpp @@ -21,14 +21,14 @@ #include "core/mysql_expression.h" #include "core/rc_attr.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { void ConstExpressionColumn::RequestEval([[maybe_unused]] const core::MIIterator &mit, [[maybe_unused]] const int tta) { first_eval = true; // TODO: check if parameters were changed before reeval - if (expr_->GetItem()->type() == core::Item_sdbfield::get_sdbitem_type()) { + if (expr_->GetItem()->type() == core::Item_tianmufield::get_tianmuitem_type()) { // a special case when a naked column is a parameter - last_val = std::make_shared(((core::Item_sdbfield *)(expr_->GetItem()))->GetCurrentValue()); + last_val = std::make_shared(((core::Item_tianmufield *)(expr_->GetItem()))->GetCurrentValue()); last_val->MakeStringOwner(); } else last_val = expr_->Evaluate(); @@ -141,4 +141,4 @@ types::BString ConstExpressionColumn::DecodeValue_S([[maybe_unused]] int64_t cod } } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/vc/const_expr_column.h b/storage/tianmu/vc/const_expr_column.h similarity index 97% rename from storage/stonedb/vc/const_expr_column.h rename to storage/tianmu/vc/const_expr_column.h index c09d32a2e8..26742b769f 100644 --- a/storage/stonedb/vc/const_expr_column.h +++ b/storage/tianmu/vc/const_expr_column.h @@ -14,15 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_VC_CONST_EXPR_COLUMN_H_ -#define STONEDB_VC_CONST_EXPR_COLUMN_H_ +#ifndef TIANMU_VC_CONST_EXPR_COLUMN_H_ +#define TIANMU_VC_CONST_EXPR_COLUMN_H_ #pragma once #include "core/mi_updating_iterator.h" #include "core/pack_guardian.h" #include "vc/expr_column.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { /*! \brief A column defined by an expression (including a subquery) or @@ -131,6 +131,6 @@ class ConstExpressionColumn : public ExpressionColumn { }; } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_VC_CONST_EXPR_COLUMN_H_ +#endif // TIANMU_VC_CONST_EXPR_COLUMN_H_ diff --git a/storage/stonedb/vc/expr_column.cpp b/storage/tianmu/vc/expr_column.cpp similarity index 99% rename from storage/stonedb/vc/expr_column.cpp rename to storage/tianmu/vc/expr_column.cpp index dc7be95897..81a0236e59 100644 --- a/storage/stonedb/vc/expr_column.cpp +++ b/storage/tianmu/vc/expr_column.cpp @@ -20,7 +20,7 @@ #include "core/mysql_expression.h" #include "core/rc_attr.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { ExpressionColumn::ExpressionColumn(core::MysqlExpression *expr, core::TempTable *temp_table, int temp_table_alias, core::MultiIndex *mind) @@ -284,4 +284,4 @@ void ExpressionColumn::LockSourcePacks(const core::MIIterator &mit) { VirtualColumn::LockSourcePacks(mit); } } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/vc/expr_column.h b/storage/tianmu/vc/expr_column.h similarity index 93% rename from storage/stonedb/vc/expr_column.h rename to storage/tianmu/vc/expr_column.h index c3897a50b7..47d50164bc 100644 --- a/storage/stonedb/vc/expr_column.h +++ b/storage/tianmu/vc/expr_column.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_VC_EXPR_COLUMN_H_ -#define STONEDB_VC_EXPR_COLUMN_H_ +#ifndef TIANMU_VC_EXPR_COLUMN_H_ +#define TIANMU_VC_EXPR_COLUMN_H_ #pragma once #include @@ -24,7 +24,7 @@ #include "core/pack_guardian.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { class TempTable; } @@ -61,7 +61,7 @@ class ExpressionColumn : public VirtualColumn { ExpressionColumn(const ExpressionColumn &); virtual ~ExpressionColumn() = default; - const core::MysqlExpression::sdbfields_cache_t &GetItems() const; + const core::MysqlExpression::tianmu_fields_cache_t &GetItems() const; void SetParamTypes(core::MysqlExpression::TypOfVars *types) override; bool IsConst() const override { return false; } bool IsDeterministic() override { return expr_->IsDeterministic(); } @@ -106,11 +106,11 @@ class ExpressionColumn : public VirtualColumn { void EvaluatePackImpl(core::MIUpdatingIterator &mit, core::Descriptor &) override; virtual common::ErrorCode EvaluateOnIndexImpl([[maybe_unused]] core::MIUpdatingIterator &mit, core::Descriptor &, [[maybe_unused]] int64_t limit) override { - STONEDB_ERROR("Common path shall be used in case of ExpressionColumn."); + TIANMU_ERROR("Common path shall be used in case of ExpressionColumn."); return common::ErrorCode::FAILED; } - const core::MysqlExpression::sdbfields_cache_t &GetSDBItems() const override { return expr_->GetSDBItems(); } + const core::MysqlExpression::tianmu_fields_cache_t &GetTIANMUItems() const override { return expr_->GetTIANMUItems(); } core::MysqlExpression *expr_; //!= NULL if ExpressionColumn encapsulates an expression. Note - a //! constant is an expression @@ -134,6 +134,6 @@ class ExpressionColumn : public VirtualColumn { bool deterministic_; }; } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_VC_EXPR_COLUMN_H_ +#endif // TIANMU_VC_EXPR_COLUMN_H_ diff --git a/storage/stonedb/vc/in_set_column.cpp b/storage/tianmu/vc/in_set_column.cpp similarity index 97% rename from storage/stonedb/vc/in_set_column.cpp rename to storage/tianmu/vc/in_set_column.cpp index daebd5f9bd..be6a5d5222 100644 --- a/storage/stonedb/vc/in_set_column.cpp +++ b/storage/tianmu/vc/in_set_column.cpp @@ -23,7 +23,7 @@ #include "vc/const_column.h" #include "vc/expr_column.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { InSetColumn::InSetColumn(core::ColumnType const &ct, core::MultiIndex *mind, std::vector const &columns_) @@ -38,8 +38,8 @@ InSetColumn::InSetColumn(core::ColumnType const &ct, core::MultiIndex *mind, for (auto &it : columns) { auto const &vm = it->GetVarMap(); uvms.insert(vm.begin(), vm.end()); - core::MysqlExpression::sdbfields_cache_t const &sdbfields_cache = it->GetSDBItems(); - sdbitems.insert(sdbfields_cache.begin(), sdbfields_cache.end()); + core::MysqlExpression::tianmu_fields_cache_t const &tianmu_fields_cache = it->GetTIANMUItems(); + tianmuitems.insert(tianmu_fields_cache.begin(), tianmu_fields_cache.end()); } std::vector(uvms.begin(), uvms.end()).swap(var_map); std::set dims; @@ -289,7 +289,7 @@ bool InSetColumn::CopyCondImpl(const core::MIIterator &mit, types::CondArray &co types::BString s; it->GetValueString(s, mit); if (s.IsNull()) { - STONEDB_LOG(LogCtl_Level::WARN, "DoCopyCond condition is NULL"); + TIANMU_LOG(LogCtl_Level::WARN, "DoCopyCond condition is NULL"); condition.clear(); success = false; break; @@ -316,4 +316,4 @@ bool InSetColumn::PrepareValueSet(const core::MIIterator &mit) { return true; } } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/vc/in_set_column.h b/storage/tianmu/vc/in_set_column.h similarity index 96% rename from storage/stonedb/vc/in_set_column.h rename to storage/tianmu/vc/in_set_column.h index d891a0267d..9636b01bb8 100644 --- a/storage/stonedb/vc/in_set_column.h +++ b/storage/tianmu/vc/in_set_column.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_VC_IN_SET_COLUMN_H_ -#define STONEDB_VC_IN_SET_COLUMN_H_ +#ifndef TIANMU_VC_IN_SET_COLUMN_H_ +#define TIANMU_VC_IN_SET_COLUMN_H_ #pragma once #include "core/mi_updating_iterator.h" @@ -24,7 +24,7 @@ #include "core/value_set.h" #include "vc/multi_value_column.h" -namespace stonedb { +namespace Tianmu { namespace core { class MysqlExpression; } // namespace core @@ -160,11 +160,11 @@ class InSetColumn : public MultiValColumn { virtual common::ErrorCode EvaluateOnIndexImpl([[maybe_unused]] core::MIUpdatingIterator &mit, [[maybe_unused]] core::Descriptor &desc, [[maybe_unused]] int64_t limit) override { - STONEDB_ERROR("To be implemented."); + TIANMU_ERROR("To be implemented."); return common::ErrorCode::FAILED; } - const core::MysqlExpression::sdbfields_cache_t &GetSDBItems() const override { return sdbitems; } + const core::MysqlExpression::tianmu_fields_cache_t &GetTIANMUItems() const override { return tianmuitems; } bool CopyCondImpl(const core::MIIterator &mit, types::CondArray &condition, DTCollation coll) override; bool CopyCondImpl(const core::MIIterator &mit, std::shared_ptr &condition, DTCollation coll) override; @@ -179,6 +179,6 @@ class InSetColumn : public MultiValColumn { }; } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_VC_IN_SET_COLUMN_H_ +#endif // TIANMU_VC_IN_SET_COLUMN_H_ diff --git a/storage/stonedb/vc/multi_value_column.h b/storage/tianmu/vc/multi_value_column.h similarity index 96% rename from storage/stonedb/vc/multi_value_column.h rename to storage/tianmu/vc/multi_value_column.h index 5151ff11aa..64283f97ae 100644 --- a/storage/stonedb/vc/multi_value_column.h +++ b/storage/tianmu/vc/multi_value_column.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_VC_MULTI_VALUE_COLUMN_H_ -#define STONEDB_VC_MULTI_VALUE_COLUMN_H_ +#ifndef TIANMU_VC_MULTI_VALUE_COLUMN_H_ +#define TIANMU_VC_MULTI_VALUE_COLUMN_H_ #pragma once #include "core/mi_updating_iterator.h" @@ -23,7 +23,7 @@ #include "types/rc_num.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace core { class MysqlExpression; } @@ -136,7 +136,7 @@ class MultiValColumn : public VirtualColumn { * \param expressions - a STL container of core::MysqlExpression*. */ MultiValColumn(core::ColumnType const &ct, core::MultiIndex *mind) : VirtualColumn(ct, mind) {} - MultiValColumn(const MultiValColumn &c) : VirtualColumn(c) { sdbitems = c.sdbitems; } + MultiValColumn(const MultiValColumn &c) : VirtualColumn(c) { tianmuitems = c.tianmuitems; } virtual ~MultiValColumn() {} bool IsMultival() const override { return true; } @@ -241,9 +241,9 @@ class MultiValColumn : public VirtualColumn { } // even copies refer to the same core::TempTable and core::TempTable cannot // be used in parallel due to Attr paging bool IsThreadSafe() override { return false; } - core::MysqlExpression::sdbfields_cache_t sdbitems; // items used in mysqlExpressions + core::MysqlExpression::tianmu_fields_cache_t tianmuitems; // items used in mysqlExpressions }; } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_VC_MULTI_VALUE_COLUMN_H_ +#endif // TIANMU_VC_MULTI_VALUE_COLUMN_H_ diff --git a/storage/stonedb/vc/single_column.cpp b/storage/tianmu/vc/single_column.cpp similarity index 99% rename from storage/stonedb/vc/single_column.cpp rename to storage/tianmu/vc/single_column.cpp index 06b91ffeb8..e9a5daa71a 100644 --- a/storage/stonedb/vc/single_column.cpp +++ b/storage/tianmu/vc/single_column.cpp @@ -21,7 +21,7 @@ #include "core/mysql_expression.h" #include "core/rc_attr.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { SingleColumn::SingleColumn(core::PhysicalColumn *col, core::MultiIndex *mind, int alias, int col_no, core::JustATable *source_table, int d) @@ -191,4 +191,4 @@ char *SingleColumn::ToString(char p_buf[], size_t buf_ct) const { return p_buf; } } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/vc/single_column.h b/storage/tianmu/vc/single_column.h similarity index 95% rename from storage/stonedb/vc/single_column.h rename to storage/tianmu/vc/single_column.h index 8467e2ea0b..142ab57009 100644 --- a/storage/stonedb/vc/single_column.h +++ b/storage/tianmu/vc/single_column.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_VC_SINGLE_COLUMN_H_ -#define STONEDB_VC_SINGLE_COLUMN_H_ +#ifndef TIANMU_VC_SINGLE_COLUMN_H_ +#define TIANMU_VC_SINGLE_COLUMN_H_ #pragma once #include "core/mi_updating_iterator.h" @@ -23,7 +23,7 @@ #include "core/physical_column.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { /*! \brief A column defined by an expression (including a subquery) or * encapsulating a PhysicalColumn SingleColumn is associated with an @@ -130,8 +130,8 @@ class SingleColumn : public VirtualColumn { int EncodeValue_S(types::BString &v) override { return col_->EncodeValue_S(v); } std::vector GetListOfDistinctValues(core::MIIterator const &mit) override; void DisplayAttrStats() override; - const core::MysqlExpression::sdbfields_cache_t &GetSDBItems() const override { - static core::MysqlExpression::sdbfields_cache_t const dummy; + const core::MysqlExpression::tianmu_fields_cache_t &GetTIANMUItems() const override { + static core::MysqlExpression::tianmu_fields_cache_t const dummy; return dummy; } @@ -141,6 +141,6 @@ class SingleColumn : public VirtualColumn { // var_map[0].tab->GetColumn(var_map[0].col_ndx) }; } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_VC_SINGLE_COLUMN_H_ +#endif // TIANMU_VC_SINGLE_COLUMN_H_ diff --git a/storage/stonedb/vc/subselect_column.cpp b/storage/tianmu/vc/subselect_column.cpp similarity index 96% rename from storage/stonedb/vc/subselect_column.cpp rename to storage/tianmu/vc/subselect_column.cpp index 29ca457102..4831f88781 100644 --- a/storage/stonedb/vc/subselect_column.cpp +++ b/storage/tianmu/vc/subselect_column.cpp @@ -23,7 +23,7 @@ #include "core/value_set.h" #include "vc/const_column.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { SubSelectColumn::SubSelectColumn(core::TempTable *subq, core::MultiIndex *mind, core::TempTable *temp_table, @@ -48,14 +48,14 @@ SubSelectColumn::SubSelectColumn(core::TempTable *subq, core::MultiIndex *mind, for (uint i = 0; i < subq->NumOfVirtColumns(); i++) { core::MysqlExpression::SetOfVars params = subq->GetVirtualColumn(i)->GetParams(); all_params.insert(params.begin(), params.end()); - core::MysqlExpression::sdbfields_cache_t sdbfields = subq->GetVirtualColumn(i)->GetSDBItems(); - if (!sdbfields.empty()) { - for (auto &sdbfield : sdbfields) { - auto sdbitem = sdbitems.find(sdbfield.first); - if (sdbitem == sdbitems.end()) - sdbitems.insert(sdbfield); + core::MysqlExpression::tianmu_fields_cache_t tianmufields = subq->GetVirtualColumn(i)->GetTIANMUItems(); + if (!tianmufields.empty()) { + for (auto &tianmufield : tianmufields) { + auto tianmuitem = tianmuitems.find(tianmufield.first); + if (tianmuitem == tianmuitems.end()) + tianmuitems.insert(tianmufield); else { - sdbitem->second.insert(sdbfield.second.begin(), sdbfield.second.end()); + tianmuitem->second.insert(tianmufield.second.begin(), tianmufield.second.end()); } } } @@ -126,13 +126,13 @@ SubSelectColumn::~SubSelectColumn() { void SubSelectColumn::SetBufs(core::MysqlExpression::var_buf_t *bufs) { DEBUG_ASSERT(bufs); - for (auto &it : sdbitems) { + for (auto &it : tianmuitems) { auto buf_set = bufs->find(it.first); if (buf_set != bufs->end()) { - // for each sdbitem* in the set it->second put its buffer to buf_set.second - for (auto &sdbfield : it.second) { + // for each tianmuitem* in the set it->second put its buffer to buf_set.second + for (auto &tianmufield : it.second) { core::ValueOrNull *von; - sdbfield->SetBuf(von); + tianmufield->SetBuf(von); buf_set->second.push_back(core::MysqlExpression::value_or_null_info_t(core::ValueOrNull(), von)); } } @@ -555,7 +555,7 @@ bool SubSelectColumn::FeedArguments(const core::MIIterator &mit, bool for_rough) core::ValueOrNull v = iter.GetTabPtr()->GetComplexValue(mit[iter.dim], iter.col_ndx); auto cache = var_buf_for_rough.find(iter.var); v.MakeStringOwner(); - if (cache->second.empty()) { // empty if STONEDBexpression - feeding unnecessary + if (cache->second.empty()) { // empty if TIANMUexpression - feeding unnecessary bool ldiff = v != param_cache_for_rough[iter.var]; diff = diff || ldiff; if (ldiff) param_cache_for_rough[iter.var] = v; @@ -573,7 +573,7 @@ bool SubSelectColumn::FeedArguments(const core::MIIterator &mit, bool for_rough) core::ValueOrNull v = iter.GetTabPtr()->GetComplexValue(mit[iter.dim], iter.col_ndx); auto cache = var_buf_for_exact.find(iter.var); v.MakeStringOwner(); - if (cache->second.empty()) { // empty if STONEDBexpression - feeding unnecessary + if (cache->second.empty()) { // empty if TIANMUexpression - feeding unnecessary bool ldiff = v != param_cache_for_exact[iter.var]; diff = diff || ldiff; if (ldiff) param_cache_for_exact[iter.var] = v; @@ -611,4 +611,4 @@ bool SubSelectColumn::MakeParallelReady() { } } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/vc/subselect_column.h b/storage/tianmu/vc/subselect_column.h similarity index 96% rename from storage/stonedb/vc/subselect_column.h rename to storage/tianmu/vc/subselect_column.h index 2d6abd3a2c..728db0cbbf 100644 --- a/storage/stonedb/vc/subselect_column.h +++ b/storage/tianmu/vc/subselect_column.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_VC_SUBSELECT_COLUMN_H_ -#define STONEDB_VC_SUBSELECT_COLUMN_H_ +#ifndef TIANMU_VC_SUBSELECT_COLUMN_H_ +#define TIANMU_VC_SUBSELECT_COLUMN_H_ #pragma once #include "core/mi_updating_iterator.h" @@ -24,7 +24,7 @@ #include "core/temp_table.h" #include "vc/multi_value_column.h" -namespace stonedb { +namespace Tianmu { namespace core { class MysqlExpression; class ValueSet; @@ -66,7 +66,7 @@ class SubSelectColumn : public MultiValColumn { if (record[0].GetValueType() == types::ValueTypeEnum::NUMERIC_TYPE || record[0].GetValueType() == types::ValueTypeEnum::DATE_TIME_TYPE) return static_cast(record[0]); - STONEDB_ERROR("Bad cast in RCValueObject::RCNum&()"); + TIANMU_ERROR("Bad cast in RCValueObject::RCNum&()"); return static_cast(record[0]); } types::RCValueObject DoGetValue() const override { @@ -193,13 +193,13 @@ class SubSelectColumn : public MultiValColumn { virtual common::ErrorCode EvaluateOnIndexImpl([[maybe_unused]] core::MIUpdatingIterator &mit, [[maybe_unused]] core::Descriptor &desc, [[maybe_unused]] int64_t limit) override { - STONEDB_ERROR("To be implemented."); + TIANMU_ERROR("To be implemented."); return common::ErrorCode::FAILED; } bool FeedArguments(const core::MIIterator &mit, bool for_rough); - const core::MysqlExpression::sdbfields_cache_t &GetSDBItems() const override { return sdbitems; } + const core::MysqlExpression::tianmu_fields_cache_t &GetTIANMUItems() const override { return tianmuitems; } core::ColumnType expected_type_; std::map param_cache_for_exact; @@ -223,6 +223,6 @@ class SubSelectColumn : public MultiValColumn { }; } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_VC_SUBSELECT_COLUMN_H_ +#endif // TIANMU_VC_SUBSELECT_COLUMN_H_ diff --git a/storage/stonedb/vc/type_cast_column.cpp b/storage/tianmu/vc/type_cast_column.cpp similarity index 99% rename from storage/stonedb/vc/type_cast_column.cpp rename to storage/tianmu/vc/type_cast_column.cpp index c8e68c793a..420fc73e93 100644 --- a/storage/stonedb/vc/type_cast_column.cpp +++ b/storage/tianmu/vc/type_cast_column.cpp @@ -19,7 +19,7 @@ #include "core/transaction.h" #include "types/rc_num.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { TypeCastColumn::TypeCastColumn(VirtualColumn *from, core::ColumnType const &target_type) @@ -358,7 +358,7 @@ Num2DateTimeCastColumn::Num2DateTimeCastColumn(VirtualColumn *from, core::Column std::string s = "Incorrect datetime value: \'"; s += rcv.ToBString().ToString(); s += "\'"; - STONEDB_LOG(LogCtl_Level::WARN, "Num2DateTimeCast %s", s.c_str()); + TIANMU_LOG(LogCtl_Level::WARN, "Num2DateTimeCast %s", s.c_str()); } if (TypeName() == common::CT::TIMESTAMP) { // needs to convert value to UTC @@ -685,4 +685,4 @@ types::RCValueObject StringCastColumn::GetValueImpl(const core::MIIterator &mit, } } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/vc/type_cast_column.h b/storage/tianmu/vc/type_cast_column.h similarity index 97% rename from storage/stonedb/vc/type_cast_column.h rename to storage/tianmu/vc/type_cast_column.h index 4bfc84f56b..af58a8d0bc 100644 --- a/storage/stonedb/vc/type_cast_column.h +++ b/storage/tianmu/vc/type_cast_column.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_VC_TYPE_CAST_COLUMN_H_ -#define STONEDB_VC_TYPE_CAST_COLUMN_H_ +#ifndef TIANMU_VC_TYPE_CAST_COLUMN_H_ +#define TIANMU_VC_TYPE_CAST_COLUMN_H_ #pragma once #include "core/mi_iterator.h" #include "vc/virtual_column.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { class TypeCastColumn : public VirtualColumn { @@ -53,7 +53,7 @@ class TypeCastColumn : public VirtualColumn { bool IsParameterized() const override { return vc->IsParameterized(); } std::vector &GetVarMap() override { return vc->GetVarMap(); } bool IsTypeCastColumn() const override { return true; } - const core::MysqlExpression::sdbfields_cache_t &GetSDBItems() const override { return vc->GetSDBItems(); } + const core::MysqlExpression::tianmu_fields_cache_t &GetTIANMUItems() const override { return vc->GetTIANMUItems(); } bool CanCopy() const override { return vc->CanCopy(); } bool IsThreadSafe() override { return vc->IsThreadSafe(); } std::vector GetChildren() const override { return std::vector(1, vc); } @@ -228,6 +228,6 @@ class StringCastColumn : public TypeCastColumn { }; } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_VC_TYPE_CAST_COLUMN_H_ +#endif // TIANMU_VC_TYPE_CAST_COLUMN_H_ diff --git a/storage/stonedb/vc/virtual_column.h b/storage/tianmu/vc/virtual_column.h similarity index 92% rename from storage/stonedb/vc/virtual_column.h rename to storage/tianmu/vc/virtual_column.h index 9ec7075706..24e857dad2 100644 --- a/storage/stonedb/vc/virtual_column.h +++ b/storage/tianmu/vc/virtual_column.h @@ -14,14 +14,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_VC_VIRTUAL_COLUMN_H_ -#define STONEDB_VC_VIRTUAL_COLUMN_H_ +#ifndef TIANMU_VC_VIRTUAL_COLUMN_H_ +#define TIANMU_VC_VIRTUAL_COLUMN_H_ #pragma once #include "core/pack_guardian.h" #include "vc/virtual_column_base.h" -namespace stonedb { +namespace Tianmu { namespace core { class MIIterator; } // namespace core @@ -53,6 +53,6 @@ class VirtualColumn : public VirtualColumnBase { // TODO() extern vcolumn::VirtualColumn *CreateVCCopy(vcolumn::VirtualColumn *vc); -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_VC_VIRTUAL_COLUMN_H_ +#endif // TIANMU_VC_VIRTUAL_COLUMN_H_ diff --git a/storage/stonedb/vc/virtual_column_base.cpp b/storage/tianmu/vc/virtual_column_base.cpp similarity index 99% rename from storage/stonedb/vc/virtual_column_base.cpp rename to storage/tianmu/vc/virtual_column_base.cpp index 667212692b..51ee221649 100644 --- a/storage/stonedb/vc/virtual_column_base.cpp +++ b/storage/tianmu/vc/virtual_column_base.cpp @@ -23,7 +23,7 @@ #include "vc/in_set_column.h" #include "vc/subselect_column.h" -namespace stonedb { +namespace Tianmu { namespace vcolumn { VirtualColumnBase::VirtualColumnBase(core::ColumnType const &ct, core::MultiIndex *mind) : Column(ct), @@ -395,4 +395,4 @@ common::RSValue VirtualColumnBase::RoughCheckImpl(const core::MIIterator &mit, c } } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu diff --git a/storage/stonedb/vc/virtual_column_base.h b/storage/tianmu/vc/virtual_column_base.h similarity index 98% rename from storage/stonedb/vc/virtual_column_base.h rename to storage/tianmu/vc/virtual_column_base.h index 84358421b2..eb61f421e9 100644 --- a/storage/stonedb/vc/virtual_column_base.h +++ b/storage/tianmu/vc/virtual_column_base.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ -#ifndef STONEDB_VC_VIRTUAL_COLUMN_BASE_H_ -#define STONEDB_VC_VIRTUAL_COLUMN_BASE_H_ +#ifndef TIANMU_VC_VIRTUAL_COLUMN_BASE_H_ +#define TIANMU_VC_VIRTUAL_COLUMN_BASE_H_ #pragma once #include @@ -27,7 +27,7 @@ #include "core/pack_guardian.h" #include "types/text_stat.h" -namespace stonedb { +namespace Tianmu { namespace core { class MIIterator; class Descriptor; @@ -308,7 +308,7 @@ class VirtualColumnBase : public core::Column { */ virtual const core::MysqlExpression::SetOfVars &GetParams() const { return params; } //! \brief parameters were set, so reevaluation is necessary - //! \brief for STONEDBConstExpressions, get arguments according to mit and evaluate + //! \brief for TIANMUConstExpressions, get arguments according to mit and evaluate //! the evaluation in IBConstExpression i done only if requested by //! core::TempTable identified by tta virtual void RequestEval([[maybe_unused]] const core::MIIterator &mit, [[maybe_unused]] const int tta) { @@ -448,7 +448,7 @@ class VirtualColumnBase : public core::Column { bool IsFullConst() { return IsConst() && !IsParameterized(); } static bool IsConstExpression(core::MysqlExpression *expr, int temp_table_alias, const std::vector *aliases); - virtual const core::MysqlExpression::sdbfields_cache_t &GetSDBItems() const = 0; + virtual const core::MysqlExpression::tianmu_fields_cache_t &GetTIANMUItems() const = 0; virtual char *ToString(char p_buf[], [[maybe_unused]] size_t buf_ct) const { return p_buf; } /*! Must be called in constructor, and every time the VirtualColumn looses its @@ -539,6 +539,6 @@ class VirtualColumnBase : public core::Column { bool nulls_only; // only nulls are present }; } // namespace vcolumn -} // namespace stonedb +} // namespace Tianmu -#endif // STONEDB_VC_VIRTUAL_COLUMN_BASE_H_ +#endif // TIANMU_VC_VIRTUAL_COLUMN_BASE_H_ diff --git a/support-files/mysql-log-rotate.sh b/support-files/mysql-log-rotate.sh index bbc45c900e..e3b46c4051 100644 --- a/support-files/mysql-log-rotate.sh +++ b/support-files/mysql-log-rotate.sh @@ -37,7 +37,7 @@ fi endscript } -#STONEDB UPGRADE BEGIN +#TIANMU UPGRADE BEGIN @prefix@/log/query.log { notifempty daily diff --git a/testclients/mysql_client_fw.c b/testclients/mysql_client_fw.c index 4784257474..ecbe1571ee 100644 --- a/testclients/mysql_client_fw.c +++ b/testclients/mysql_client_fw.c @@ -1284,8 +1284,8 @@ and you are welcome to modify and redistribute it under the GPL license\n"); printf("Usage: %s [OPTIONS] [TESTNAME1 TESTNAME2...]\n", my_progname); my_print_help(client_test_long_options); //print_defaults("my", client_test_load_default_groups); - //STONEDB UPGRADE BEGIN - #if defined(STONEDB) + //TIANMU UPGRADE BEGIN + #if defined(TIANMU) print_defaults(MYSQL_CONFIG_NAME, client_test_load_default_groups); #else print_defaults("my", client_test_load_default_groups); @@ -1432,8 +1432,8 @@ int main(int argc, char **argv) exit(1); for (i= 0; i < argc; i++) original_argv[i]= strdup(argv[i]); -//STONEDB UPGRADE BEGIN - #if defined(STONEDB) +//TIANMU UPGRADE BEGIN + #if defined(TIANMU) if (load_defaults(MYSQL_CONFIG_NAME, client_test_load_default_groups, &argc, &argv)) #else if (load_defaults("my", client_test_load_default_groups, &argc, &argv)) diff --git a/testclients/mysql_client_test.c b/testclients/mysql_client_test.c index 00b59b4cf4..5173b044b1 100644 --- a/testclients/mysql_client_test.c +++ b/testclients/mysql_client_test.c @@ -7211,8 +7211,8 @@ static void test_embedded_start_stop() MY_INIT(argv[0]); /* Load the client defaults from the .cnf file[s]. */ -//STONEDB UPGRADE BEGIN -#if defined(STONEDB) +//TIANMU UPGRADE BEGIN +#if defined(TIANMU) if (load_defaults(MYSQL_CONFIG_NAME, client_test_load_default_groups, &argc, &argv)) #else if (load_defaults("my", client_test_load_default_groups, &argc, &argv)) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 0f6bd08a3d..1df945993b 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -63,7 +63,7 @@ const config = { if(locale !== 'en') { return `https://github.com/stoneatom/stonedb/edit/stonedb-5.7/website/i18n/${locale}/docusaurus-plugin-content-docs/current/${docPath}` } - return `https://github.com/stoneatom/stonedb/edit/stonedb-5.7/${versionDocsDirPath}/${docPath}` + return `https://github.com/stoneatom/stonedb/edit/stonedb-5.7/Docs/${docPath}` }, }, theme: { diff --git a/website/src/theme/MDXComponents/Image.tsx b/website/src/theme/MDXComponents/Image.tsx index 7397165645..bae6ecc8e1 100644 --- a/website/src/theme/MDXComponents/Image.tsx +++ b/website/src/theme/MDXComponents/Image.tsx @@ -1,18 +1,34 @@ import React from 'react'; -import {pipe, split, map, fromPairs, trim, isEmpty} from 'ramda'; +import {pipe, split, map, fromPairs, trim, isEmpty, is} from 'ramda'; import {Image, OmitText} from '@site/src/components'; import {modifyKeyName} from '@site/src/utils'; export default function MDXImage({className, alt, src, title, ...props}: any): JSX.Element { - const data = title && title.indexOf(':') >= 0 ? pipe( + const isCustomImg = title && title.indexOf(':') >= 0; + const data = isCustomImg ? pipe( split(','), map(split(':')), fromPairs, modifyKeyName(trim) )(title) : title ? {title} : {}; return ( - {alt} - {data.title} - + <> + { + isCustomImg ? ( + {alt} + {data.title} + + ) : ( + {alt} + ) + } + ) -} +} \ No newline at end of file