/ Check-in [e2ca936f]
Login

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

Overview
Comment:Fix a bug in the soundex() code. Ticket #367. Add tests for ticket #261 even thought the problem could not be reproduced. (CVS 1035)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e2ca936feee35b3fce99c95c2cf8c0ad05cd9c3b
User & Date: drh 2003-06-28 16:20:23
Context
2003-06-28
16:25
Minor change to a comment in encode.c. (CVS 1036) check-in: 3f252b72 user: drh tags: trunk
16:20
Fix a bug in the soundex() code. Ticket #367. Add tests for ticket #261 even thought the problem could not be reproduced. (CVS 1035) check-in: e2ca936f user: drh tags: trunk
2003-06-24
10:39
In a SELECT, the rowid of a view or subquery which is really a join is set to NULL if the join is flattened. Ticket #364. (CVS 1034) check-in: bad8b558 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/func.c.

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
** This file contains the C functions that implement various SQL
** functions of SQLite.  
**
** There is only one exported symbol in this file - the function
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: func.c,v 1.25 2003/05/13 01:52:32 drh Exp $
*/
#include <ctype.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>
#include "sqliteInt.h"

................................................................................
    }
    while( j<4 ){
      zResult[j++] = '0';
    }
    zResult[j] = 0;
    sqlite_set_result_string(context, zResult, 4);
  }else{
    sqlite_set_result_string(context, zResult, "?000", 4);
  }
}
#endif

#ifdef SQLITE_TEST
/*
** This function generates a string of random characters.  Used for







|







 







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
** This file contains the C functions that implement various SQL
** functions of SQLite.  
**
** There is only one exported symbol in this file - the function
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
**
** $Id: func.c,v 1.26 2003/06/28 16:20:23 drh Exp $
*/
#include <ctype.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>
#include "sqliteInt.h"

................................................................................
    }
    while( j<4 ){
      zResult[j++] = '0';
    }
    zResult[j] = 0;
    sqlite_set_result_string(context, zResult, 4);
  }else{
    sqlite_set_result_string(context, "?000", 4);
  }
}
#endif

#ifdef SQLITE_TEST
/*
** This function generates a string of random characters.  Used for

Changes to src/os.c.

103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
** by the same process.  It does not explicitly say so, but this implies
** that it overrides locks set by the same process using a different
** file descriptor.  Consider this test case:
**
**       int fd1 = open("./file1", O_RDWR|O_CREAT, 0644);
**       int fd2 = open("./file2", O_RDWR|O_CREAT, 0644);
**
** Suppose ./file1 and ./file2 are really be the same file (because
** one is a hard or symbolic link to the other) then if you set
** an exclusive lock on fd1, then try to get an exclusive lock
** on fd2, it works.  I would have expected the second lock to
** fail since there was already a lock on the file due to fd1.
** But not so.  Since both locks came from the same process, the
** second overrides the first, even though they were on different
** file descriptors opened on different file names.







|







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
** by the same process.  It does not explicitly say so, but this implies
** that it overrides locks set by the same process using a different
** file descriptor.  Consider this test case:
**
**       int fd1 = open("./file1", O_RDWR|O_CREAT, 0644);
**       int fd2 = open("./file2", O_RDWR|O_CREAT, 0644);
**
** Suppose ./file1 and ./file2 are really the same file (because
** one is a hard or symbolic link to the other) then if you set
** an exclusive lock on fd1, then try to get an exclusive lock
** on fd2, it works.  I would have expected the second lock to
** fail since there was already a lock on the file due to fd1.
** But not so.  Since both locks came from the same process, the
** second overrides the first, even though they were on different
** file descriptors opened on different file names.

Changes to test/capi2.test.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
450
451
452
453
454
455
456

457





458
459
460
461
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script testing the callback-free C/C++ API.
#
# $Id: capi2.test,v 1.7 2003/05/16 02:30:27 drh Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Check basic functionality
#
................................................................................
  db changes
} {0}
do_test capi2-7.12 {
  set x [stepsql $DB {EXPLAIN SELECT * FROM t1}]
  lindex $x 0
} {0}









db2 close

finish_test







|







 







>
|
>
>
>
>
>




7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script testing the callback-free C/C++ API.
#
# $Id: capi2.test,v 1.8 2003/06/28 16:20:24 drh Exp $
#

set testdir [file dirname $argv0]
source $testdir/tester.tcl

# Check basic functionality
#
................................................................................
  db changes
} {0}
do_test capi2-7.12 {
  set x [stepsql $DB {EXPLAIN SELECT * FROM t1}]
  lindex $x 0
} {0}

# Ticket #261 - make sure we can finalize before the end of a query.
#
do_test capi2-8.1 {
  set VM1 [sqlite_compile $DB {SELECT * FROM t2} TAIL]
  sqlite_finalize $VM1
} {}
  

db2 close

finish_test