mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-06 18:24:26 +08:00
Support auto_increment flag on indexes other than primary or unique, on copy table dialog. If that still fails, give the user a hint to select the right index. See https://www.heidisql.com/forum.php?t=23383
This commit is contained in:
@ -7,7 +7,7 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: HeidiSQL\n"
|
"Project-Id-Version: HeidiSQL\n"
|
||||||
"POT-Creation-Date: 2012-11-05 21:40\n"
|
"POT-Creation-Date: 2012-11-05 21:40\n"
|
||||||
"PO-Revision-Date: 2017-02-23 18:14+0100\n"
|
"PO-Revision-Date: 2017-02-28 20:21+0100\n"
|
||||||
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
|
"Last-Translator: Ansgar Becker <anse@heidisql.com>\n"
|
||||||
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/"
|
"Language-Team: English (http://www.transifex.com/projects/p/heidisql/"
|
||||||
"language/en/)\n"
|
"language/en/)\n"
|
||||||
@ -520,6 +520,10 @@ msgstr "WHERE clause for data copying:"
|
|||||||
msgid "Recent filters"
|
msgid "Recent filters"
|
||||||
msgstr "Recent filters"
|
msgstr "Recent filters"
|
||||||
|
|
||||||
|
#. Copy table dialog
|
||||||
|
msgid "Please select the required index for the %s flag."
|
||||||
|
msgstr "Please select the required index for the %s flag."
|
||||||
|
|
||||||
#. CreateDatabaseForm..Caption
|
#. CreateDatabaseForm..Caption
|
||||||
#: createdatabase.dfm:5 createdatabase.pas:92
|
#: createdatabase.dfm:5 createdatabase.pas:92
|
||||||
msgid "Create database ..."
|
msgid "Create database ..."
|
||||||
|
@ -358,7 +358,7 @@ end;
|
|||||||
|
|
||||||
procedure TCopyTableForm.btnOKClick(Sender: TObject);
|
procedure TCopyTableForm.btnOKClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
CreateCode, InsertCode, TargetTable, DataCols: String;
|
CreateCode, InsertCode, TargetTable, DataCols, Msg: String;
|
||||||
TableExistence: String;
|
TableExistence: String;
|
||||||
ParentNode, Node: PVirtualNode;
|
ParentNode, Node: PVirtualNode;
|
||||||
DoData, AutoIncGetsKey, AutoIncRemoved, TableHasAutoInc: Boolean;
|
DoData, AutoIncGetsKey, AutoIncRemoved, TableHasAutoInc: Boolean;
|
||||||
@ -425,7 +425,8 @@ begin
|
|||||||
AutoIncRemoved := False;
|
AutoIncRemoved := False;
|
||||||
if Column.DefaultType = cdtAutoInc then begin
|
if Column.DefaultType = cdtAutoInc then begin
|
||||||
for Key in SelectedKeys do begin
|
for Key in SelectedKeys do begin
|
||||||
if ((Key.IndexType = PKEY) or (Key.IndexType = UKEY)) and (Key.Columns.IndexOf(Column.Name) > -1) then begin
|
// Don't check index type, MySQL allows auto-increment columns on nearly all indexes
|
||||||
|
if Key.Columns.IndexOf(Column.Name) > -1 then begin
|
||||||
AutoIncGetsKey := True;
|
AutoIncGetsKey := True;
|
||||||
Break;
|
Break;
|
||||||
end;
|
end;
|
||||||
@ -494,7 +495,10 @@ begin
|
|||||||
except
|
except
|
||||||
on E:EDatabaseError do begin
|
on E:EDatabaseError do begin
|
||||||
Screen.Cursor := crDefault;
|
Screen.Cursor := crDefault;
|
||||||
ErrorDialog(E.Message);
|
Msg := E.Message;
|
||||||
|
if FConnection.LastErrorCode = 1075 then
|
||||||
|
Msg := Msg + CRLF + CRLF + f_('Please select the required index for the %s flag.', ['auto_increment']);
|
||||||
|
ErrorDialog(Msg);
|
||||||
ModalResult := mrNone;
|
ModalResult := mrNone;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user