Skip to content

Commit 2e63693

Browse files
committed
Bugfix: Modified BLOB data is not written
In TableDiffControls.cs a modified BLOB is not written correctly (aborted)
1 parent 0a6952d commit 2e63693

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

SQLiteTurbo/TableDiffControl.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,18 +545,27 @@ private void HandleCellEdit(bool right)
545545
{
546546
if (otherBlob != null && (citem.Result == ComparisonResult.Same || citem.Result == ComparisonResult.DifferentData))
547547
{
548+
/*
548549
if (otherBlob is long)
549550
{
550551
// Another adjustment for the other BLOB field value
551552
long ob = (long)otherBlob;
552553
if (ob == 0) // means NULL blob field
553554
otherBlob = DBNull.Value;
554555
}
556+
*/
557+
if (Utils.GetDbType(column.ColumnType) == DbType.Binary)
558+
{
559+
if (otherBlob.Equals("0"))
560+
otherBlob = DBNull.Value;
561+
}
555562
}
556563

557564
if (value != DBNull.Value)
558565
{
559-
string fpath = null;
566+
//string fpath = null;
567+
string fpath = Configuration.TempBlobFilePath;
568+
560569
long blobLength = 0;
561570
if (value is Be.Windows.Forms.DynamicFileByteProvider)
562571
{
@@ -599,7 +608,8 @@ private void HandleCellEdit(bool right)
599608

600609
// Update the table change item with an indication that the BLOB field that was just saved
601610
// is not null.
602-
citem.SetField(column.ObjectName.ToString(), !right, (long)1);
611+
//citem.SetField(column.ObjectName.ToString(), !right, (long)1);
612+
citem.SetField(column.ObjectName.ToString(), !right, "1");
603613

604614
if (otherBlob != null && (citem.Result == ComparisonResult.DifferentData || citem.Result == ComparisonResult.Same))
605615
{

0 commit comments

Comments
 (0)