Part of the EllisLab Network

Bug Report

Backup function in db_utility (mysql) and field names.

Date: 08/23/2008 Severity: Trivial
Status: Resolved Reporter: r`ne
Version: 1.6.3
Keywords: Libraries, Database Class

Description

Backup function in db_utility does not enclose insert field names with ‘`’. This breaks during mysql import with reserved field names like ‘order’.

Proposed solution:

Code Sample

--- mysql_utility.php.orig    2008-08-24 04:08:07.000000000 +0300
+++ mysql_utility.php    2008-08-24 04:08:20.000000000 +0300
@@ -153,7 +153,7 @@
                                         ) ?
TRUE : FALSE;
                                         
                 
// Create a string of field names
-                $field_str .= $field->name.', ';
+                
$field_str .= '`'.$field->name.'`, ';
                 
$i++;
             
}

Expected Result

Actual Result

Comment on Bug Report

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?