SQLite

Check-in [1f09541eb4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix typo in the tag-20240123-a in a comment.
Timelines: family | ancestors | descendants | both | blob-as-json
Files: files | file ages | folders
SHA3-256: 1f09541eb4203ccce476f6040ff134353850f22f07fb84f96a1d2c27b304a91b
User & Date: drh 2024-01-23 13:28:21.325
Context
2024-01-23
13:51
When a JSON input is a blob, but it looks like valid JSON when cast to text, then accept it as valid JSON. This replicates a long-standing bug in the behavior of JSON routines, and thus avoids breaking legacy apps. [forum:/forumpost/012136abd5292b8d|Forum thread 012136abd5292b8d]. (check-in: e5dc81d5c7 user: drh tags: trunk)
13:28
Fix typo in the tag-20240123-a in a comment. (Closed-Leaf check-in: 1f09541eb4 user: drh tags: blob-as-json)
13:21
If a BLOB looks like JSON when cast to text, then treat it as if it really were JSON. This replicates a long-standing bug in the JSON processing routines, and thereby avoids breaking legacy. (check-in: d79a37690c user: drh tags: blob-as-json)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/json.c.
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
          px.nBlob = sqlite3_value_bytes(argv[0]);
          iErr = jsonbValidityCheck(&px, 0, px.nBlob, 1);
          res = iErr==0;
        }
        break;
      }
      /* Fall through into interpreting the input as text.  See note
      ** above at tag-20240124-a. */
      /* no break */ deliberate_fall_through
    }
    default: {
      JsonParse px;
      if( (flags & 0x3)==0 ) break;
      memset(&px, 0, sizeof(px));
     







|







4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
          px.nBlob = sqlite3_value_bytes(argv[0]);
          iErr = jsonbValidityCheck(&px, 0, px.nBlob, 1);
          res = iErr==0;
        }
        break;
      }
      /* Fall through into interpreting the input as text.  See note
      ** above at tag-20240123-a. */
      /* no break */ deliberate_fall_through
    }
    default: {
      JsonParse px;
      if( (flags & 0x3)==0 ) break;
      memset(&px, 0, sizeof(px));