~automne-team/automne/trunk

« back to all changes in this revision

Viewing changes to automne/phpMyAdmin/libraries/import/sql.php

  • Committer: sebastien-pauchet
  • Date: 2012-02-15 16:47:40 UTC
  • mfrom: (363.2.105 4.2)
  • Revision ID: seb@automne-cms.org-20120215164740-xrk26iafkvztwv6s
Merge stable branch 4.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
/**
4
4
 * SQL import plugin for phpMyAdmin
5
5
 *
6
 
 * @version $Id$
7
6
 * @package phpMyAdmin-Import
8
7
 */
9
8
if (! defined('PHPMYADMIN')) {
15
14
 */
16
15
if (isset($plugin_list)) {
17
16
    $plugin_list['sql'] = array(
18
 
        'text'          => 'strSQL',
 
17
        'text'          => __('SQL'),
19
18
        'extension'     => 'sql',
20
 
        'options_text'  => 'strOptions',
 
19
        'options_text'  => __('Options'),
21
20
    );
22
21
    $compats = PMA_DBI_getCompatibilities();
23
22
    if (count($compats) > 0) {
26
25
            $values[$val] = $val;
27
26
        }
28
27
        $plugin_list['sql']['options'] = array(
 
28
            array('type' => 'begin_group', 'name' => 'general_opts'),
29
29
            array(
30
30
                'type'      => 'select',
31
31
                'name'      => 'compatibility',
32
 
                'text'      => 'strSQLCompatibility',
 
32
                'text'      => __('SQL compatibility mode:'),
33
33
                'values'    => $values,
34
34
                'doc'       => array(
35
35
                    'manual_MySQL_Database_Administration',
39
39
            array(
40
40
                'type' => 'bool', 
41
41
                'name' => 'no_auto_value_on_zero', 
42
 
                'text' => 'strDoNotAutoIncrementZeroValues',
 
42
                'text' => __('Do not use <code>AUTO_INCREMENT</code> for zero values'),
43
43
                'doc'       => array(
44
44
                    'manual_MySQL_Database_Administration',
45
45
                    'Server_SQL_mode',
47
47
                ),
48
48
 
49
49
            ),
 
50
            array('type' => 'end_group'),
50
51
        );
51
52
    }
52
53
 
167
168
            while (!$endq) {
168
169
                // Find next quote
169
170
                $pos = strpos($buffer, $quote, $i + 1);
 
171
                /*
 
172
                 * Behave same as MySQL and accept end of query as end of backtick.
 
173
                 * I know this is sick, but MySQL behaves like this:
 
174
                 *
 
175
                 * SELECT * FROM `table
 
176
                 *
 
177
                 * is treated like
 
178
                 *
 
179
                 * SELECT * FROM `table`
 
180
                 */
 
181
                if ($pos === FALSE && $quote == '`' && $found_delimiter) {
 
182
                    $pos = $first_sql_delimiter - 1;
170
183
                // No quote? Too short string
171
 
                if ($pos === FALSE) {
 
184
                } elseif ($pos === FALSE) {
172
185
                    // We hit end of string => unclosed quote, but we handle it as end of query
173
186
                    if ($GLOBALS['finished']) {
174
187
                        $endq = TRUE;