diff options
author | Michal Čihař <michal@cihar.com> | 2004-06-24 17:02:23 +0400 |
---|---|---|
committer | Michal Čihař <michal@cihar.com> | 2004-06-24 17:02:23 +0400 |
commit | b00dbf08f5deeb36ab02472e675e843f89e1cedb (patch) | |
tree | f38e64cf7af501ea583ccfb6ad60643aab907ce2 /read_dump.php | |
parent | de04757024fcd88e42c5707a296db17482f0f62f (diff) |
Show last SELECT result also when there are comments behind last query.
Diffstat (limited to 'read_dump.php')
-rw-r--r-- | read_dump.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/read_dump.php b/read_dump.php index 93e10be037..a7a27e2eac 100644 --- a/read_dump.php +++ b/read_dump.php @@ -223,7 +223,7 @@ if ($sql_query != '') { $save_bandwidth_pieces = $max_file_pieces; } else { - $sql_query_cpy = implode(";\n", $pieces) . ';'; + $sql_query_cpy = $sql_query; // Be nice with bandwidth... for now, an arbitrary limit of 500, // could be made configurable but probably not necessary if (($max_nofile_length != 0 && (strlen($sql_query_cpy) > $max_nofile_length)) @@ -252,9 +252,14 @@ if ($sql_query != '') { $info_msg = ''; $info_count = 0; - for ($i = 0; $i < $pieces_count; $i++) { - $a_sql_query = $pieces[$i]; - if ($i == $pieces_count - 1 && preg_match('@^(SELECT|SHOW)@i', $a_sql_query)) { + // just skip last empty query (can contain just comments at the end) + $count = $pieces_count; + if ($pieces[$count - 1]['empty']) $count--; + + for ($i = 0; $i < $count; $i++) { + $a_sql_query = $pieces[$i]['query']; + + if ($i == $count - 1 && preg_match('@^(SELECT|SHOW)@i', $a_sql_query)) { $complete_query = $sql_query; $display_query = $sql_query; $sql_query = $a_sql_query; |