snower / TorMySQL

The highest performance asynchronous MySQL driver by PyMySQL
MIT License
308 stars 63 forks source link

cursor execute 使用args参数返回为空 #34

Closed tqlihuiqi closed 6 years ago

tqlihuiqi commented 6 years ago

code

    with (yield self.pool.Connection()) as conn:
        with conn.cursor() as cursor:
            rows = yield cursor.execute(sql, tuple(args))
            data = cursor.fetchall()

    raise Return((rows, data))

执行返回结果为 0, ()

但如果将sql格式化好,不使用args则运行正常。

code sql = sql % tuple(args) with (yield self.pool.Connection()) as conn: with conn.cursor() as cursor: rows = yield cursor.execute(sql) data = cursor.fetchall()

    raise Return((rows, data))