mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-14 18:12:05 +08:00
Suppress error dialog when user lacks privilege for SHOW CREATE DATABASE. See http://www.heidisql.com/forum.php?t=8862
This commit is contained in:
@ -168,13 +168,18 @@ begin
|
|||||||
Charset := MainForm.GetCharsetByEncoding(Encoding);
|
Charset := MainForm.GetCharsetByEncoding(Encoding);
|
||||||
// Detect db charset
|
// Detect db charset
|
||||||
DefCharset := 'Let server/database decide';
|
DefCharset := 'Let server/database decide';
|
||||||
dbcreate := FConnection.GetVar('SHOW CREATE DATABASE '+FConnection.QuoteIdent(comboDatabase.Text), 1);
|
try
|
||||||
rx := TRegExpr.Create;
|
dbcreate := FConnection.GetVar('SHOW CREATE DATABASE '+FConnection.QuoteIdent(comboDatabase.Text), 1);
|
||||||
rx.ModifierG := True;
|
rx := TRegExpr.Create;
|
||||||
rx.Expression := 'CHARACTER SET (\w+)';
|
rx.ModifierG := True;
|
||||||
if rx.Exec(dbcreate) then
|
rx.Expression := 'CHARACTER SET (\w+)';
|
||||||
DefCharset := DefCharset + ' ('+rx.Match[1]+')';
|
if rx.Exec(dbcreate) then
|
||||||
comboEncoding.Items.Add(DefCharset);
|
DefCharset := DefCharset + ' ('+rx.Match[1]+')';
|
||||||
|
comboEncoding.Items.Add(DefCharset);
|
||||||
|
except
|
||||||
|
// Supress error dialog when user does not have privs for above SHOW query
|
||||||
|
// see http://www.heidisql.com/forum.php?t=8862
|
||||||
|
end;
|
||||||
CharsetTable := FConnection.CharsetTable;
|
CharsetTable := FConnection.CharsetTable;
|
||||||
CharsetTable.First;
|
CharsetTable.First;
|
||||||
while not CharsetTable.Eof do begin
|
while not CharsetTable.Eof do begin
|
||||||
|
Reference in New Issue
Block a user