Skip to content

Commit

Permalink
- 修复 GBase 对 bigserial 自增问题;#1919
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Nov 12, 2024
1 parent 8f25e50 commit 670f971
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Providers/FreeSql.Provider.GBase/Curd/GBaseInsert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ protected override long RawExecuteIdentity()
{
if (identityType == typeof(int) || identityType == typeof(uint)) identitySql = "SELECT dbinfo('sqlca.sqlerrd1') FROM dual";
else if (identityType == typeof(long) || identityType == typeof(ulong)) identitySql =
identityCol.Attribute.DbType.IndexOf("bigserial", StringComparison.OrdinalIgnoreCase) != -1 ?
"SELECT dbinfo('bigserial') FROM dual" : "SELECT dbinfo('serial8') FROM dual";
identityCol.Attribute.DbType.IndexOf("bigserial", StringComparison.OrdinalIgnoreCase) != -1 ?
"SELECT dbinfo('bigserial')::INT8 FROM dual" : "SELECT dbinfo('serial8') FROM dual";
}
var before = new Aop.CurdBeforeEventArgs(_table.Type, _table, Aop.CurdType.Insert, string.Concat(sql, $"; {identitySql};"), _params);
_orm.Aop.CurdBeforeHandler?.Invoke(this, before);
Expand Down

0 comments on commit 670f971

Please sign in to comment.