Skip to content

Commit 46fb136

Browse files
authored
Removed that redundand informations (#24)
* Fixed the bug - Syntax error occurred when SQL contains partition queries. * Removed that redundand informations To cause unexpected differences currured.
1 parent e608996 commit 46fb136

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

builder/builder.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,6 @@ func willAddIndex(old, new *mysql.Table) []string {
174174
}
175175
newIndices := newIndicesMap[keyName]
176176
oldIndices := oldIndicesMap[keyName]
177-
newIndices.ResetCardinality()
178-
oldIndices.ResetCardinality()
179177
if reflect.DeepEqual(oldIndices, newIndices) {
180178
continue
181179
}

dialect/mysql/index.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ type (
1515
SeqInIndex int32
1616
ColumnName string
1717
Collation string
18-
Cardinality JsonNullInt64
1918
SubPart JsonNullString
2019
Packed JsonNullString
2120
Null string
@@ -59,14 +58,6 @@ func (m Index) KeyNamesWithSubPart() []string {
5958
return names
6059
}
6160

62-
func (m *Indices) ResetCardinality() {
63-
for i := range *m {
64-
for j := range (*m)[i] {
65-
(*m)[i][j].Cardinality = JsonNullInt64{}
66-
}
67-
}
68-
}
69-
7061
func (m Indices) ToSQL() []string {
7162
indices := m.getSortedIndices(m.GetSortedKeys())
7263
indexSQLs := make([]string, 0, len(m))
@@ -174,7 +165,6 @@ func GetIndices(db *sql.DB, table string) (Indices, error) {
174165
&idxCol.SeqInIndex,
175166
&idxCol.ColumnName,
176167
&idxCol.Collation,
177-
&idxCol.Cardinality,
178168
&idxCol.SubPart,
179169
&idxCol.Packed,
180170
&idxCol.Null,

dialect/mysql/table.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ type (
1616
Engine string
1717
Version int
1818
RowFormat string
19-
TableRows int
20-
AvgRowLength int
21-
DataLength int
22-
MaxDataLength int
23-
IndexLength int
24-
DataFree int
25-
AutoIncrement JsonNullInt64
2619
TableCollation string
2720
CheckSum JsonNullString
2821
CreateOptions string
@@ -163,13 +156,6 @@ func GetTables(db *sql.DB, schema string, tableNames ...string) (Tables, error)
163156
&table.Engine,
164157
&table.Version,
165158
&table.RowFormat,
166-
&table.TableRows,
167-
&table.AvgRowLength,
168-
&table.DataLength,
169-
&table.MaxDataLength,
170-
&table.IndexLength,
171-
&table.DataFree,
172-
&table.AutoIncrement,
173159
&table.TableCollation,
174160
&table.CheckSum,
175161
&table.CreateOptions,

0 commit comments

Comments
 (0)