Commit 83316242 authored by enured's avatar enured
Browse files

B11325 SQL CALL is handled seperate. All statements will execute. If only a...

B11325 SQL CALL is handled seperate. All statements will execute. If only a SELECT statement is used in PROCEDURE then the output will shown, otherwise not.
parent ccbda057
Pipeline #6915 passed with stage
in 2 minutes and 12 seconds
......@@ -441,7 +441,6 @@ class Database {
case 'SHOW':
case 'DESCRIBE':
case 'EXPLAIN':
case 'CALL':
if (false === ($result = $this->mysqli_stmt->get_result())) {
throw new \DbException(
json_encode([ERROR_MESSAGE_TO_USER => 'Error DB execute', ERROR_MESSAGE_TO_DEVELOPER => '[ mysqli: ' . $this->mysqli_stmt->errno . ' ] ' . $this->mysqli_stmt->error . $specificMessage]),
......@@ -454,6 +453,20 @@ class Database {
$count = $stat[DB_NUM_ROWS];
$msg = 'Read rows: ' . $stat[DB_NUM_ROWS];
break;
case 'CALL':
$result = $this->mysqli_stmt->get_result();
$queryType = QUERY_TYPE_SELECT;
If($result === false){
$stat[DB_NUM_ROWS] = 0;
$count = $stat[DB_NUM_ROWS];
$msg = 'Read rows: ' . $stat[DB_NUM_ROWS] . '(No SELECT statement)';
}else{
$this->mysqli_result = $result;
$stat[DB_NUM_ROWS] = $this->mysqli_result->num_rows;
$count = $stat[DB_NUM_ROWS];
$msg = 'Read rows: ' . $stat[DB_NUM_ROWS];
}
break;
case 'REPLACE':
case 'INSERT':
$queryType = QUERY_TYPE_INSERT;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment