Method: ActiveRecord::ConnectionAdapters::IBM_DB2_I5#indexes

Defined in:
lib/active_record/connection_adapters/ibm_db_adapter.rb

#indexes(table_name, name = nil) ⇒ Object

Returns an array of non-primary key indexes for a specified table name



3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 3271

def indexes(table_name, name = nil)
  # IBM i issue with fetch lob when autocommit=off (DB2 PTF not applied all machines)
  hackibmi = IBM_DB.autocommit(@adapter.connection) == IBM_DB::SQL_AUTOCOMMIT_OFF
  if hackibmi == true
    IBM_DB.autocommit @adapter.connection, IBM_DB::SQL_AUTOCOMMIT_ON
  end
  indexes = super(table_name, name)
  if hackibmi == true
    IBM_DB.autocommit @adapter.connection, IBM_DB::SQL_AUTOCOMMIT_OFF
  end
  indexes
end