mysql "serverStatus: 34" 响应 sails.js 中的水线 orm 是什么意思?
What means mysql "serverStatus: 34" in response of waterline orm in sails.js?
Sails.js 版本 0.12.13.
User.query(`CALL someProc()`, function(err, data){
console.log(data);
}
回复:
data: OkPacket {
fieldCount: 0,
affectedRows: 0,
insertId: 0,
serverStatus: 32,
warningCount: 0,
message: '',
protocol41: true,
changedRows: 0
}
"serverStatus: 32"是什么意思?
"serverStatus: 34" 是什么意思?
Sails 中 .query
调用的响应直接来自驱动程序,在本例中为 mysql. The serverStatus
is a bitfield. You can get the list of constants in the MySQL source code docs -- 列表中的第一个表示值 1
,接下来 2
,然后 4
,等等
所以serverStatus: 32
表示只设置第六位,对应SERVER_STATUS_CURSOR_EXISTS
:
The server was able to fulfill the clients request and opened a read-only non-scrollable cursor for a query.
This flag comes in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands. Used by Binary Protocol Resultset to signal that COM_STMT_FETCH must be used to fetch the row-data.
如果您看到 serverStatus: 34
,则表示上述 和 第二位 SERVER_STATUS_AUTOCOMMIT
已设置:
Server in auto_commit mode.
Sails.js 版本 0.12.13.
User.query(`CALL someProc()`, function(err, data){
console.log(data);
}
回复:
data: OkPacket {
fieldCount: 0,
affectedRows: 0,
insertId: 0,
serverStatus: 32,
warningCount: 0,
message: '',
protocol41: true,
changedRows: 0
}
"serverStatus: 32"是什么意思? "serverStatus: 34" 是什么意思?
Sails 中 .query
调用的响应直接来自驱动程序,在本例中为 mysql. The serverStatus
is a bitfield. You can get the list of constants in the MySQL source code docs -- 列表中的第一个表示值 1
,接下来 2
,然后 4
,等等
所以serverStatus: 32
表示只设置第六位,对应SERVER_STATUS_CURSOR_EXISTS
:
The server was able to fulfill the clients request and opened a read-only non-scrollable cursor for a query.
This flag comes in reply to COM_STMT_EXECUTE and COM_STMT_FETCH commands. Used by Binary Protocol Resultset to signal that COM_STMT_FETCH must be used to fetch the row-data.
如果您看到 serverStatus: 34
,则表示上述 和 第二位 SERVER_STATUS_AUTOCOMMIT
已设置:
Server in auto_commit mode.