From 87300613dfc7cc46863c1619bdca927c85653466 Mon Sep 17 00:00:00 2001 From: qixinzhi Date: Tue, 11 Jun 2024 02:56:47 +0000 Subject: [PATCH] + [misc] add statement. --- lib/sqlparser/sqlparser.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/sqlparser/sqlparser.class.php b/lib/sqlparser/sqlparser.class.php index 314ec3c88a..abf9baf2c6 100644 --- a/lib/sqlparser/sqlparser.class.php +++ b/lib/sqlparser/sqlparser.class.php @@ -19,6 +19,14 @@ class sqlparser */ public $statements; + /** + * First statement. + * + * @var object + * @access public + */ + public $statement; + /** * Count statements. * @@ -31,8 +39,9 @@ class sqlparser { $query = $this->skipLineBreak($query); - $this->parser = new PhpMyAdmin\SqlParser\Parser($query); - $this->statements = $this->parser->statements; + $this->parser = new PhpMyAdmin\SqlParser\Parser($query); + $this->statements = $this->parser->statements; + $this->statement = $this->statementsCount > 0 ? current($this->statements) : null; $this->statementsCount = count($this->statements); }