os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/mallocI.test
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
# 2008 August 01
sl@0
     2
#
sl@0
     3
# The author disclaims copyright to this source code.  In place of
sl@0
     4
# a legal notice, here is a blessing:
sl@0
     5
#
sl@0
     6
#    May you do good and not evil.
sl@0
     7
#    May you find forgiveness for yourself and forgive others.
sl@0
     8
#    May you share freely, never taking more than you give.
sl@0
     9
#
sl@0
    10
#***********************************************************************
sl@0
    11
#
sl@0
    12
# This test script checks malloc failures in various obscure operations.
sl@0
    13
# 
sl@0
    14
# $Id: mallocI.test,v 1.1 2008/08/02 03:50:39 drh Exp $
sl@0
    15
sl@0
    16
set testdir [file dirname $argv0]
sl@0
    17
source $testdir/tester.tcl
sl@0
    18
source $testdir/malloc_common.tcl
sl@0
    19
sl@0
    20
# Malloc failures in a view.
sl@0
    21
#
sl@0
    22
do_malloc_test mallocI-1 -sqlprep {
sl@0
    23
  CREATE TABLE t1(a,b,c,d);
sl@0
    24
  CREATE VIEW v1 AS SELECT a*b, c*d FROM t1 ORDER BY b-d;
sl@0
    25
} -sqlbody {
sl@0
    26
  SELECT * FROM v1
sl@0
    27
}
sl@0
    28
sl@0
    29
# Malloc failure while trying to service a pragma on a TEMP database.
sl@0
    30
#
sl@0
    31
do_malloc_test mallocI-2 -sqlbody {
sl@0
    32
  PRAGMA temp.page_size
sl@0
    33
}
sl@0
    34
sl@0
    35
# Malloc failure while creating a table from a SELECT statement.
sl@0
    36
#
sl@0
    37
do_malloc_test mallocI-3 -sqlprep {
sl@0
    38
  CREATE TABLE t1(a,b,c);
sl@0
    39
} -sqlbody {
sl@0
    40
  CREATE TABLE t2 AS SELECT b,c FROM t1;
sl@0
    41
}
sl@0
    42
sl@0
    43
finish_test