Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed #3830 Can't export custom query because it lowercases table names - Latestgit #176

Merged
merged 2 commits into from

3 participants

@hisamith

The problem is when exporting some selected rows of an uppercase table, the exported dump doesn't contain insert statement for those selected rows. The problem caused because inside the code it transform the sql statement to lowercase and in-turn it will make the table name to lowercase.

@Chanaka

explode function is not case sensitive. what if query is in uppercase ? You may need temp variable to do this.

@hisamith hisamith Used preg_split() instead of explode() to split sql query,
Since explode is case sensitive and if table or column contains substring "where" it will give an error
ae3d3f5
@lem9 lem9 was assigned
@lem9
Owner

Looks correct to me.

@lem9 lem9 merged commit b84ec72 into phpmyadmin:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 20, 2013
  1. @hisamith
  2. @hisamith

    Used preg_split() instead of explode() to split sql query,

    hisamith authored
    Since explode is case sensitive and if table or column contains substring "where" it will give an error
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  tbl_export.php
View
2  tbl_export.php
@@ -37,7 +37,7 @@
// Need to generate WHERE clause?
if (isset($where_clause)) {
- $temp_sql_array = explode("where", strtolower($sql_query));
+ $temp_sql_array = preg_split("/\bwhere\b/i", $sql_query);
// The part "SELECT `id`, `name` FROM `customers`"
// is not modified by the next code segment, when exporting
Something went wrong with that request. Please try again.