SQLite

Check-in [0a60212c9c]
Login

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

Overview
Comment:Add test cases to demonstrate the memory leak on the COLLATE clause.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | memleak
Files: files | file ages | folders
SHA1: 0a60212c9c8404ee079985a58094ed2b2b554d48
User & Date: drh 2013-06-09 20:16:26.380
Context
2013-06-09
20:22
Fix the memory leak in CREATE TABLE that occurs if there are two or more COLLATE clauses on the same column. (check-in: 7e3820e5b9 user: drh tags: trunk)
20:16
Add test cases to demonstrate the memory leak on the COLLATE clause. (Closed-Leaf check-in: 0a60212c9c user: drh tags: memleak)
2013-06-08
19:58
Candidate fix for a memory leak that occurs if a CREATE TABLE statement contains two or more COLLATE clauses on the same column definition. (check-in: 60fc77bc53 user: drh tags: memleak)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/collate1.test.
300
301
302
303
304
305
306





























307
308
  }
} {{} 1 12 101}
do_test collate1-4.5 {
  execsql {
    DROP TABLE collate1t1;
  }
} {}






























finish_test







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
  }
} {{} 1 12 101}
do_test collate1-4.5 {
  execsql {
    DROP TABLE collate1t1;
  }
} {}

# A problem reported on the mailing list:  A CREATE TABLE statement
# is allowed to have two or more COLLATE clauses on the same column.
# That probably ought to be an error, but we allow it for backwards
# compatibility.  Just make sure it works and doesn't leak memory.
#
do_test collate1-5.1 {
  execsql {
    CREATE TABLE c5(
      id INTEGER PRIMARY KEY,
      a TEXT COLLATE binary COLLATE nocase COLLATE rtrim,
      b TEXT COLLATE nocase COLLATE binary,
      c TEXT COLLATE rtrim COLLATE binary COLLATE rtrim COLLATE nocase
    );
    INSERT INTO c5 VALUES(1, 'abc','abc','abc');
    INSERT INTO c5 VALUES(2, 'abc   ','ABC','ABC');
    SELECT id FROM c5 WHERE a='abc' ORDER BY id;
  }
} {1 2}
do_test collate1-5.2 {
  execsql {
    SELECT id FROM c5 WHERE b='abc' ORDER BY id;
  }
} {1}
do_test collate1-5.3 {
  execsql {
    SELECT id FROM c5 WHERE c='abc' ORDER BY id;
  }
} {1 2}

finish_test