Open ShmSeeker opened 4 years ago
when i query INNODB_TRX's info ,it report tis error. type TransactionInfo struct { trxId int64 db:"trx_id" trxState string db:"trx_state" trxStarted string db:"trx_started" trxRequestedLockId string trxWaitStarted string trxWeight string trxMysqlThreadId string trxQuery string trxOperationState string trxTablesInUse string trxTablesLocked string trxLockStructs string trxLockMemoryBytes string trxRowsLocked string trxRowsModified string trxConcurrencyTickets string TrxIsolationLevel string trxUniqueChecks string trxForeignKeyChecks string trxLastForeignKeyError string trxAdaptiveHashLatched string trxAdaptiveHashTimeout string trxIsReadOnly string trxAutocommitNonLocking string }
db:"trx_id"
db:"trx_state"
db:"trx_started"
err := db.Select(&result, "SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX")
missing destination name trx_id in *[]main.TransactionInfo
That is because trx_id is a private field. The first letter should be uppercase. If you don't want your field to be returned to the user (in your API) - set json:"-" tag.
trx_id
json:"-"
when i query INNODB_TRX's info ,it report tis error. type TransactionInfo struct { trxId int64
db:"trx_id"
trxState stringdb:"trx_state"
trxStarted stringdb:"trx_started"
trxRequestedLockId string trxWaitStarted string trxWeight string trxMysqlThreadId string trxQuery string trxOperationState string trxTablesInUse string trxTablesLocked string trxLockStructs string trxLockMemoryBytes string trxRowsLocked string trxRowsModified string trxConcurrencyTickets string TrxIsolationLevel string trxUniqueChecks string trxForeignKeyChecks string trxLastForeignKeyError string trxAdaptiveHashLatched string trxAdaptiveHashTimeout string trxIsReadOnly string trxAutocommitNonLocking string }err := db.Select(&result, "SELECT * FROM INFORMATION_SCHEMA.INNODB_TRX")
missing destination name trx_id in *[]main.TransactionInfo