From f2d3bc3e5c061999acf55eb0d10adda0c2f87d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=89=E6=9C=8B?= Date: Tue, 17 Dec 2019 19:10:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=8D=95=E5=85=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/testmysql.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/testmysql.lua b/test/testmysql.lua index 0b11aeb7..9649b660 100644 --- a/test/testmysql.lua +++ b/test/testmysql.lua @@ -68,6 +68,13 @@ local function test3( db) i=i+1 end end +local function test4( db) + local stmt = db:prepare("SELECT * FROM cats WHERE name=?") + print ( "test4 prepare result=",dump( stmt ) ) + local res = db:execute(stmt,'Bob') + print ( "test4 query result=",dump( res ) ) + db:stmt_close(stmt) +end skynet.start(function() local function on_connect(db) @@ -102,6 +109,7 @@ skynet.start(function() -- test in another coroutine skynet.fork( test2, db) skynet.fork( test3, db) + skynet.fork( test4, db) -- multiresultset test res = db:query("select * from cats order by id asc ; select * from cats") print ("multiresultset test result=", dump( res ) )