SQLite

Check-in [c66c7734]
Login

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

Overview
Comment:Add OOM check, per tip at forum post 933479b2d5
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | branch-3.40
Files: files | file ages | folders
SHA3-256: c66c7734feceb6ee9ae079df4fa4d078891d9e5fe6a44a2acfc482598a7176b8
User & Date: drh 2023-01-14 19:36:47
Context
2023-01-14
19:36
Add OOM check, per tip at forum post 933479b2d5 (Leaf check-in: c66c7734 user: drh tags: branch-3.40)
19:27
Add OOM check, per tip at forum post 933479b2d5 (check-in: eda84dcf user: larrybr tags: trunk)
2023-01-13
19:32
In expression nodes of type REGISTER with sub-type COLUMN, ensure that the iColumn field is set correctly, as otherwise the "IS NULL" operator might be incorrectly optimized. Fix for the problem described by forum post d010a26798915b53. (check-in: 76b440c5 user: drh tags: branch-3.40)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ext/misc/sqlar.c.

87
88
89
90
91
92
93


94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
  sz = sqlite3_value_int(argv[1]);

  if( sz<=0 || sz==(nData = sqlite3_value_bytes(argv[0])) ){
    sqlite3_result_value(context, argv[0]);
  }else{
    const Bytef *pData= sqlite3_value_blob(argv[0]);
    Bytef *pOut = sqlite3_malloc(sz);


    if( Z_OK!=uncompress(pOut, &sz, pData, nData) ){
      sqlite3_result_error(context, "error in uncompress()", -1);
    }else{
      sqlite3_result_blob(context, pOut, sz, SQLITE_TRANSIENT);
    }
    sqlite3_free(pOut);
  }
}


#ifdef _WIN32
__declspec(dllexport)
#endif
int sqlite3_sqlar_init(
  sqlite3 *db, 
  char **pzErrMsg, 







>
>
|







<







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

104
105
106
107
108
109
110
  sz = sqlite3_value_int(argv[1]);

  if( sz<=0 || sz==(nData = sqlite3_value_bytes(argv[0])) ){
    sqlite3_result_value(context, argv[0]);
  }else{
    const Bytef *pData= sqlite3_value_blob(argv[0]);
    Bytef *pOut = sqlite3_malloc(sz);
    if( pOut==0 ){
      sqlite3_result_error_nomem(context);
    }else if( Z_OK!=uncompress(pOut, &sz, pData, nData) ){
      sqlite3_result_error(context, "error in uncompress()", -1);
    }else{
      sqlite3_result_blob(context, pOut, sz, SQLITE_TRANSIENT);
    }
    sqlite3_free(pOut);
  }
}


#ifdef _WIN32
__declspec(dllexport)
#endif
int sqlite3_sqlar_init(
  sqlite3 *db, 
  char **pzErrMsg,