#!/usr/bin/env sysbench
-- 执行 run 命令 触发的函数(开始压测),也就是真正开启事务进行压测的函数
function event()
-- 连接数据库
local drv = sysbench.sql.driver()
local con = drv:connect()
while (true)
do
con:query("BEGIN")
local result = con:query(" UPDATE table_1 SET username= 'tug666' WHERE city = '大连市' limit 5000 ")
con:query("COMMIT")
if result.row <= 0 then
break;
end
end
end
【问题描述(我做了什么)】
sysbench --config-file=config update.lua run
[tidb@test tidb-tools]$ sysbench --config-file=config update.lua run
sysbench 1.0.17 (using system LuaJIT 2.0.4)
Running the test with following options:
Number of threads: 16
Report intermediate results every 10 second(s)
Initializing random number generator from current time
Initializing worker threads...
Threads started!
FATAL: `thread_run' function failed: update.lua:15: attempt to compare 'struct 167' with 'number'
Error in my_thread_global_end(): 1 threads didn't exit
[tidb@test tidb-tools]$