+ [misc] add searchTables.

This commit is contained in:
qixinzhi
2024-06-11 03:17:34 +00:00
parent b223310a31
commit e003f2386f
+18
View File
@@ -71,6 +71,24 @@ class sqlparser
$this->isSelect = $this->statement instanceof PhpMyAdmin\SqlParser\Statements\SelectStatement === true;
}
/**
* Search table from origin tables.
*
* @param string $tableName
* @param string $tables
* @param string $column
* @access public
* @return string|false
*/
public function searchTables($tableName, $tables, $column)
{
/* 如果能使用别名匹配上,那么直接返回。*/
/* If it can be matched using an alias, then it returns. */
foreach($tables as $table) if($tableName == $table['alias']) return array_merge($table, array('column' => $column));
return false;
}
/**
* Parse columns.
*