This happens with MSSQL.
function where($where, $fields = array()) {
...
$return[] = $column
. (($jush == "sql" && preg_match('~^[0-9]\.[0-9]$~', $val)) || $jush == "mssql"
? " LIKE " . q(addcslashes($val, "%_\")) <== HERE
: " = " . unconvert_field($fields[$key], q($val))
) // LIKE because of floats but slow with ints, in MS SQL because of text
; //! enum and set
the underscope has to be removed from the characters to escape, otherwise the query becomes:
'XXX where PK LIKE '%AA%_BB%'
You can see that the underscope is escapes, which isn't needed in MSSQL.
Hence, the select returns no row, and we cannot edit the entry.
According to https://msdn.microsoft.com/en-us/library/ms179859.aspx,
_is a special character that needs escaping. However, there's no default escaping character so Adminer would need to specify one. Another problem is that[is a special character too and Adminer should escape it as well.An alternative would be to use
[_],[[]and similar without theESCAPEclause.Fixed by https://github.com/vrana/adminer/commit/a0a1476e.