diff --git a/CMakeLists.txt b/CMakeLists.txt index e9ccc2fad1fdd7b24fa808edf96e355ef77e7a7e..5b467ce003709ec823a5892f2ff94a2eb442687e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,6 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR) set(CMAKE_INSTALL_LIBDIR lib) endif(NOT DEFINED CMAKE_INSTALL_LIBDIR) -set(PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/tarantool/plugins") include(cmake/utils.cmake) @@ -140,6 +139,13 @@ include_directories("${PROJECT_SOURCE_DIR}") include_directories("${PROJECT_SOURCE_DIR}/include") include_directories("${PROJECT_BINARY_DIR}/include") include_directories("${PROJECT_SOURCE_DIR}/third_party") + +# +# Specify Tarantool modules prefixes +# +set(MODULE_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/tarantool/") +set(MODULE_DIR "${MODULE_DIR}${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") + # # Specify prefixes # @@ -166,12 +172,8 @@ endif() # # Specify Tarantool modules Lua prefixes # -if (NOT DEFINED LUA_LIBPATH) - set (LUA_LIBPATH "") -endif() -if (NOT DEFINED LUA_LIBCPATH) - set (LUA_LIBCPATH "") -endif() +set (LUA_LIBPATH "${LUA_LIBPATH};${MODULE_DIR}/?.lua") +set (LUA_LIBCPATH "${LUA_LIBCPATH};${MODULE_DIR}/?.so") # # Now handle all configuration options. @@ -368,7 +370,7 @@ message (STATUS "CXX_COMPILER: ${TARANTOOL_CXX_COMPILER}") message (STATUS "C_FLAGS:${TARANTOOL_C_FLAGS}") message (STATUS "CXX_FLAGS:${TARANTOOL_CXX_FLAGS}") message (STATUS "PREFIX: ${CMAKE_INSTALL_PREFIX}") -message (STATUS "MODULES: ${TARANTOOL_MODULES}") +message (STATUS "MODULE_DIR: ${MODULE_DIR}") message (STATUS "ENABLE_STATIC: ${ENABLE_STATIC}") message (STATUS "ENABLE_SSE2: ${ENABLE_SSE2}") message (STATUS "ENABLE_AVX: ${ENABLE_AVX}") diff --git a/debian/control b/debian/control index 52d93daa59054c153574877d1e6767ea391a8cb1..500f1b4b460bafaf449c9ae18259376020ec05c2 100644 --- a/debian/control +++ b/debian/control @@ -46,19 +46,20 @@ Description: In-memory database with Lua application server . This package provides Tarantool server. -Package: tarantool-plugins +Package: tarantool-modules Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64 hurd-i386 Priority: optional Depends: ${shlibs:Depends}, ${misc:Depends}, tarantool (= ${binary:Version}), - tarantool-postgresql-plugin, - tarantool-mysql-plugin + tarantool-sql-module, + tarantool-postgresql-module, + tarantool-mysql-module Suggests: tarantool-dbg, libdr-tarantool-perl Description: Tarantool in-memory database - all plug-ins bundle Tarantool is an in-memory database and Lua application server. This package provides (or depends on) all Tarantool plug-ins. -Package: tarantool-postgresql-plugin +Package: tarantool-sql-module Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64 hurd-i386 Priority: optional Depends: ${shlibs:Depends}, ${misc:Depends}, @@ -69,10 +70,23 @@ Description: Tarantool in-memory database - PostgreSQL connector This package contains a connector to PostgreSQL database for Tarantool Lua stored procedures. -Package: tarantool-mysql-plugin +Package: tarantool-postgresql-module Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64 hurd-i386 Priority: optional Depends: ${shlibs:Depends}, ${misc:Depends}, + tarantool-sql-module (= ${binary:Version}), + tarantool (= ${binary:Version}) +Suggests: tarantool-dbg, libdr-tarantool-perl +Description: Tarantool in-memory database - PostgreSQL connector + Tarantool is an in-memory database and Lua application server. + This package contains a connector to PostgreSQL database for + Tarantool Lua stored procedures. + +Package: tarantool-mysql-module +Architecture: i386 amd64 kfreebsd-i386 kfreebsd-amd64 hurd-i386 +Priority: optional +Depends: ${shlibs:Depends}, ${misc:Depends}, + tarantool-sql-module (= ${binary:Version}), tarantool (= ${binary:Version}) Suggests: tarantool-dbg, libdr-tarantool-perl Description: Tarantool in-memory database - MySQL connector diff --git a/debian/tarantool-mysql-module.install b/debian/tarantool-mysql-module.install new file mode 100644 index 0000000000000000000000000000000000000000..565a1aeabe76b1097bce7806db4c92c95312cf21 --- /dev/null +++ b/debian/tarantool-mysql-module.install @@ -0,0 +1,2 @@ +usr/lib/tarantool/1.5/box/net/mysql.so + diff --git a/debian/tarantool-mysql-plugin.install b/debian/tarantool-mysql-plugin.install deleted file mode 100644 index ee5b91ba8c16b78fda9989e39ccee7e38fda2dd2..0000000000000000000000000000000000000000 --- a/debian/tarantool-mysql-plugin.install +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/tarantool/plugins/libmysql.so - diff --git a/debian/tarantool-postgresql-module.install b/debian/tarantool-postgresql-module.install new file mode 100644 index 0000000000000000000000000000000000000000..8645f1f51c995e366927efd82c104e098f571a08 --- /dev/null +++ b/debian/tarantool-postgresql-module.install @@ -0,0 +1 @@ +usr/lib/tarantool/1.5/box/net/pg.so diff --git a/debian/tarantool-postgresql-plugin.install b/debian/tarantool-postgresql-plugin.install deleted file mode 100644 index a7b5de3c7914973de68d671a95b4c91b567e2110..0000000000000000000000000000000000000000 --- a/debian/tarantool-postgresql-plugin.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/tarantool/plugins/libpg.so diff --git a/debian/tarantool-sql-module.install b/debian/tarantool-sql-module.install new file mode 100644 index 0000000000000000000000000000000000000000..19fb54d63806e67c4cffa9d2df568798c4494639 --- /dev/null +++ b/debian/tarantool-sql-module.install @@ -0,0 +1 @@ +usr/lib/tarantool/1.5/box/net/sql.lua diff --git a/include/tarantool/config.h.cmake b/include/tarantool/config.h.cmake index 5a22fbc412e64d5371e40df872297d9c231ab47d..c8696f0274adee02f8a0c39e5eca1526ff97d9ef 100644 --- a/include/tarantool/config.h.cmake +++ b/include/tarantool/config.h.cmake @@ -120,7 +120,7 @@ #define LUA_LIBPATH "@LUA_LIBPATH@" #define LUA_LIBCPATH "@LUA_LIBCPATH@" -#define PLUGIN_DIR "@PLUGIN_DIR@" +#define MODULE_DIR "@MODULE_DIR" /* * vim: syntax=c diff --git a/include/tarantool/plugin.h b/include/tarantool/plugin.h deleted file mode 100644 index a5c580c631e750d8ffa09b9b366a4990c7e31d8b..0000000000000000000000000000000000000000 --- a/include/tarantool/plugin.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef TARANTOOL_PLUGIN_H_INCLUDED -#define TARANTOOL_PLUGIN_H_INCLUDED -/* - * Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * 1. Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * <COPYRIGHT HOLDER> OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 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. - */ - -#define PLUGIN_API_VERSION 1 - -#include <rlist.h> -#include <tbuf.h> -#include <stddef.h> - -struct lua_State; - -typedef void(*plugin_init_cb)(struct lua_State *L); -typedef void(*plugin_stat_cb)(struct tbuf *out); - -struct tarantool_plugin { - int api_version; - int version; - const char *name; - plugin_init_cb init; - plugin_stat_cb stat; - struct rlist list; -}; - -#define DECLARE_PLUGIN(name, version, init, stat) \ - extern "C" { \ - struct tarantool_plugin plugin_meta = { \ - PLUGIN_API_VERSION, \ - version, \ - name, \ - init, \ - stat, \ - { NULL, NULL } \ - }; \ - } - - -#endif /* TARANTOOL_PLUGIN_H_INCLUDED */ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f96545ee8cce465beb663cf1f17288b43ea7331a..0343f35ea5b682f903e0dcb4b5c21aa42281ccbd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,7 +4,7 @@ enable_tnt_compile_flags() if (NOT TARGET_OS_DARWIN) - add_subdirectory(plugin) + add_subdirectory(module) endif() include_directories(${LIBEV_INCLUDE_DIR}) diff --git a/src/admin.cc b/src/admin.cc index 0bc993d591d5136a79dfca3a5cb2251df2f2e478..6c93617f450b30fa2ff4e7eed0502a92a4973eb4 100644 --- a/src/admin.cc +++ b/src/admin.cc @@ -70,7 +70,6 @@ static const char *help = " - show slab" CRLF " - show palloc" CRLF " - show stat" CRLF - " - show plugins" CRLF " - save coredump" CRLF " - save snapshot" CRLF " - lua command" CRLF @@ -81,15 +80,15 @@ static const char *help = static const char *unknown_command = "unknown command. try typing help." CRLF; -#line 85 "src/admin.cc" +#line 84 "src/admin.cc" static const int admin_start = 1; -static const int admin_first_final = 145; +static const int admin_first_final = 139; static const int admin_error = 0; static const int admin_en_main = 1; -#line 84 "src/admin.rl" +#line 83 "src/admin.rl" struct salloc_stat_admin_cb_ctx { @@ -264,12 +263,12 @@ admin_dispatch(struct ev_io *coio, struct iobuf *iobuf, lua_State *L) p = in->pos; -#line 268 "src/admin.cc" +#line 267 "src/admin.cc" { cs = admin_start; } -#line 273 "src/admin.cc" +#line 272 "src/admin.cc" { if ( p == pe ) goto _test_eof; @@ -332,47 +331,47 @@ case 6: } goto st0; tr13: -#line 365 "src/admin.rl" +#line 357 "src/admin.rl" {slab_validate(); ok(out);} - goto st145; + goto st139; tr20: -#line 351 "src/admin.rl" +#line 344 "src/admin.rl" {return -1;} - goto st145; + goto st139; tr25: -#line 276 "src/admin.rl" +#line 269 "src/admin.rl" { start(out); tbuf_append(out, help, strlen(help)); end(out); } - goto st145; + goto st139; tr36: -#line 337 "src/admin.rl" +#line 330 "src/admin.rl" {strend = p;} -#line 282 "src/admin.rl" +#line 275 "src/admin.rl" { strstart[strend-strstart]='\0'; start(out); tarantool_lua(L, out, strstart); end(out); } - goto st145; + goto st139; tr43: -#line 289 "src/admin.rl" +#line 282 "src/admin.rl" { if (reload_cfg(err)) fail(out, err); else ok(out); } - goto st145; + goto st139; tr67: -#line 363 "src/admin.rl" +#line 355 "src/admin.rl" {coredump(60); ok(out);} - goto st145; + goto st139; tr76: -#line 296 "src/admin.rl" +#line 289 "src/admin.rl" { int ret = snapshot(); @@ -385,11 +384,11 @@ case 6: fail(out, err); } } - goto st145; + goto st139; tr98: -#line 347 "src/admin.rl" +#line 340 "src/admin.rl" { state = false; } -#line 309 "src/admin.rl" +#line 302 "src/admin.rl" { strstart[strend-strstart] = '\0'; if (errinj_set_byname(strstart, state)) { @@ -399,11 +398,11 @@ case 6: ok(out); } } - goto st145; + goto st139; tr101: -#line 346 "src/admin.rl" +#line 339 "src/admin.rl" { state = true; } -#line 309 "src/admin.rl" +#line 302 "src/admin.rl" { strstart[strend-strstart] = '\0'; if (errinj_set_byname(strstart, state)) { @@ -413,71 +412,63 @@ case 6: ok(out); } } - goto st145; + goto st139; tr117: -#line 264 "src/admin.rl" +#line 257 "src/admin.rl" { start(out); show_cfg(out); end(out); } - goto st145; + goto st139; tr131: -#line 355 "src/admin.rl" +#line 348 "src/admin.rl" {start(out); fiber_info(out); end(out);} - goto st145; + goto st139; tr139: -#line 354 "src/admin.rl" +#line 347 "src/admin.rl" {start(out); index_info(out); end(out);} - goto st145; + goto st139; tr141: -#line 353 "src/admin.rl" +#line 346 "src/admin.rl" {start(out); tarantool_info(out); end(out);} - goto st145; + goto st139; tr152: -#line 270 "src/admin.rl" +#line 263 "src/admin.rl" { start(out); errinj_info(out); end(out); } - goto st145; -tr159: -#line 358 "src/admin.rl" + goto st139; +tr158: +#line 351 "src/admin.rl" {start(out); palloc_stat(out); end(out);} - goto st145; -tr170: -#line 258 "src/admin.rl" - { - start(out); - show_plugins_stat(out); - end(out); - } - goto st145; -tr174: -#line 357 "src/admin.rl" + goto st139; +tr166: +#line 350 "src/admin.rl" {start(out); show_slab(out); end(out);} - goto st145; -tr178: -#line 359 "src/admin.rl" + goto st139; +tr170: +#line 352 "src/admin.rl" {start(out); show_stat(out);end(out);} - goto st145; -st145: + goto st139; +st139: if ( ++p == pe ) - goto _test_eof145; -case 145: -#line 470 "src/admin.cc" + goto _test_eof139; +case 139: +#line 461 "src/admin.cc" goto st0; tr14: -#line 365 "src/admin.rl" +#line 357 "src/admin.rl" {slab_validate(); ok(out);} goto st7; tr21: -#line 351 "src/admin.rl" +#line 344 "src/admin.rl" {return -1;} goto st7; tr26: -#line 276 "src/admin.rl" +#line 269 "src/admin.rl" { start(out); tbuf_append(out, help, strlen(help)); @@ -485,9 +476,9 @@ case 145: } goto st7; tr37: -#line 337 "src/admin.rl" +#line 330 "src/admin.rl" {strend = p;} -#line 282 "src/admin.rl" +#line 275 "src/admin.rl" { strstart[strend-strstart]='\0'; start(out); @@ -496,7 +487,7 @@ case 145: } goto st7; tr44: -#line 289 "src/admin.rl" +#line 282 "src/admin.rl" { if (reload_cfg(err)) fail(out, err); @@ -505,11 +496,11 @@ case 145: } goto st7; tr68: -#line 363 "src/admin.rl" +#line 355 "src/admin.rl" {coredump(60); ok(out);} goto st7; tr77: -#line 296 "src/admin.rl" +#line 289 "src/admin.rl" { int ret = snapshot(); @@ -524,9 +515,9 @@ case 145: } goto st7; tr99: -#line 347 "src/admin.rl" +#line 340 "src/admin.rl" { state = false; } -#line 309 "src/admin.rl" +#line 302 "src/admin.rl" { strstart[strend-strstart] = '\0'; if (errinj_set_byname(strstart, state)) { @@ -538,9 +529,9 @@ case 145: } goto st7; tr102: -#line 346 "src/admin.rl" +#line 339 "src/admin.rl" { state = true; } -#line 309 "src/admin.rl" +#line 302 "src/admin.rl" { strstart[strend-strstart] = '\0'; if (errinj_set_byname(strstart, state)) { @@ -552,7 +543,7 @@ case 145: } goto st7; tr118: -#line 264 "src/admin.rl" +#line 257 "src/admin.rl" { start(out); show_cfg(out); @@ -560,52 +551,44 @@ case 145: } goto st7; tr132: -#line 355 "src/admin.rl" +#line 348 "src/admin.rl" {start(out); fiber_info(out); end(out);} goto st7; tr140: -#line 354 "src/admin.rl" +#line 347 "src/admin.rl" {start(out); index_info(out); end(out);} goto st7; tr142: -#line 353 "src/admin.rl" +#line 346 "src/admin.rl" {start(out); tarantool_info(out); end(out);} goto st7; tr153: -#line 270 "src/admin.rl" +#line 263 "src/admin.rl" { start(out); errinj_info(out); end(out); } goto st7; -tr160: -#line 358 "src/admin.rl" +tr159: +#line 351 "src/admin.rl" {start(out); palloc_stat(out); end(out);} goto st7; -tr171: -#line 258 "src/admin.rl" - { - start(out); - show_plugins_stat(out); - end(out); - } - goto st7; -tr175: -#line 357 "src/admin.rl" +tr167: +#line 350 "src/admin.rl" {start(out); show_slab(out); end(out);} goto st7; -tr179: -#line 359 "src/admin.rl" +tr171: +#line 352 "src/admin.rl" {start(out); show_stat(out);end(out);} goto st7; st7: if ( ++p == pe ) goto _test_eof7; case 7: -#line 607 "src/admin.cc" +#line 590 "src/admin.cc" if ( (*p) == 10 ) - goto st145; + goto st139; goto st0; st8: if ( ++p == pe ) @@ -756,28 +739,28 @@ case 23: } goto tr33; tr33: -#line 337 "src/admin.rl" +#line 330 "src/admin.rl" {strstart = p;} goto st24; st24: if ( ++p == pe ) goto _test_eof24; case 24: -#line 767 "src/admin.cc" +#line 750 "src/admin.cc" switch( (*p) ) { case 10: goto tr36; case 13: goto tr37; } goto st24; tr34: -#line 337 "src/admin.rl" +#line 330 "src/admin.rl" {strstart = p;} goto st25; st25: if ( ++p == pe ) goto _test_eof25; case 25: -#line 781 "src/admin.cc" +#line 764 "src/admin.cc" switch( (*p) ) { case 10: goto tr36; case 13: goto tr37; @@ -1227,28 +1210,28 @@ case 73: goto tr91; goto st0; tr91: -#line 345 "src/admin.rl" +#line 338 "src/admin.rl" { strstart = p; } goto st74; st74: if ( ++p == pe ) goto _test_eof74; case 74: -#line 1238 "src/admin.cc" +#line 1221 "src/admin.cc" if ( (*p) == 32 ) goto tr92; if ( 33 <= (*p) && (*p) <= 126 ) goto st74; goto st0; tr92: -#line 345 "src/admin.rl" +#line 338 "src/admin.rl" { strend = p; } goto st75; st75: if ( ++p == pe ) goto _test_eof75; case 75: -#line 1252 "src/admin.cc" +#line 1235 "src/admin.cc" switch( (*p) ) { case 32: goto st75; case 111: goto st76; @@ -1365,7 +1348,7 @@ case 87: case 88: switch( (*p) ) { case 32: goto st89; - case 111: goto st143; + case 111: goto st137; } goto st0; st89: @@ -1378,7 +1361,7 @@ case 89: case 102: goto st103; case 105: goto st108; case 112: goto st124; - case 115: goto st136; + case 115: goto st130; } goto st0; st90: @@ -1704,18 +1687,16 @@ case 123: if ( ++p == pe ) goto _test_eof124; case 124: - switch( (*p) ) { - case 97: goto st125; - case 108: goto st130; - } + if ( (*p) == 97 ) + goto st125; goto st0; st125: if ( ++p == pe ) goto _test_eof125; case 125: switch( (*p) ) { - case 10: goto tr159; - case 13: goto tr160; + case 10: goto tr158; + case 13: goto tr159; case 108: goto st126; } goto st0; @@ -1724,8 +1705,8 @@ case 125: goto _test_eof126; case 126: switch( (*p) ) { - case 10: goto tr159; - case 13: goto tr160; + case 10: goto tr158; + case 13: goto tr159; case 108: goto st127; } goto st0; @@ -1734,8 +1715,8 @@ case 126: goto _test_eof127; case 127: switch( (*p) ) { - case 10: goto tr159; - case 13: goto tr160; + case 10: goto tr158; + case 13: goto tr159; case 111: goto st128; } goto st0; @@ -1744,8 +1725,8 @@ case 127: goto _test_eof128; case 128: switch( (*p) ) { - case 10: goto tr159; - case 13: goto tr160; + case 10: goto tr158; + case 13: goto tr159; case 99: goto st129; } goto st0; @@ -1754,44 +1735,57 @@ case 128: goto _test_eof129; case 129: switch( (*p) ) { - case 10: goto tr159; - case 13: goto tr160; + case 10: goto tr158; + case 13: goto tr159; } goto st0; st130: if ( ++p == pe ) goto _test_eof130; case 130: - if ( (*p) == 117 ) - goto st131; + switch( (*p) ) { + case 108: goto st131; + case 116: goto st134; + } goto st0; st131: if ( ++p == pe ) goto _test_eof131; case 131: - if ( (*p) == 103 ) - goto st132; + switch( (*p) ) { + case 10: goto tr166; + case 13: goto tr167; + case 97: goto st132; + } goto st0; st132: if ( ++p == pe ) goto _test_eof132; case 132: - if ( (*p) == 105 ) - goto st133; + switch( (*p) ) { + case 10: goto tr166; + case 13: goto tr167; + case 98: goto st133; + } goto st0; st133: if ( ++p == pe ) goto _test_eof133; case 133: - if ( (*p) == 110 ) - goto st134; + switch( (*p) ) { + case 10: goto tr166; + case 13: goto tr167; + } goto st0; st134: if ( ++p == pe ) goto _test_eof134; case 134: - if ( (*p) == 115 ) - goto st135; + switch( (*p) ) { + case 10: goto tr170; + case 13: goto tr171; + case 97: goto st135; + } goto st0; st135: if ( ++p == pe ) @@ -1800,6 +1794,7 @@ case 135: switch( (*p) ) { case 10: goto tr170; case 13: goto tr171; + case 116: goto st136; } goto st0; st136: @@ -1807,8 +1802,8 @@ case 135: goto _test_eof136; case 136: switch( (*p) ) { - case 108: goto st137; - case 116: goto st140; + case 10: goto tr170; + case 13: goto tr171; } goto st0; st137: @@ -1816,72 +1811,14 @@ case 136: goto _test_eof137; case 137: switch( (*p) ) { - case 10: goto tr174; - case 13: goto tr175; - case 97: goto st138; + case 32: goto st89; + case 119: goto st138; } goto st0; st138: if ( ++p == pe ) goto _test_eof138; case 138: - switch( (*p) ) { - case 10: goto tr174; - case 13: goto tr175; - case 98: goto st139; - } - goto st0; -st139: - if ( ++p == pe ) - goto _test_eof139; -case 139: - switch( (*p) ) { - case 10: goto tr174; - case 13: goto tr175; - } - goto st0; -st140: - if ( ++p == pe ) - goto _test_eof140; -case 140: - switch( (*p) ) { - case 10: goto tr178; - case 13: goto tr179; - case 97: goto st141; - } - goto st0; -st141: - if ( ++p == pe ) - goto _test_eof141; -case 141: - switch( (*p) ) { - case 10: goto tr178; - case 13: goto tr179; - case 116: goto st142; - } - goto st0; -st142: - if ( ++p == pe ) - goto _test_eof142; -case 142: - switch( (*p) ) { - case 10: goto tr178; - case 13: goto tr179; - } - goto st0; -st143: - if ( ++p == pe ) - goto _test_eof143; -case 143: - switch( (*p) ) { - case 32: goto st89; - case 119: goto st144; - } - goto st0; -st144: - if ( ++p == pe ) - goto _test_eof144; -case 144: if ( (*p) == 32 ) goto st89; goto st0; @@ -1891,7 +1828,7 @@ case 144: _test_eof4: cs = 4; goto _test_eof; _test_eof5: cs = 5; goto _test_eof; _test_eof6: cs = 6; goto _test_eof; - _test_eof145: cs = 145; goto _test_eof; + _test_eof139: cs = 139; goto _test_eof; _test_eof7: cs = 7; goto _test_eof; _test_eof8: cs = 8; goto _test_eof; _test_eof9: cs = 9; goto _test_eof; @@ -2024,18 +1961,12 @@ case 144: _test_eof136: cs = 136; goto _test_eof; _test_eof137: cs = 137; goto _test_eof; _test_eof138: cs = 138; goto _test_eof; - _test_eof139: cs = 139; goto _test_eof; - _test_eof140: cs = 140; goto _test_eof; - _test_eof141: cs = 141; goto _test_eof; - _test_eof142: cs = 142; goto _test_eof; - _test_eof143: cs = 143; goto _test_eof; - _test_eof144: cs = 144; goto _test_eof; _test_eof: {} _out: {} } -#line 371 "src/admin.rl" +#line 363 "src/admin.rl" in->pos = pe; diff --git a/src/admin.rl b/src/admin.rl index 073461ec6fd08255c303ca0728612b16deae949c..b4df59644b9d46069cfc0f941754bcc65111fdfb 100644 --- a/src/admin.rl +++ b/src/admin.rl @@ -68,7 +68,6 @@ static const char *help = " - show slab" CRLF " - show palloc" CRLF " - show stat" CRLF - " - show plugins" CRLF " - save coredump" CRLF " - save snapshot" CRLF " - lua command" CRLF @@ -255,12 +254,6 @@ admin_dispatch(struct ev_io *coio, struct iobuf *iobuf, lua_State *L) p = in->pos; %%{ - action show_plugins { - start(out); - show_plugins_stat(out); - end(out); - } - action show_configuration { start(out); show_cfg(out); @@ -358,7 +351,6 @@ admin_dispatch(struct ev_io *coio, struct iobuf *iobuf, lua_State *L) show " "+ palloc %{start(out); palloc_stat(out); end(out);} | show " "+ stat %{start(out); show_stat(out);end(out);} | show " "+ injections %show_injections | - show " "+ plugins %show_plugins | set " "+ injection " "+ name " "+ state %set_injection | save " "+ coredump %{coredump(60); ok(out);} | save " "+ snapshot %save_snapshot | diff --git a/src/box/CMakeLists.txt b/src/box/CMakeLists.txt index 839df7bbdb8a67d22a483b374410ed0b20939b62..468ce92577aa9e0657857e31ec4a050d972d1135 100644 --- a/src/box/CMakeLists.txt +++ b/src/box/CMakeLists.txt @@ -8,7 +8,6 @@ set(lua_sources) lua_source(lua_sources lua/box.lua) lua_source(lua_sources lua/box_net.lua) lua_source(lua_sources lua/misc.lua) -lua_source(lua_sources lua/sql.lua) add_custom_target(box_generate_lua_sources WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src/box diff --git a/src/box/box_lua.cc b/src/box/box_lua.cc index b64d76bb7993eb2f70f8342c169297fe1d0d6444..5571340f1ba190e4491afb3f201683f55890255b 100644 --- a/src/box/box_lua.cc +++ b/src/box/box_lua.cc @@ -54,8 +54,8 @@ extern "C" { #include "scoped_guard.h" /* contents of box.lua, misc.lua, box.net.lua respectively */ -extern char box_lua[], box_net_lua[], misc_lua[], sql_lua[]; -static const char *lua_sources[] = { box_lua, box_net_lua, misc_lua, sql_lua, NULL }; +extern char box_lua[], box_net_lua[], misc_lua[]; +static const char *lua_sources[] = { box_lua, box_net_lua, misc_lua, NULL }; /** * All box connections share the same Lua state. We use diff --git a/src/lua/init.cc b/src/lua/init.cc index ed78c07fcf4a5c6b718a1e72b0ebff26070a68bd..124bf36fc5c96d5f5ae74c49dd4b69b8eb3c2942 100644 --- a/src/lua/init.cc +++ b/src/lua/init.cc @@ -60,11 +60,8 @@ extern "C" { #include <dlfcn.h> #include <dirent.h> #include <stdio.h> -#include "tarantool/plugin.h" #include "scoped_guard.h" -static RLIST_HEAD(loaded_plugins); - extern "C" { #include <cfg/tarantool_box_cfg.h> } /* extern "C" */ @@ -1186,126 +1183,6 @@ tarantool_lua_setpath(struct lua_State *L, const char *type, ...) lua_pop(L, 1); } -/** - * show statistics for all loaded plugins - */ -void -show_plugins_stat(struct tbuf *out) -{ - tbuf_printf(out, "plugins:\n"); - struct tarantool_plugin *p; - rlist_foreach_entry(p, &loaded_plugins, list) { - tbuf_printf(out, - " - { name: \"%s\", version: %d", - p->name, - p->version - ); - if (p->stat) { - tbuf_printf(out, ", stat: "); - p->stat(out); - } - tbuf_printf(out, " }\n"); - } -} - -static void -tarantool_load_plugin(struct lua_State *L, const char *plugin) -{ - if (strstr(plugin, ".so") == NULL) - return; - - say_info("Loading plugin: %s", plugin); - - void *dl = dlopen(plugin, RTLD_NOW); - if (!dl) { - say_error("Can't load plugin %s: %s", plugin, dlerror()); - return; - } - - struct tarantool_plugin *p = (typeof(p))dlsym(dl, "plugin_meta"); - - if (!p) { - say_error("Can't find plugin metadata in plugin %s", plugin); - dlclose(dl); - return; - } - - if (p->api_version != PLUGIN_API_VERSION) { - say_error("Plugin %s has api_version: %d but tarantool has: %d", - plugin, - p->api_version, - PLUGIN_API_VERSION); - return; - } - - rlist_add_entry(&loaded_plugins, p, list); - - if (p->init) - p->init(L); - - say_info("Plugin '%s' was loaded, version: %d", p->name, p->version); -} - -static void -tarantool_plugins_dir(struct lua_State *L, const char *dir) -{ - if (!dir) - return; - if (!*dir) - return; - DIR *dh = opendir(dir); - - if (!dh) - return; - - struct dirent * dent; - while ((dent = readdir(dh)) != NULL) { - if (dent->d_type != DT_REG) - continue; - char *path; - asprintf(&path, "%s/%s", dir, dent->d_name); - if (!path) { - say_error("Can't allocate memory for %s plugin dir", - dir); - continue; - } - - tarantool_load_plugin(L, path); - - free(path); - } - - closedir(dh); -} - -static void -tarantool_plugins_init(struct lua_State *L) -{ - int top = lua_gettop(L); - - char *plugins = getenv("TARANTOOL_PLUGIN_DIR"); - - if (plugins) { - plugins = strdup(plugins); - char *ptr = plugins; - for (;;) { - char *divider = strchr(ptr, ':'); - if (divider == NULL) { - tarantool_plugins_dir(L, ptr); - break; - } - *divider = 0; - tarantool_plugins_dir(L, ptr); - ptr = divider + 1; - } - free(plugins); - } - - tarantool_plugins_dir(L, PLUGIN_DIR); - - lua_settop(L, top); -} - struct lua_State * tarantool_lua_init() { @@ -1371,9 +1248,6 @@ tarantool_lua_init() mod_lua_init(L); - /* init after internal luas are processed */ - tarantool_plugins_init(L); - /* clear possible left-overs of init */ lua_settop(L, 0); return L; diff --git a/src/plugin/CMakeLists.txt b/src/module/CMakeLists.txt similarity index 67% rename from src/plugin/CMakeLists.txt rename to src/module/CMakeLists.txt index 11853612e6329d8385e4881a2d57a8ddc9bba4e4..293ce2e04fa816d455812e08148e913534e69aa9 100644 --- a/src/plugin/CMakeLists.txt +++ b/src/module/CMakeLists.txt @@ -1,3 +1,3 @@ +add_subdirectory(sql) add_subdirectory(pg) add_subdirectory(mysql) - diff --git a/src/plugin/mysql/CMakeLists.txt b/src/module/mysql/CMakeLists.txt similarity index 59% rename from src/plugin/mysql/CMakeLists.txt rename to src/module/mysql/CMakeLists.txt index e7ea8df5751a432550238b7b2c5f9b40f3602cdd..3851206dbaf36cc781fcbd440748274b1b346f25 100644 --- a/src/plugin/mysql/CMakeLists.txt +++ b/src/module/mysql/CMakeLists.txt @@ -1,13 +1,11 @@ find_optional_package(MySQL) if (MYSQL_FOUND) - message(STATUS "box.net.sql(mysql) INC=${MYSQL_INCLUDE_DIRS}") - message(STATUS "box.net.sql(mysql) LIBS=${MYSQL_LIBRARIES}") - include_directories(${MYSQL_INCLUDE_DIRS}) add_library(mysql SHARED mysql.cc) target_link_libraries(mysql ${MYSQL_LIBRARIES} -rdynamic) - install(TARGETS mysql LIBRARY DESTINATION ${PLUGIN_DIR}) + set_target_properties(mysql PROPERTIES PREFIX "") + install(TARGETS mysql LIBRARY DESTINATION ${MODULE_DIR}/box/net) else() message(STATUS "MySQL client not found, box.net.sql(mysql) disabled") endif() diff --git a/src/plugin/mysql/mysql.cc b/src/module/mysql/mysql.cc similarity index 98% rename from src/plugin/mysql/mysql.cc rename to src/module/mysql/mysql.cc index 14cbfd5be26a9e6e3f7d0f5d3157c67588eb9392..8613dc3bfceaba45c5380ba548835a7c2f34ebbd 100644 --- a/src/plugin/mysql/mysql.cc +++ b/src/module/mysql/mysql.cc @@ -27,10 +27,6 @@ * SUCH DAMAGE. */ - -#define PLUGIN_NAME "mysql" -#define PLUGIN_VERSION 1 - #include <stddef.h> extern "C" { @@ -46,15 +42,11 @@ extern "C" { #include <coeio.h> #include <tarantool_ev.h> - #include <lua/init.h> #include <say.h> #include <mysql.h> #include <scoped_guard.h> -#include <tarantool/plugin.h> - - /** * gets MYSQL connector from lua stack (or object) */ @@ -465,9 +457,11 @@ lbox_net_mysql_connect(struct lua_State *L) return 1; } +extern "C" { + int LUA_API luaopen_box_net_mysql(lua_State*); +} -static void -init(struct lua_State *L) +int LUA_API luaopen_box_net_mysql(lua_State *L) { lua_getfield(L, LUA_GLOBALSINDEX, "box"); /* stack: box */ @@ -487,6 +481,5 @@ init(struct lua_State *L) /* cleanup stack */ lua_pop(L, 4); + return 0; } - -DECLARE_PLUGIN(PLUGIN_NAME, PLUGIN_VERSION, init, NULL); diff --git a/src/plugin/pg/CMakeLists.txt b/src/module/pg/CMakeLists.txt similarity index 68% rename from src/plugin/pg/CMakeLists.txt rename to src/module/pg/CMakeLists.txt index dcaf15475d4c33dd6ad7b3008ed5bc11ee30a45c..7c9a002a6b3139ead094a9c4e780c79ce1f21f89 100644 --- a/src/plugin/pg/CMakeLists.txt +++ b/src/module/pg/CMakeLists.txt @@ -1,16 +1,13 @@ # A special hack for buggy FindPostgreSQL.cmake in Debian/Ubuntu set(PostgreSQL_ROOT /usr/include/postgresql;/usr/include/postgres) find_optional_package(PostgreSQL) -if (PostgreSQL_FOUND) - message(STATUS "box.net.sql(pg): INC=${PostgreSQL_INCLUDE_DIRS}") - message(STATUS "box.net.sql(pg): LIBS=${PostgreSQL_LIBRARIES}") +if (PostgreSQL_FOUND) include_directories(${PostgreSQL_INCLUDE_DIRS}) add_library(pg SHARED pg.cc) target_link_libraries(pg ${PostgreSQL_LIBRARIES} -rdynamic) - install(TARGETS pg LIBRARY DESTINATION ${PLUGIN_DIR}) - + set_target_properties(pg PROPERTIES PREFIX "") + install(TARGETS pg LIBRARY DESTINATION ${MODULE_DIR}/box/net) else() message(STATUS "PostgreSQL client not found, box.net.sql(pg) disabled") endif() - diff --git a/src/plugin/pg/pg.cc b/src/module/pg/pg.cc similarity index 98% rename from src/plugin/pg/pg.cc rename to src/module/pg/pg.cc index 754fcc425a9e0e43b2b89048c9227f15640cbc0f..58d4adbd9a3d7fa3dbb0b742ae2f21d0698b45d5 100644 --- a/src/plugin/pg/pg.cc +++ b/src/module/pg/pg.cc @@ -34,8 +34,6 @@ extern "C" { #undef PACKAGE_VERSION } -#define PLUGIN_VERSION 1 -#define PLUGIN_NAME "postgresql" #include <stddef.h> extern "C" { @@ -43,7 +41,6 @@ extern "C" { #include <lauxlib.h> #include <lualib.h> } -#include <tarantool/plugin.h> #include <stdio.h> #include <stdlib.h> @@ -52,7 +49,6 @@ extern "C" { #include <coeio.h> #include <tarantool_ev.h> - #include <lua/init.h> #include <say.h> #include <scoped_guard.h> @@ -491,9 +487,11 @@ lbox_net_pg_connect(struct lua_State *L) return 1; } +extern "C" { + int LUA_API luaopen_box_net_pg(lua_State*); +} -static void -init(struct lua_State *L) +int LUA_API luaopen_box_net_pg(lua_State *L) { lua_getfield(L, LUA_GLOBALSINDEX, "box"); /* stack: box */ @@ -506,9 +504,6 @@ init(struct lua_State *L) lua_pushstring(L, "connectors"); lua_rawget(L, -2); /* stack: box.net.sql.connectors */ - - - /* stack: box, box.net.sql.connectors */ lua_pushstring(L, "pg"); lua_pushcfunction(L, lbox_net_pg_connect); @@ -521,7 +516,5 @@ init(struct lua_State *L) /* cleanup stack */ lua_pop(L, 4); + return 0; } - - -DECLARE_PLUGIN(PLUGIN_NAME, PLUGIN_VERSION, init, NULL); diff --git a/src/module/sql/CMakeLists.txt b/src/module/sql/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..778a0515199838556d506ffd992e2995b6c82a0e --- /dev/null +++ b/src/module/sql/CMakeLists.txt @@ -0,0 +1,2 @@ + +install(FILES ${PROJECT_BINARY_DIR}/src/module/sql/sql.lua DESTINATION ${MODULE_DIR}/box/net) diff --git a/src/box/lua/sql.lua b/src/module/sql/sql.lua similarity index 100% rename from src/box/lua/sql.lua rename to src/module/sql/sql.lua diff --git a/test/box/admin.result b/test/box/admin.result index b8fd3e0e1a4f3752909bf977520a6e12d8479103..7525f9513f15518161f8b3a75d7d73333c27582f 100644 --- a/test/box/admin.result +++ b/test/box/admin.result @@ -21,7 +21,6 @@ available commands: - show slab - show palloc - show stat - - show plugins - save coredump - save snapshot - lua command diff --git a/test/box/net_sql.common.lua b/test/box/net_sql.common.lua new file mode 100644 index 0000000000000000000000000000000000000000..715defa4329f047bde96bf188d89845fb69d2c5f --- /dev/null +++ b/test/box/net_sql.common.lua @@ -0,0 +1,5 @@ +package.path = "../../src/module/sql/?.lua;"..package.path +require("sql") +if type(box.net.sql) ~= "table" then + error("net.sql load failed") +end diff --git a/test/box/net_sql.common.result b/test/box/net_sql.common.result index 673688104f98221cb5585c4a5055a998cded9c4c..2d077342608b7be479ad3ca5c7a9e20d95954ee0 100644 --- a/test/box/net_sql.common.result +++ b/test/box/net_sql.common.result @@ -1,12 +1,8 @@ -lua c = box.net.sql.connect('abcd') ---- -error: '[string "-- sql.lua (internal file)..."]:29: Unknown driver ''abcd''' -... -lua c = box.net.sql.connect('mysql') +lua type(box.net.sql) --- -error: '[string "-- sql.lua (internal file)..."]:64: Usage: box.net.sql.connect(''mysql'', host, port, user, password, db, ...)' + - table ... -lua c = box.net.sql.connect('pg') +lua c = box.net.sql.connect('abcd') --- -error: '[string "-- sql.lua (internal file)..."]:64: Usage: box.net.sql.connect(''pg'', host, port, user, password, db, ...)' +error: '../../src/module/sql/sql.lua:29: Unknown driver ''abcd''' ... diff --git a/test/box/net_sql.common.skipcond b/test/box/net_sql.common.skipcond deleted file mode 100644 index 8ae9523c3e5ec5d0f5b4906d396c876170a77be5..0000000000000000000000000000000000000000 --- a/test/box/net_sql.common.skipcond +++ /dev/null @@ -1,18 +0,0 @@ -# encoding: tarantool - -import os - -try: - (host, port, user, password, db) = os.getenv('MYSQL').split(':') - -except (RuntimeError, TypeError, NameError, AttributeError, ValueError): - self.skip = 1 - - -import os - -try: - (host, port, user, password, db) = os.getenv('PG').split(':') - -except (RuntimeError, TypeError, NameError, AttributeError, ValueError): - self.skip = 1 diff --git a/test/box/net_sql.common.test b/test/box/net_sql.common.test index 8a5340f369a37a2614e86a74dcf900ed32f51916..0dae9b7c18b97065c034cf5f6daed09a885b50db 100644 --- a/test/box/net_sql.common.test +++ b/test/box/net_sql.common.test @@ -1,7 +1,8 @@ # encoding: tarantool -exec admin "lua c = box.net.sql.connect('abcd')" +server.stop() +server.deploy(init_lua="box/net_sql.common.lua") -exec admin "lua c = box.net.sql.connect('mysql')" -exec admin "lua c = box.net.sql.connect('pg')" +exec admin "lua type(box.net.sql)" +exec admin "lua c = box.net.sql.connect('abcd')" diff --git a/test/box/net_sql.mysql.lua b/test/box/net_sql.mysql.lua new file mode 100644 index 0000000000000000000000000000000000000000..d3ff697f2492ed4360d0aef96ffcf1df9c45f27d --- /dev/null +++ b/test/box/net_sql.mysql.lua @@ -0,0 +1,6 @@ +package.path = "../../src/module/sql/?.lua;"..package.path +require("sql") +if type(box.net.sql) ~= "table" then + error("net.sql load failed") +end +require("box.net.mysql") diff --git a/test/box/net_sql.mysql.result b/test/box/net_sql.mysql.result index 5efafb0d52196f3e9a7fec64480a1d5235d1320c..dcd94189e6bde59a4fb0c9acc333da4fcb222173 100644 --- a/test/box/net_sql.mysql.result +++ b/test/box/net_sql.mysql.result @@ -2,6 +2,10 @@ lua c = box.net.sql.connect('abcd') --- error: '[string "-- sql.lua (internal file)..."]:29: Unknown driver ''abcd''' ... +lua c = box.net.sql.connect('mysql') +--- +error: '[string "-- sql.lua (internal file)..."]:64: Usage: box.net.sql.connect(''mysql'', host, port, user, password, db, ...)' +... lua dump = function(v) return box.cjson.encode(v) end --- ... diff --git a/test/box/net_sql.mysql.test b/test/box/net_sql.mysql.test index 3ff9a9d3960805d0852d61d518e9759be4ad171d..ea112574d5e4298d8dc199d15e0894298471c39f 100644 --- a/test/box/net_sql.mysql.test +++ b/test/box/net_sql.mysql.test @@ -1,4 +1,14 @@ # encoding: tarantool +import os +import shutil + +module_path = os.path.join(vardir, "box/net") +module_path_so = module_path + "/mysql.so" +os.makedirs(module_path) +shutil.copy("../src/module/mysql/mysql.so", module_path_so) + +server.stop() +server.deploy(init_lua="box/net_sql.mysql.lua") exec admin "lua c = box.net.sql.connect('abcd')" exec admin "lua dump = function(v) return box.cjson.encode(v) end" @@ -26,3 +36,5 @@ exec admin "lua c:rollback()" exec admin "lua c:begin_work()" exec admin "lua c:commit()" +os.unlink(module_path_so) +os.removedirs(module_path) diff --git a/test/box/net_sql.pg.lua b/test/box/net_sql.pg.lua new file mode 100644 index 0000000000000000000000000000000000000000..6711d955d3d5ee4d9146eaf87c16ae3d5a205773 --- /dev/null +++ b/test/box/net_sql.pg.lua @@ -0,0 +1,6 @@ +package.path = "../../src/module/sql/?.lua;"..package.path +require("sql") +if type(box.net.sql) ~= "table" then + error("net.sql load failed") +end +require("box.net.pg") diff --git a/test/box/net_sql.pg.result b/test/box/net_sql.pg.result index 091b4e5a659e9a9cd9b0c1908ea8bc719c412b4f..c0477b13e5d67834d2aad464014cc9ac0cc34f82 100644 --- a/test/box/net_sql.pg.result +++ b/test/box/net_sql.pg.result @@ -1,6 +1,10 @@ lua c = box.net.sql.connect('abcd') --- -error: '[string "-- sql.lua (internal file)..."]:29: Unknown driver ''abcd''' +error: '../../src/module/sql/sql.lua:29: Unknown driver ''abcd''' +... +lua c = box.net.sql.connect('pg') +--- +error: '../../src/module/sql/sql.lua:64: Usage: box.net.sql.connect(''pg'', host, port, user, password, db, ...)' ... lua dump = function(v) return box.cjson.encode(v) end --- @@ -68,7 +72,7 @@ lua dump({c:select('SELECT * FROM (VALUES (1,2), (2,3)) t')}) ... lua dump({c:single('SELECT * FROM (VALUES (1,2), (2,3)) t')}) --- -error: '[string "-- sql.lua (internal file)..."]:156: SQL request returned multiply rows' +error: '../../src/module/sql/sql.lua:156: SQL request returned multiply rows' ... lua dump({c:single('SELECT * FROM (VALUES (1,2)) t')}) --- @@ -80,14 +84,14 @@ lua dump({c:perform('SELECT * FROM (VALUES (1,2), (2,3)) t')}) ... lua c:execute('SELEC T') --- -error: '[string "-- sql.lua (internal file)..."]:105: ERROR: syntax error at or near "SELEC" +error: '../../src/module/sql/sql.lua:105: ERROR: syntax error at or near "SELEC" LINE 1: SELEC T ^ ' ... lua c = box.net.sql.connect('abcd') --- -error: '[string "-- sql.lua (internal file)..."]:29: Unknown driver ''abcd''' +error: '../../src/module/sql/sql.lua:29: Unknown driver ''abcd''' ... lua c:quote('abc"cde"def') --- diff --git a/test/box/net_sql.pg.test b/test/box/net_sql.pg.test index df3c338f032158dd13309fe4a6361c6857cc19ca..b78e9274338b5cd71bfcdfbcdb1227c55767d938 100644 --- a/test/box/net_sql.pg.test +++ b/test/box/net_sql.pg.test @@ -1,6 +1,18 @@ # encoding: tarantool +import os +import shutil + +module_path = os.path.join(vardir, "box/net") +module_path_so = module_path + "/pg.so" +os.makedirs(module_path) +shutil.copy("../src/module/pg/pg.so", module_path_so) + +server.stop() +server.deploy(init_lua="box/net_sql.pg.lua") exec admin "lua c = box.net.sql.connect('abcd')" +exec admin "lua c = box.net.sql.connect('pg')" + exec admin "lua dump = function(v) return box.cjson.encode(v) end" exec admin "lua connect = {}" @@ -39,3 +51,5 @@ exec admin "lua c:commit()" exec admin "lua c:txn(function(dbi) dbi:single('SELECT 1') end)" +os.unlink(module_path_so) +os.removedirs(module_path)