Skip to content
Permalink
Browse files

Replace remaining SHOW VARIABLES queries with GetSessionVariable

  • Loading branch information...
ansgarbecker committed Jul 29, 2019
1 parent 35e9d88 commit b2a355170420c3c8dc4f64b8751e6751a2bfff00
Showing with 3 additions and 4 deletions.
  1. +2 −3 source/createdatabase.pas
  2. +1 −1 source/table_editor.pas
@@ -60,11 +60,10 @@ procedure TCreateDatabaseForm.FormShow(Sender: TObject);
CollationTable := FConnection.CollationTable;

// Detect servers default collation
// TODO: Find out how to retrieve the server's default collation on MSSQL
case FConnection.Parameters.NetTypeGroup of
ngMySQL:
ServerCollation := FConnection.GetVar('SHOW VARIABLES LIKE '+FConnection.EscapeString('collation_server'), 1);
ngMSSQL:
ServerCollation := FConnection.GetSessionVariable('collation_server');
else // TODO: Find out how to retrieve the server's default collation here
ServerCollation := '';
end;
lblServerDefaultCollation.Caption := f_('Servers default: %s', [ServerCollation]);
@@ -282,7 +282,7 @@ procedure TfrmTableEditor.Init(Obj: TDBObject);
// Creating new table
editName.Text := '';
if DBObject.Connection.Parameters.IsMySQL then
comboCollation.ItemIndex := comboCollation.Items.IndexOf(DBObject.Connection.GetVar('SHOW VARIABLES LIKE ''collation_database''', 1));
comboCollation.ItemIndex := comboCollation.Items.IndexOf(DBObject.Connection.GetSessionVariable('collation_database'));
PageControlMain.ActivePage := tabBasic;
end else begin
// Editing existing table

0 comments on commit b2a3551

Please sign in to comment.
You can’t perform that action at this time.