diff --git a/examples/lua/build.sh b/examples/lua/build.sh index 1e6fef632ceb828c9e0eca1a02dc4a6654906474..5e856f3e9ef0c18b309c1b6fa66f8c79b7dec2dd 100755 --- a/examples/lua/build.sh +++ b/examples/lua/build.sh @@ -4,5 +4,5 @@ if [ "$lua_header_installed" = "0" ]; then sudo apt install -y liblua5.3-dev fi -gcc -std=c99 lua_connector.c -fPIC -shared -o luaconnector.so -Wall -ltaos -I/usr/include/lua5.3 -I../../include/client +gcc -g -std=c99 lua_connector.c -fPIC -shared -o luaconnector.so -Wall -ltaos -I/usr/include/lua5.3 -I../../include/client diff --git a/examples/lua/lua51/lua_connector51.c b/examples/lua/lua51/lua_connector51.c index 8a9051dd0cb3da0fd82e752132d499a5935be758..c5ef9126a644cae83a730f5d39d501713aff9db5 100644 --- a/examples/lua/lua51/lua_connector51.c +++ b/examples/lua/lua51/lua_connector51.c @@ -67,7 +67,7 @@ static int l_connect(lua_State *L){ taos = taos_connect(host, user,password,database, port); if (taos == NULL) { - printf("failed to connect server, reason:%s\n", taos_errstr(taos)); + //printf("failed to connect server, reason:%s\n", taos_errstr(taos)); lua_pushinteger(L, -1); lua_setfield(L, table_index, "code"); @@ -79,7 +79,7 @@ static int l_connect(lua_State *L){ // printf("success to connect server\n"); lua_pushinteger(L, 0); lua_setfield(L, table_index, "code"); - lua_pushstring(L, taos_errstr(taos)); + lua_pushstring(L, "success"); lua_setfield(L, table_index, "error"); lua_pushlightuserdata(L,taos); lua_setfield(L, table_index, "conn"); diff --git a/examples/lua/lua_connector.c b/examples/lua/lua_connector.c index c3d8bcb99548c787953cd27bcbb90b6c63ee5a4a..5d8226f2623f6451ef77b71dac1a6583ba6c460b 100644 --- a/examples/lua/lua_connector.c +++ b/examples/lua/lua_connector.c @@ -67,8 +67,7 @@ static int l_connect(lua_State *L){ taos = taos_connect(host, user,password,database, port); if (taos == NULL) { - printf("failed to connect server, reason:%s\n", taos_errstr(taos)); - +// printf("failed to connect server, reason:%s\n", taos_errstr(NULL)); lua_pushinteger(L, -1); lua_setfield(L, table_index, "code"); lua_pushstring(L, taos_errstr(taos)); @@ -79,7 +78,7 @@ static int l_connect(lua_State *L){ // printf("success to connect server\n"); lua_pushinteger(L, 0); lua_setfield(L, table_index, "code"); - lua_pushstring(L, taos_errstr(taos)); + lua_pushstring(L, "success"); lua_setfield(L, table_index, "error"); lua_pushlightuserdata(L,taos); lua_setfield(L, table_index, "conn");