diff --git a/database/gdb/gdb.go b/database/gdb/gdb.go index e89fe953a..a128d589c 100644 --- a/database/gdb/gdb.go +++ b/database/gdb/gdb.go @@ -280,7 +280,6 @@ const ( queryTypeCount = 1 unionTypeNormal = 0 unionTypeAll = 1 - defaultBatchNumber = 10 // Per count for batch insert/replace/save. defaultMaxIdleConnCount = 10 // Max idle connection count in pool. defaultMaxOpenConnCount = 0 // Max open connection count in pool. Default is no limit. defaultMaxConnLifeTime = 30 * time.Second // Max lifetime for per connection in pool in seconds. diff --git a/database/gdb/gdb_model_insert.go b/database/gdb/gdb_model_insert.go index 412e615b8..cc8cc4b10 100644 --- a/database/gdb/gdb_model_insert.go +++ b/database/gdb/gdb_model_insert.go @@ -428,9 +428,5 @@ func (m *Model) formatOnDuplicateExKeys(onDuplicateEx interface{}) ([]string, er } func (m *Model) getBatch() int { - batch := defaultBatchNumber - if m.batch > 0 { - batch = m.batch - } - return batch + return m.batch } diff --git a/database/gdb/gdb_model_select.go b/database/gdb/gdb_model_select.go index 6d327c780..27b1ac185 100644 --- a/database/gdb/gdb_model_select.go +++ b/database/gdb/gdb_model_select.go @@ -182,7 +182,7 @@ func (m *Model) Value(fieldsAndWhere ...interface{}) (Value, error) { } return nil, gerror.NewCode( gcode.CodeInternalError, - `query value error: the internal context data is missing. there's' internal issue should be fixed'`, + `query value error: the internal context data is missing. there's internal issue should be fixed`, ) } @@ -399,7 +399,7 @@ func (m *Model) Count(where ...interface{}) (int, error) { } return 0, gerror.NewCode( gcode.CodeInternalError, - `query count error: the internal context data is missing. there's' internal issue should be fixed'`, + `query count error: the internal context data is missing. there's internal issue should be fixed`, ) } return 0, nil