diff --git a/src/lua/init.cc b/src/lua/init.cc index 0dccc9f95caba0119d20e166fd4ab4da0c4560a9..f87214edc1cb64edf3f246728333f6e84e69b4db 100644 --- a/src/lua/init.cc +++ b/src/lua/init.cc @@ -741,7 +741,13 @@ tarantool_lua_load_cfg(struct lua_State *L, struct tarantool_cfg *cfg) "end\n" "getmetatable(box.cfg).__call = " "function(table, index)\n" - " return table\n" + " local t = {}\n" + " for i, v in pairs(table) do\n" + " if type(v) ~= 'function' then\n" + " t[i] = v\n" + " end\n" + " end\n" + " return t\n" "end\n"); while ((key = tarantool_cfg_iterator_next(i, cfg, &value)) != NULL) { if (value == NULL) diff --git a/test/box/admin.result b/test/box/admin.result index 91426642056ea4447785deb986192e00fee43a50..a25e98e2db9c4bad8dab6a970f2ee4632d616163 100644 --- a/test/box/admin.result +++ b/test/box/admin.result @@ -49,28 +49,27 @@ box.cfg() slab_alloc_minimal: 64 admin_port: 33015 logger: cat - >> tarantool.log - slab_alloc_arena: 0.1 + snap_io_rate_limit: 0 log_level: 4 - reload: function_ptr - too_long_threshold: 0.5 - secondary_port: 33014 + slab_alloc_arena: 0.1 + backlog: 1024 primary_port: 33013 logger_nonblock: true - panic_on_wal_error: false + secondary_port: 33014 snap_dir: . coredump: false - snap_io_rate_limit: 0 wal_dir: . readahead: 16320 + local_hot_standby: false wal_mode: fsync_delay rows_per_wal: 50 panic_on_snap_error: true - local_hot_standby: false + panic_on_wal_error: false script_dir: . replication_port: 0 bind_ipaddr: INADDR_ANY wal_fsync_delay: 0 - backlog: 1024 + too_long_threshold: 0.5 wal_dir_rescan_delay: 0.1 ... box.stat() diff --git a/test/box/configuration.result b/test/box/configuration.result index c98aa49e3a9bc9be6a76aab24e70a7bbbcc9d733..bba2c39cd4cbe645e24f5e1f8c177732b669ca2c 100644 --- a/test/box/configuration.result +++ b/test/box/configuration.result @@ -1,251 +1,40 @@ -# Bug #708685: -# Addition of required configuration file options broke backward -# compatibility -# (https://bugs.launchpad.net/bugs/708685) - -show configuration ---- -configuration: - username: (null) - local_hot_standby: "false" - bind_ipaddr: "INADDR_ANY" - coredump: "false" - admin_port: "33015" - replication_port: "0" - log_level: "4" - slab_alloc_arena: "0.1" - slab_alloc_minimal: "64" - slab_alloc_factor: "2" - work_dir: (null) - snap_dir: "." - wal_dir: "." - script_dir: "." - pid_file: "box.pid" - logger: "cat - >> tarantool.log" - logger_nonblock: "true" - io_collect_interval: "0" - backlog: "1024" - readahead: "16320" - snap_io_rate_limit: "0" - rows_per_wal: "50" - wal_writer_inbox_size: "16384" - wal_mode: "fsync_delay" - wal_fsync_delay: "0" - wal_dir_rescan_delay: "0.1" - panic_on_snap_error: "true" - panic_on_wal_error: "false" - primary_port: "33013" - secondary_port: "33014" - too_long_threshold: "0.5" - custom_proc_title: (null) - memcached_port: "0" - memcached_space: "23" - memcached_expire: "false" - memcached_expire_per_loop: "1024" - memcached_expire_full_sweep: "3600" - replication_source: (null) - space[0].enabled: "true" - space[0].arity: "-1" - space[0].estimated_rows: "0" - space[0].index[0].type: "HASH" - space[0].index[0].unique: "true" - space[0].index[0].key_field[0].fieldno: "0" - space[0].index[0].key_field[0].type: "NUM" - space[1].enabled: "false" - space[1].arity: "-1" - space[1].estimated_rows: "0" - space[2].enabled: "true" - space[2].arity: "-1" - space[2].estimated_rows: "0" - space[2].index[0].type: "HASH" - space[2].index[0].unique: "true" - space[2].index[0].key_field[0].fieldno: "0" - space[2].index[0].key_field[0].type: "NUM" -... - -# Bug #884768: -# Test representation of boolean values -# (https://bugs.launchpad.net/bugs/884768) - -show configuration ---- -configuration: - username: (null) - local_hot_standby: "false" - bind_ipaddr: "INADDR_ANY" - coredump: "false" - admin_port: "33015" - replication_port: "0" - log_level: "4" - slab_alloc_arena: "0.1" - slab_alloc_minimal: "64" - slab_alloc_factor: "2" - work_dir: (null) - snap_dir: "." - wal_dir: "." - script_dir: "." - pid_file: "box.pid" - logger: "cat - >> tarantool.log" - logger_nonblock: "true" - io_collect_interval: "0" - backlog: "1024" - readahead: "16320" - snap_io_rate_limit: "0" - rows_per_wal: "50" - wal_writer_inbox_size: "16384" - wal_mode: "fsync_delay" - wal_fsync_delay: "0" - wal_dir_rescan_delay: "0.1" - panic_on_snap_error: "true" - panic_on_wal_error: "false" - primary_port: "33013" - secondary_port: "33014" - too_long_threshold: "0.5" - custom_proc_title: (null) - memcached_port: "0" - memcached_space: "23" - memcached_expire: "false" - memcached_expire_per_loop: "1024" - memcached_expire_full_sweep: "3600" - replication_source: (null) - space[0].enabled: "false" - space[0].arity: "-1" - space[0].estimated_rows: "0" - space[0].index[0].type: "HASH" - space[0].index[0].unique: "false" - space[0].index[0].key_field[0].fieldno: "0" - space[0].index[0].key_field[0].type: "NUM" - space[1].enabled: "true" - space[1].arity: "-1" - space[1].estimated_rows: "0" - space[1].index[0].type: "HASH" - space[1].index[0].unique: "true" - space[1].index[0].key_field[0].fieldno: "0" - space[1].index[0].key_field[0].type: "NUM" - space[2].enabled: "false" - space[2].arity: "-1" - space[2].estimated_rows: "0" - space[2].index[0].type: "HASH" - space[2].index[0].unique: "false" - space[2].index[0].key_field[0].fieldno: "0" - space[2].index[0].key_field[0].type: "NUM" - space[3].enabled: "true" - space[3].arity: "-1" - space[3].estimated_rows: "0" - space[3].index[0].type: "HASH" - space[3].index[0].unique: "true" - space[3].index[0].key_field[0].fieldno: "0" - space[3].index[0].key_field[0].type: "NUM" - space[4].enabled: "false" - space[4].arity: "-1" - space[4].estimated_rows: "0" - space[4].index[0].type: "HASH" - space[4].index[0].unique: "false" - space[4].index[0].key_field[0].fieldno: "0" - space[4].index[0].key_field[0].type: "NUM" - space[5].enabled: "true" - space[5].arity: "-1" - space[5].estimated_rows: "0" - space[5].index[0].type: "HASH" - space[5].index[0].unique: "true" - space[5].index[0].key_field[0].fieldno: "0" - space[5].index[0].key_field[0].type: "NUM" - space[6].enabled: "false" - space[6].arity: "-1" - space[6].estimated_rows: "0" - space[6].index[0].type: "HASH" - space[6].index[0].unique: "false" - space[6].index[0].key_field[0].fieldno: "0" - space[6].index[0].key_field[0].type: "NUM" - space[7].enabled: "true" - space[7].arity: "-1" - space[7].estimated_rows: "0" - space[7].index[0].type: "HASH" - space[7].index[0].unique: "true" - space[7].index[0].key_field[0].fieldno: "0" - space[7].index[0].key_field[0].type: "NUM" - space[8].enabled: "false" - space[8].arity: "-1" - space[8].estimated_rows: "0" - space[8].index[0].type: "HASH" - space[8].index[0].unique: "false" - space[8].index[0].key_field[0].fieldno: "0" - space[8].index[0].key_field[0].type: "NUM" - space[9].enabled: "true" - space[9].arity: "-1" - space[9].estimated_rows: "0" - space[9].index[0].type: "HASH" - space[9].index[0].unique: "true" - space[9].index[0].key_field[0].fieldno: "0" - space[9].index[0].key_field[0].type: "NUM" -... - # Bug #876541: # Test floating point values (wal_fsync_delay) with fractional part # (https://bugs.launchpad.net/bugs/876541) box.cfg.wal_fsync_delay --- - - 0.01 -... - -# Bug#928413 Lua malfunction on certain configuration -# (https://bugs.launchpad.net/bugs/928413) - -box.cfg.wal_fsync_delay ---- - - 0.1 -... -box.space[0].enabled ---- - - true +- 0.01 ... -reload configuration ---- -ok -... - -# Test field type conflict in keys - -tarantool_box -c tarantool_bad_type.cfg -tarantool_box: can't load config: - - (space = 0 fieldno = 0) index field type mismatch - print_config() --- -io_collect_interval = 0 -pid_file = box.pid -slab_alloc_minimal = 64 -primary_port = 33013 -log_level = 4 -logger_nonblock = true -memcached_expire_per_loop = 1024 -snap_dir = . -coredump = false -panic_on_snap_error = true -memcached_expire_full_sweep = 3600 -replication_port = 0 -wal_fsync_delay = 0 -too_long_threshold = 0.5 -slab_alloc_factor = 2 -admin_port = 33015 -logger = cat - >> tarantool.log -snap_io_rate_limit = 0 -wal_writer_inbox_size = 16384 -memcached_expire = false -backlog = 1024 -memcached_space = 23 -memcached_port = 0 -rows_per_wal = 50 -wal_mode = fsync_delay -local_hot_standby = false -secondary_port = 33014 -panic_on_wal_error = false -script_dir = script_dir -wal_dir = . -bind_ipaddr = INADDR_ANY -readahead = 16320 -slab_alloc_arena = 0.1 -wal_dir_rescan_delay = 0.1 +- io_collect_interval: 0 + pid_file: box.pid + slab_alloc_factor: 2 + slab_alloc_minimal: 64 + admin_port: 33015 + logger: cat - >> tarantool.log + snap_io_rate_limit: 0 + log_level: 4 + slab_alloc_arena: 0.1 + backlog: 1024 + primary_port: 33013 + logger_nonblock: true + secondary_port: 33014 + snap_dir: . + coredump: false + wal_dir: . + readahead: 16320 + local_hot_standby: false + wal_mode: fsync_delay + rows_per_wal: 50 + panic_on_snap_error: true + panic_on_wal_error: false + script_dir: script_dir + replication_port: 0 + bind_ipaddr: INADDR_ANY + wal_fsync_delay: 0 + too_long_threshold: 0.5 + wal_dir_rescan_delay: 0.1 ... diff --git a/test/box/configuration.test.py b/test/box/configuration.test.py index 4db50b00692ce5ebb6e0f77a8d1846b844a7125d..a7688d2fc7014f2e85bb5dbe24e0a45f80e7dd9e 100644 --- a/test/box/configuration.test.py +++ b/test/box/configuration.test.py @@ -8,31 +8,6 @@ import shutil # mask BFD warnings: https://bugs.launchpad.net/tarantool/+bug/1018356 sys.stdout.push_filter("unable to read unknown load command 0x2\d+", "") -print """ -# Bug #708685: -# Addition of required configuration file options broke backward -# compatibility -# (https://bugs.launchpad.net/bugs/708685) -""" -# stop current server -server.stop() -# start server from config with holes in spaces -server.deploy("box/tarantool_bug708685.cfg") -# check connection -admin("show configuration") - -print """ -# Bug #884768: -# Test representation of boolean values -# (https://bugs.launchpad.net/bugs/884768) -""" -# stop current server -server.stop() -# start server from config with different boolean represenation -server.deploy("box/tarantool_bug884768.cfg") -# check values -admin("show configuration") - print """ # Bug #876541: # Test floating point values (wal_fsync_delay) with fractional part @@ -44,29 +19,6 @@ server.deploy("box/tarantool_bug876541.cfg") # check values admin("box.cfg.wal_fsync_delay") -print """ -# Bug#928413 Lua malfunction on certain configuration -# (https://bugs.launchpad.net/bugs/928413) -""" -# stop current server -server.stop() -server.deploy("box/tarantool_bug928413.cfg") -# check values -admin("box.cfg.wal_fsync_delay") -admin("box.space[0].enabled") -admin("reload configuration") - -print """ -# Test field type conflict in keys -""" -# stop current server -server.stop() -# start server with memcached space conflict -sys.stdout.push_filter("(/\S+)+/tarantool", "tarantool") -server.test_option("-c " + os.path.join(os.getcwd(), "box/tarantool_bad_type.cfg")) -sys.stdout.pop_filter() - - script_dir_path = os.path.join(vardir, "script_dir") os.mkdir(script_dir_path) shutil.copy("box/test_init.lua", os.path.join(script_dir_path, "init.lua")) diff --git a/test/box/lua.result b/test/box/lua.result index 6cff707a912d58567983d8bdeb7fd1bd299a51d5..05086b1a8760a068b31c1a0b8265925a4faaba4f 100644 --- a/test/box/lua.result +++ b/test/box/lua.result @@ -1398,35 +1398,34 @@ ffi print_config() --- -- - io_collect_interval = 0 - - pid_file = box.pid - - slab_alloc_factor = 2 - - slab_alloc_minimal = 64 - - admin_port = 33015 - - logger = cat - >> tarantool.log - - slab_alloc_arena = 0.1 - - log_level = 4 - - primary_port = 33013 - - backlog = 1024 - - too_long_threshold = 0.5 - - snap_io_rate_limit = 0 - - logger_nonblock = true - - wal_dir = . - - snap_dir = . - - coredump = false - - script_dir = . - - local_hot_standby = false - - readahead = 16320 - - wal_mode = fsync_delay - - rows_per_wal = 50 - - panic_on_snap_error = true - - panic_on_wal_error = false - - 'reload = function_ptr' - - replication_port = 0 - - bind_ipaddr = INADDR_ANY - - wal_fsync_delay = 0 - - secondary_port = 33014 - - wal_dir_rescan_delay = 0.1 +- io_collect_interval: 0 + pid_file: box.pid + slab_alloc_factor: 2 + slab_alloc_minimal: 64 + admin_port: 33015 + logger: cat - >> tarantool.log + snap_io_rate_limit: 0 + log_level: 4 + slab_alloc_arena: 0.1 + backlog: 1024 + primary_port: 33013 + logger_nonblock: true + secondary_port: 33014 + snap_dir: . + coredump: false + wal_dir: . + readahead: 16320 + local_hot_standby: false + wal_mode: fsync_delay + rows_per_wal: 50 + panic_on_snap_error: true + panic_on_wal_error: false + script_dir: . + replication_port: 0 + bind_ipaddr: INADDR_ANY + wal_fsync_delay: 0 + too_long_threshold: 0.5 + wal_dir_rescan_delay: 0.1 ... # Test bug #977898 diff --git a/test/box/suite.ini b/test/box/suite.ini index 67f575dea54213674cd2edbbeaf8e0b3a3d2947b..d6dd29319553ca75cac479eae900cd137adfdab8 100644 --- a/test/box/suite.ini +++ b/test/box/suite.ini @@ -2,6 +2,6 @@ core = tarantool description = tarantool/box, minimal configuration config = tarantool.cfg -disabled = snapshot_1_3.test.py configuration.test.py session.test.py +disabled = snapshot_1_3.test.py session.test.py valgrind_disabled = admin_coredump.test.lua release_disabled = errinj.test.lua diff --git a/test/box/tarantool_bad_type.cfg b/test/box/tarantool_bad_type.cfg deleted file mode 100644 index 3fdfd3044ae6dec77c28865d03329dd0a6e68ba6..0000000000000000000000000000000000000000 --- a/test/box/tarantool_bad_type.cfg +++ /dev/null @@ -1,24 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "box.pid" - -logger="cat - >> tarantool.log" - -primary_port = 33013 -secondary_port = 33014 -admin_port = 33015 - -rows_per_wal = 50 -# This is one of the few modifiable settings, change it -too_long_threshold=2 - -space[0].enabled = 1 -space[0].index[0].type = "HASH" -space[0].index[0].unique = 1 -space[0].index[0].key_field[0].fieldno = 0 -space[0].index[0].key_field[0].type = "NUM" -space[0].index[1].type = "TREE" -space[0].index[1].unique = 1 -space[0].index[1].key_field[0].fieldno = 0 -space[0].index[1].key_field[0].type = "NUM64" - diff --git a/test/box/tarantool_bug708685.cfg b/test/box/tarantool_bug708685.cfg deleted file mode 100644 index 19a9d8d84903584af2c126f1a31604d21aab4715..0000000000000000000000000000000000000000 --- a/test/box/tarantool_bug708685.cfg +++ /dev/null @@ -1,23 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "box.pid" - -logger="cat - >> tarantool.log" - -primary_port = 33013 -secondary_port = 33014 -admin_port = 33015 - -rows_per_wal = 50 - -space[0].enabled = 1 -space[0].index[0].type = "HASH" -space[0].index[0].unique = 1 -space[0].index[0].key_field[0].fieldno = 0 -space[0].index[0].key_field[0].type = "NUM" - -space[2].enabled = 1 -space[2].index[0].type = "HASH" -space[2].index[0].unique = 1 -space[2].index[0].key_field[0].fieldno = 0 -space[2].index[0].key_field[0].type = "NUM" diff --git a/test/box/tarantool_bug876541.cfg b/test/box/tarantool_bug876541.cfg index 44163ffc275aeeddb9ac469f39d39a28f6a4819f..8c1ec737f3d166d16db4bba058df88eee6447973 100644 --- a/test/box/tarantool_bug876541.cfg +++ b/test/box/tarantool_bug876541.cfg @@ -10,10 +10,5 @@ admin_port = 33015 rows_per_wal = 50 -space[0].enabled = 1 -space[0].index[0].type = "HASH" -space[0].index[0].unique = 1 -space[0].index[0].key_field[0].fieldno = 0 -space[0].index[0].key_field[0].type = "NUM" wal_fsync_delay = 0.01 diff --git a/test/box/tarantool_bug884768.cfg b/test/box/tarantool_bug884768.cfg deleted file mode 100644 index 7ec36273b2fbdb5f0e853a110edcc1024f89666a..0000000000000000000000000000000000000000 --- a/test/box/tarantool_bug884768.cfg +++ /dev/null @@ -1,71 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "box.pid" - -logger="cat - >> tarantool.log" - -primary_port = 33013 -secondary_port = 33014 -admin_port = 33015 - -rows_per_wal = 50 - -space[0].enabled = 0 -space[0].index[0].type = "HASH" -space[0].index[0].unique = 0 -space[0].index[0].key_field[0].fieldno = 0 -space[0].index[0].key_field[0].type = "NUM" - -space[1].enabled = 1 -space[1].index[0].type = "HASH" -space[1].index[0].unique = 1 -space[1].index[0].key_field[0].fieldno = 0 -space[1].index[0].key_field[0].type = "NUM" - -space[2].enabled = false -space[2].index[0].type = "HASH" -space[2].index[0].unique = false -space[2].index[0].key_field[0].fieldno = 0 -space[2].index[0].key_field[0].type = "NUM" - -space[3].enabled = true -space[3].index[0].type = "HASH" -space[3].index[0].unique = true -space[3].index[0].key_field[0].fieldno = 0 -space[3].index[0].key_field[0].type = "NUM" - -space[4].enabled = off -space[4].index[0].type = "HASH" -space[4].index[0].unique = off -space[4].index[0].key_field[0].fieldno = 0 -space[4].index[0].key_field[0].type = "NUM" - -space[5].enabled = on -space[5].index[0].type = "HASH" -space[5].index[0].unique = on -space[5].index[0].key_field[0].fieldno = 0 -space[5].index[0].key_field[0].type = "NUM" - -space[6].enabled = no -space[6].index[0].type = "HASH" -space[6].index[0].unique = no -space[6].index[0].key_field[0].fieldno = 0 -space[6].index[0].key_field[0].type = "NUM" - -space[7].enabled = yes -space[7].index[0].type = "HASH" -space[7].index[0].unique = yes -space[7].index[0].key_field[0].fieldno = 0 -space[7].index[0].key_field[0].type = "NUM" - -space[8].enabled = "0" -space[8].index[0].type = "HASH" -space[8].index[0].unique = "0" -space[8].index[0].key_field[0].fieldno = 0 -space[8].index[0].key_field[0].type = "NUM" - -space[9].enabled = "1" -space[9].index[0].type = "HASH" -space[9].index[0].unique = "1" -space[9].index[0].key_field[0].fieldno = 0 -space[9].index[0].key_field[0].type = "NUM" diff --git a/test/box/tarantool_bug928413.cfg b/test/box/tarantool_bug928413.cfg deleted file mode 100644 index 3038550eda411646755eb648fb0672a6252bad55..0000000000000000000000000000000000000000 --- a/test/box/tarantool_bug928413.cfg +++ /dev/null @@ -1,158 +0,0 @@ -slab_alloc_arena = 0.1 - -pid_file = "box.pid" - -logger="cat - >> tarantool.log" - -primary_port = 33013 -secondary_port = 33014 -admin_port = 33015 - -log_level = 4 - -local_hot_standby = true - -slab_alloc_minimal = 48 - -# Growth factor, each subsecuent unit size is factor * prev unit size -slab_alloc_factor = 1.04 - - -# SESSIONS!!! ##################################### -#memcached_space = 52 -space[0].enabled = 1 -#namespace[0].expire_field = 2 - -space[0].index[0].type = "HASH" -space[0].index[0].unique = 1 -space[0].index[0].key_field[0].type = "STR" -space[0].index[0].key_field[0].fieldno = 0 - -space[0].index[1].type = "TREE" -space[0].index[1].unique = 0 -space[0].index[1].key_field[0].type = "STR" -space[0].index[1].key_field[0].fieldno = 1 -################################################### - -# video meta. Indexes: 1.ACCID -space[46] = { - enabled = 1 - index = [{ - type = "HASH" - unique = 1 - key_field = [{ - fieldno = 0 - type = "NUM" - }] - }] - } - -# upload meta. Indexes: 1.ITEMID 2.ACCID 3.UPLOADTIME -space[47] = { - enabled = 1 - index = [{ - type="HASH" - unique = 1 - Key_field = [{ - fieldno = 0 - type = "NUM64" - }] - },{ - type="TREE" - unique = 0 - Key_field = [{ - fieldno = 1 - type = "NUM" - }] - },{ - type="TREE" - unique = 0 - Key_field = [{ - fieldno = 2 - type = "NUM" - }] - }] - } - -# user meta. Indexes: 0.ITEMID 1.ACCID 2.EXTERNALID 3.FLAGS 4.STATUS 5.SERVICEID -space[48] = { - enabled = 1 - index = [{ - type="HASH" - unique = 1 - Key_field = [{ - fieldno = 0 - type = "NUM" - }] - },{ - type="TREE" - unique=0 - Key_field = [{ - fieldno = 1 - type = "NUM" - }] - }, - { - type="HASH" - unique = 1 - Key_field = [{ - fieldno = 2 - type = "STR" - }] - },{ - type="TREE" - unique = 0 - key_field = [{ - fieldno = 3 - type = "NUM" - }] - },{ - type="TREE" - unique = 0 - key_field = [{ - fieldno = 4 - type = "NUM" - }] - },{ - type="TREE" - unique = 0 - key_field = [{ - fieldno = 5 - type = "NUM" - }] - } - ] - - } -space[50] = { - enabled = 1 - index = [{ - type="HASH" - unique = 1 - Key_field = [{ - fieldno = 0 - type = "NUM" - }] - }] - } - - -space[53] = { - enabled = 1 - index = [{ - type = "HASH" - unique = 1 - key_field = [{ - fieldno = 0 - type= "NUM" - }] - }] - } - -wal_fsync_delay = 0.1 -io_collect_interval = 0.001 -logger_nonblock = true -coredump = true -snap_io_rate_limit = 50.0 -custom_proc_title = "videobox" - diff --git a/test/box/tarantool_scriptdir.cfg b/test/box/tarantool_scriptdir.cfg index 44405de86e09d3c329a88cf42acd889d85390196..ca152321fbe9f367518bb8d5a6427cc460fb4b49 100644 --- a/test/box/tarantool_scriptdir.cfg +++ b/test/box/tarantool_scriptdir.cfg @@ -39,11 +39,3 @@ rows_per_wal = 50 # script directory (where init.lua is expected to be) script_dir = "script_dir" -# Define a simple space with 1 HASH-based -# primary key. -space[0].enabled = 1 -space[0].index[0].type = "HASH" -space[0].index[0].unique = 1 -space[0].index[0].key_field[0].fieldno = 0 -space[0].index[0].key_field[0].type = "NUM" - diff --git a/test/box/test_init.lua b/test/box/test_init.lua index e1736bb9a157738ebeabac9a9e293ebdf3f35d5a..a0b4045886ce8cf3d839d3f829699c4ad1e4cd9e 100644 --- a/test/box/test_init.lua +++ b/test/box/test_init.lua @@ -1,29 +1,16 @@ -- testing start-up script floor = require("math").floor -box.insert(box.schema.SPACE_ID, 0, 0, 'tweedledum') -box.insert(box.schema.INDEX_ID, 0, 0, 'primary', 'hash', 1, 1, 0, 'num') - -- -- Access to box.cfg from start-up script -- -box_cfg = {} -function copy_box_cfg() - for i, v in pairs(box.cfg) do - box_cfg[i] = v - end -end +box_cfg = box.cfg() function print_config() - t = {} - for i, v in pairs(box_cfg) do - table.insert(t, tostring(i).." = "..tostring(v)) - end - return t + return box_cfg end -copy_box_cfg() -- -- Test for bug #977898 @@ -35,6 +22,10 @@ local function do_insert() box.insert(0, 1, 2, 4, 8) end +box.insert(box.schema.SPACE_ID, 0, 0, 'tweedledum') +box.insert(box.schema.INDEX_ID, 0, 0, 'primary', 'hash', 1, 1, 0, 'num') + + fiber = box.fiber.create(do_insert) box.fiber.resume(fiber)