Skip to content

Commit 367091e

Browse files
committed
fix test expectation
1 parent 797f120 commit 367091e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

enginetest/queries/script_queries.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ var ScriptTests = []ScriptTest{
158158
{
159159
Query: "SHOW KEYS FROM ost_user__cdata WHERE Key_name = 'PRIMARY'",
160160
Expected: []sql.Row{
161-
{"ost_user__cdata", 0, "PRIMARY", 1, "user_id", nil, 0, nil, nil, "YES", "BTREE", "", "", "YES", nil},
161+
{"ost_user__cdata", 0, "PRIMARY", 1, "user_id", nil, 0, nil, nil, "", "BTREE", "", "", "YES", nil},
162162
},
163163
},
164164
},

sql/analyzer/resolve_create_select.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ func resolveCreateSelect(ctx *sql.Context, a *Analyzer, n sql.Node, scope *plan.
5050
if idx.IsPrimary() {
5151
for _, idxCol := range idx.Columns {
5252
if i, ok := colNameToIdx[idxCol.Name]; ok {
53+
// https://dev.mysql.com/doc/refman/8.0/en/create-table.html
5354
newSch[i].PrimaryKey = true
55+
newSch[i].Nullable = false
5456
pkOrdinals = append(pkOrdinals, i)
5557
}
5658
}

0 commit comments

Comments
 (0)