File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
FirebirdSql.EntityFrameworkCore.Firebird.Tests/Migrations
FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public void CreateTable()
9191 Table = "People" ,
9292 ClrType = typeof ( string ) ,
9393 MaxLength = 20 ,
94- DefaultValueSql = "''" ,
94+ DefaultValueSql = "'x '" ,
9595 IsNullable = true ,
9696 } ,
9797 } ,
@@ -122,8 +122,8 @@ public void CreateTable()
122122 ""Id_Sequence"" INTEGER NOT NULL,
123123 ""EmployerId"" INTEGER,
124124 ""SSN"" char(11),
125- ""DEF_O"" VARCHAR(20) DEFAULT _UTF8'test',
126- ""DEF_S"" VARCHAR(20) DEFAULT (''),
125+ ""DEF_O"" VARCHAR(20) DEFAULT CAST( _UTF8'test' as VARCHAR(4) CHARACTER SET UTF8) ,
126+ ""DEF_S"" VARCHAR(20) DEFAULT ('x '),
127127 PRIMARY KEY (""Id""),
128128 UNIQUE (""SSN""),
129129 FOREIGN KEY (""EmployerId"") REFERENCES ""Companies"" (""Id"") ON UPDATE NO ACTION ON DELETE NO ACTION
Original file line number Diff line number Diff line change @@ -38,9 +38,12 @@ protected override void ConfigureParameter(DbParameter parameter)
3838
3939 protected override string GenerateNonNullSqlLiteral ( object value )
4040 {
41+ var svalue = ( string ) value ;
42+ if ( svalue == string . Empty )
43+ return "''" ;
4144 return IsUnicode
42- ? $ "_UTF8'{ EscapeSqlLiteral ( ( string ) value ) } ' "
43- : $ "'{ EscapeSqlLiteral ( ( string ) value ) } ' ";
45+ ? $ "CAST( _UTF8'{ EscapeSqlLiteral ( svalue ) } ' as VARCHAR( { svalue . Length } ) CHARACTER SET UTF8) "
46+ : $ "CAST( '{ EscapeSqlLiteral ( svalue ) } ' as VARCHAR( { svalue . Length } )) ";
4447 }
4548 }
4649}
You can’t perform that action at this time.
0 commit comments