config.inc.php3 sql.php3 tbl_move_copy.php3 libraries/common.lib.php3 libraries/sqlparser.lib.php3: Committed Marc's patches to the SQL parser and pretty printer from bugs #605030 and #631421.

This commit is contained in:
Robin Johnson
2002-11-08 22:20:23 +00:00
parent 466579cce1
commit 703be1753e
6 changed files with 55 additions and 25 deletions

View File

@@ -2,7 +2,6 @@
/* $Id$ */
// vim: expandtab sw=4 ts=4 sts=4:
/**
* Insert datas from one table to another one
*
@@ -81,7 +80,13 @@ if (isset($new_name) && trim($new_name) != '') {
include('./libraries/build_dump.lib.php3');
$sql_structure = PMA_getTableDef($db, $table, "\n", $err_url);
$sql_structure = eregi_replace('^CREATE TABLE (`?)' . $table . '(`?)', 'CREATE TABLE ' . $target, $sql_structure);
$parsed_sql = PMA_SQP_parse($sql_structure);
// no need to PMA_backquote()
$parsed_sql[2]['data'] = $target;
$sql_structure = PMA_SQP_formatHtml($parsed_sql, 'query_only');
// $sql_structure = eregi_replace('^CREATE TABLE (`?)' . $table . '(`?)', 'CREATE TABLE ' . $target, $sql_structure);
$result = @PMA_mysql_query($sql_structure);
if (PMA_mysql_error()) {
include('./header.inc.php3');