Skip to content

Commit d7fe4dc

Browse files
author
Marius Cramer
committed
- Fixed problem with .* table info (GRANT X ON Y.*)
1 parent 305dda7 commit d7fe4dc

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

interface/lib/classes/db_mysql.inc.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ public function _build_query_string($sQuery = '') {
128128
$sTxt = $this->escape($sValue);
129129

130130
$sTxt = str_replace('`', '', $sTxt);
131-
if(strpos($sTxt, '.') !== false) $sTxt = preg_replace('/^(.+)\.(.+)$/', '`$1`.`$2`', $sTxt);
132-
else $sTxt = '`' . $sTxt . '`';
131+
if(strpos($sTxt, '.') !== false) {
132+
$sTxt = preg_replace('/^(.+)\.(.+)$/', '`$1`.`$2`', $sTxt);
133+
$sTxt = str_replace('.`*`', '.*', $sTxt);
134+
} else $sTxt = '`' . $sTxt . '`';
133135

134136
$sQuery = substr_replace($sQuery, $sTxt, $iPos2, 2);
135137
$iPos2 += strlen($sTxt);

server/lib/classes/db_mysql.inc.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ public function _build_query_string($sQuery = '') {
132132
if($iPos2 !== false && ($iPos === false || $iPos2 <= $iPos)) {
133133
$sTxt = $this->escape($sValue);
134134

135-
if(strpos($sTxt, '.') !== false) $sTxt = preg_replace('/^(.+)\.(.+)$/', '`$1`.`$2`', $sTxt);
136-
else $sTxt = '`' . $sTxt . '`';
135+
if(strpos($sTxt, '.') !== false) {
136+
$sTxt = preg_replace('/^(.+)\.(.+)$/', '`$1`.`$2`', $sTxt);
137+
$sTxt = str_replace('.`*`', '.*', $sTxt);
138+
} else $sTxt = '`' . $sTxt . '`';
137139

138140
$sQuery = substr_replace($sQuery, $sTxt, $iPos2, 2);
139141
$iPos2 += strlen($sTxt);

0 commit comments

Comments
 (0)