+ [misc] add isSelect.

This commit is contained in:
qixinzhi
2024-06-11 02:57:43 +00:00
parent 87300613df
commit 9b7b1ef7ac
+10
View File
@@ -35,6 +35,14 @@ class sqlparser
*/
public $statementsCount = 0;
/**
* Is first statemnt select type.
*
* @var bool
* @access public
*/
public $isSelect = false;
public function __construct($query)
{
$query = $this->skipLineBreak($query);
@@ -43,6 +51,8 @@ class sqlparser
$this->statements = $this->parser->statements;
$this->statement = $this->statementsCount > 0 ? current($this->statements) : null;
$this->statementsCount = count($this->statements);
$this->isSelect = $this->statement instanceof PhpMyAdmin\SqlParser\Statements\SelectStatement === true;
}
/**