Skip to content

Commit

Permalink
Merge pull request #579 from k1LoW/fix-index-null
Browse files Browse the repository at this point in the history
Support the case where name in index_info is NULL.
  • Loading branch information
k1LoW committed May 2, 2024
2 parents c883454 + b20054c commit 5216ed9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/sqlite/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ WHERE name != 'sqlite_sequence' AND (type = 'table' OR type = 'view');`)
var (
colRank string
colRankWithinTable string
col string
col sql.NullString
cols []string
)
row, err := l.db.Query(fmt.Sprintf("PRAGMA index_info(`%s`)", indexName))
Expand All @@ -264,7 +264,9 @@ WHERE name != 'sqlite_sequence' AND (type = 'table' OR type = 'view');`)
if err != nil {
return errors.WithStack(err)
}
cols = append(cols, col)
if col.Valid {
cols = append(cols, col.String)
}
}

switch indexCreatedBy {
Expand Down

0 comments on commit 5216ed9

Please sign in to comment.