mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-03-02 12:10:56 +08:00
- 修复 GBase BIGSERIAL 自增问题;#1919
This commit is contained in:
@@ -313,7 +313,8 @@ namespace FreeSql.Internal
|
||||
if (colType == typeof(int) || colType == typeof(uint))
|
||||
colattr.DbType = "SERIAL";
|
||||
else if (colType == typeof(long) || colType == typeof(ulong))
|
||||
colattr.DbType = "SERIAL8";
|
||||
colattr.DbType = colattr.DbType.IndexOf("BIGSERIAL", StringComparison.OrdinalIgnoreCase) != -1 ?
|
||||
"BIGSERIAL" : "SERIAL8"; //#1919
|
||||
}
|
||||
if (colattr.MapType.NullableTypeOrThis() == typeof(DateTime))
|
||||
{
|
||||
|
||||
@@ -49,8 +49,8 @@ namespace FreeSql.GBase.Curd
|
||||
{
|
||||
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') 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);
|
||||
|
||||
Reference in New Issue
Block a user