Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#3779 (ok 3.5.7) problem with backslash in enum

3.5.5
fixed
core (1) enum (1)
5
2013-06-11
2013-01-21
bontos
No

Hello
When having '\' (backslash) in a enum's value, there's a problem to display correctly escaped '\' character.
Example:
Create a table with an enum field with length/values "'Boo\','Foo\\','Roo'''" (enum('Boo\','Foo\\','Roo''')). When we try to add a new line, see bug - when we try to add a new row, we can see an error - in the dropdown list see the following: ("Boo \ ',", "Roo'").
I find error in file libraries\common.lib.php function PMA_extractFieldSpec rows 2966-2979.

My code to repair here:
...
elseif ('\' == $char
&& isset($fieldspec[$index + 1])
) {
// escaping of a quote?
if ("'" == $fieldspec[$index + 1]) {
$working .= "'";
$index++;
} elseif ("\" == $fieldspec[$index + 1]) {
$working .= "\";
if ("'" == $fieldspec[$index + 2]) {
$index++;
}
}
} else
...

Bug seen on :
phpMyAdmin - 3.5.5

Discussion

    • assigned_to: Rouslan Placella
     
    • labels: --> core, enum
    • summary: problem with backslash in enum --> (ok 3.5.7) problem with backslash in enum
    • status: open --> open-fixed
    • priority: 5 --> 1
     
  • Marc Delisle
    Marc Delisle
    2013-02-15

    • Status: open-fixed --> closed-fixed
    • Priority: 1 --> 5
     
  • Michal Čihař
    Michal Čihař
    2013-06-11

    • Status: closed-fixed --> fixed