Skip to content

Commit

Permalink
read correct column
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
  • Loading branch information
shlomi-noach committed Jan 15, 2025
1 parent 276790e commit f23f3d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/vt/vttablet/onlineddl/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ func (e *Executor) killTableLockHoldersAndAccessors(ctx context.Context, tableNa
}
}
capableOf := mysql.ServerVersionCapableOf(conn.ServerVersion)
terminateTransactions := func(capability capabilities.FlavorCapability, query string, description string) error {
terminateTransactions := func(capability capabilities.FlavorCapability, query string, column string, description string) error {
capable, err := capableOf(capability)
if err != nil {
return err
Expand All @@ -856,7 +856,7 @@ func (e *Executor) killTableLockHoldersAndAccessors(ctx context.Context, tableNa
}
log.Infof("terminateTransactions: found %v transactions locking table `%s` %s", len(rs.Rows), tableName, description)
for _, row := range rs.Named().Rows {
threadId := row.AsInt64("processlist_id", 0)
threadId := row.AsInt64(column, 0)
log.Infof("terminateTransactions: killing connection %v with transaction locking table `%s` %s", threadId, tableName, description)
killConnection := fmt.Sprintf("KILL %d", threadId)
_, err = conn.Conn.ExecuteFetch(killConnection, 1, false)
Expand All @@ -866,10 +866,10 @@ func (e *Executor) killTableLockHoldersAndAccessors(ctx context.Context, tableNa
}
return nil
}
if err := terminateTransactions(capabilities.PerformanceSchemaDataLocksTableCapability, sqlProcessWithLocksOnTable, "data"); err != nil {
if err := terminateTransactions(capabilities.PerformanceSchemaDataLocksTableCapability, sqlProcessWithLocksOnTable, "trx_mysql_thread_id", "data"); err != nil {
return err
}
if err := terminateTransactions(capabilities.PerformanceSchemaMetadataLocksTableCapability, sqlProcessWithMetadataLocksOnTable, "metadata"); err != nil {
if err := terminateTransactions(capabilities.PerformanceSchemaMetadataLocksTableCapability, sqlProcessWithMetadataLocksOnTable, "processlist_id", "metadata"); err != nil {
return err
}

Expand Down

0 comments on commit f23f3d3

Please sign in to comment.