/ Check-in [ba39df9d]
Login

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

Overview
Comment:Fix a bug causing "SELECT char()" to return SQLITE_NOMEM.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ba39df9d4f7ffc6475ae0dc794f7d3f58c486de8
User & Date: dan 2014-03-08 19:07:03
Context
2014-03-10
12:20
Version 3.8.4 check-in: 530a1ee7 user: drh tags: trunk, release, version-3.8.4
2014-03-08
19:07
Fix a bug causing "SELECT char()" to return SQLITE_NOMEM. check-in: ba39df9d user: dan tags: trunk
2014-03-07
14:57
Improved comment on the pager.c PERSIST rollback journal delete logic inside of hasHotJournal(). No changes to code. check-in: e5b17a9d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/func.c.

  1013   1013   static void charFunc(
  1014   1014     sqlite3_context *context,
  1015   1015     int argc,
  1016   1016     sqlite3_value **argv
  1017   1017   ){
  1018   1018     unsigned char *z, *zOut;
  1019   1019     int i;
  1020         -  zOut = z = sqlite3_malloc( argc*4 );
         1020  +  zOut = z = sqlite3_malloc( argc*4+1 );
  1021   1021     if( z==0 ){
  1022   1022       sqlite3_result_error_nomem(context);
  1023   1023       return;
  1024   1024     }
  1025   1025     for(i=0; i<argc; i++){
  1026   1026       sqlite3_int64 x;
  1027   1027       unsigned c;

Changes to test/func.test.

  1357   1357     if {$i==0xfeff} continue
  1358   1358     do_execsql_test func-30.5.$i {SELECT unicode(char($i))} $i
  1359   1359   }
  1360   1360   for {set i 65536} {$i<=0x10ffff} {incr i 139} {
  1361   1361     do_execsql_test func-30.5.$i {SELECT unicode(char($i))} $i
  1362   1362   }
  1363   1363   
         1364  +# Test char().
         1365  +#
         1366  +do_execsql_test func-31.1 { 
         1367  +  SELECT char(), length(char()), typeof(char()) 
         1368  +} {{} 0 text}
  1364   1369   finish_test