1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

o Improved the mysql library to handle multiple columns with the same name,

added a formatResultset function to format a query response to a table
  suitable for script output. [Patrik Karlsson]
This commit is contained in:
patrik
2012-05-19 12:23:41 +00:00
parent 660cb42825
commit 425ced35ab
7 changed files with 69 additions and 36 deletions

View File

@@ -89,10 +89,10 @@ action = function( host, port )
status, response = mysql.loginRequest( socket, { authversion = "post41", charset = response.charset }, username, password, response.salt )
if status and response.errorcode == 0 then
status, rows = mysql.sqlQuery( socket, "show variables" )
local status, rs = mysql.sqlQuery( socket, "show variables" )
if status then
for i=1, #rows do
table.insert(result, string.format("%s: %s" , rows[i]['Variable_name'], rows[i]['Value']) )
for _, row in ipairs(rs.rows) do
table.insert(result, ("%s: %s"):format(row[1], row[2]) )
end
end
end