@@ -1253,9 +1253,20 @@ update_prepare(IsSec, SKey, {S,Tab,Typ,DefRec,Trigger,User,TrOpts}=TableInfo, Co
1253
1253
{<<>>,_ } ->
1254
1254
? replace (X ,Cx ,imem_json :remove (AttName ,? BoundVal (B ,X )));
1255
1255
_ ->
1256
- case imem_json : decode ( Value ) of
1256
+ case Value of
1257
1257
OldVal -> X ;
1258
- NewVal -> ? replace (X ,Cx ,imem_json :put (AttName ,NewVal ,? BoundVal (B ,X )))
1258
+ _ ->
1259
+ try
1260
+ case imem_json :decode (Value ) of
1261
+ OldVal -> X ;
1262
+ NewVal1 -> ? replace (X ,Cx ,imem_json :put (AttName ,NewVal1 ,? BoundVal (B ,X )))
1263
+ end
1264
+ catch _ :_ ->
1265
+ case imem_json :decode (imem_datatype :add_dquotes (Value )) of
1266
+ OldVal -> X ;
1267
+ NewVal2 -> ? replace (X ,Cx ,imem_json :put (AttName ,NewVal2 ,? BoundVal (B ,X )))
1268
+ end
1269
+ end
1259
1270
end
1260
1271
end
1261
1272
end ,
@@ -1309,12 +1320,26 @@ update_prepare(IsSec, SKey, {S,Tab,Typ,DefRec,Trigger,User,TrOpts}=TableInfo, Co
1309
1320
NewParent = imem_json :remove (AttName ,imem_json :get (ParentName ,? BoundVal (B ,X ))),
1310
1321
? replace (X ,Cx ,imem_json :put (ParentName ,NewParent ,? BoundVal (B ,X )));
1311
1322
_ ->
1312
- case imem_json :decode (Value ) of
1313
- OldVal ->
1314
- X ;
1315
- NewVal ->
1316
- NewParent = imem_json :put (AttName ,NewVal ,imem_json :get (ParentName ,? BoundVal (B ,X ))),
1317
- ? replace (X ,Cx ,imem_json :put (ParentName ,NewParent ,? BoundVal (B ,X )))
1323
+ case Value of
1324
+ OldVal -> X ;
1325
+ _ ->
1326
+ try
1327
+ case imem_json :decode (Value ) of
1328
+ OldVal ->
1329
+ X ;
1330
+ NewVal1 ->
1331
+ NewParent1 = imem_json :put (AttName ,NewVal1 ,imem_json :get (ParentName ,? BoundVal (B ,X ))),
1332
+ ? replace (X ,Cx ,imem_json :put (ParentName ,NewParent1 ,? BoundVal (B ,X )))
1333
+ end
1334
+ catch _ :_ ->
1335
+ case imem_json :decode (imem_datatype :add_dquotes (Value )) of
1336
+ OldVal ->
1337
+ X ;
1338
+ NewVal2 ->
1339
+ NewParent2 = imem_json :put (AttName ,NewVal2 ,imem_json :get (ParentName ,? BoundVal (B ,X ))),
1340
+ ? replace (X ,Cx ,imem_json :put (ParentName ,NewParent2 ,? BoundVal (B ,X )))
1341
+ end
1342
+ end
1318
1343
end
1319
1344
end
1320
1345
end ,
@@ -1409,9 +1434,16 @@ update_prepare(IsSec, SKey, {S,Tab,Typ,DefRec,Trigger,User,TrOpts}=TableInfo, Co
1409
1434
{json_value ,AttName ,# bind {tind = ? MainIdx ,cind = Cx }= B } ->
1410
1435
Fx = fun (X ) ->
1411
1436
case Value of
1412
- <<>> -> X ;
1413
- ? navio -> X ;
1414
- _ -> ? replace (X ,Cx ,imem_json :put (AttName ,imem_json :decode (Value ),? BoundVal (B ,X )))
1437
+ <<>> ->
1438
+ X ;
1439
+ ? navio ->
1440
+ X ;
1441
+ _ ->
1442
+ try
1443
+ ? replace (X ,Cx ,imem_json :put (AttName ,imem_json :decode (Value ),? BoundVal (B ,X )))
1444
+ catch _ :_ ->
1445
+ ? replace (X ,Cx ,imem_json :put (AttName ,imem_json :decode (imem_datatype :add_dquotes (Value )),? BoundVal (B ,X )))
1446
+ end
1415
1447
end
1416
1448
end ,
1417
1449
{Cx ,0 ,Fx };
0 commit comments