Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: third_party/sqlite/patches/0003-backport-SQLite-memcmp-patch.patch

Issue 901033002: Import SQLite 3.8.7.4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chromium changes to support SQLite 3.8.7.4. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 From cd23f4b26a4575353589a97f039accb2c8ec5143 Mon Sep 17 00:00:00 2001
2 From: Scott Hess <shess@chromium.org>
3 Date: Fri, 10 May 2013 02:52:43 +0000
4 Subject: [PATCH 03/23] [backport] SQLite memcmp patch.
5
6 http://www.sqlite.org/src/info/d73435587b
7
8 Verified that the amalgamation came out with all the right patches by
9 comparing the amalgamation diff to the appropriately-ordered diffs of
10 the original files.
11
12 BUG=178677
13
14 Original review URL: https://chromiumcodereview.appspot.com/15070002
15 ---
16 third_party/sqlite/src/src/analyze.c | 4 ++--
17 third_party/sqlite/src/src/build.c | 2 +-
18 third_party/sqlite/src/src/expr.c | 4 +---
19 third_party/sqlite/src/src/os_unix.c | 2 +-
20 third_party/sqlite/src/src/vdbeapi.c | 2 +-
21 5 files changed, 6 insertions(+), 8 deletions(-)
22
23 diff --git a/third_party/sqlite/src/src/analyze.c b/third_party/sqlite/src/src/a nalyze.c
24 index 17c1de8..2444e74 100644
25 --- a/third_party/sqlite/src/src/analyze.c
26 +++ b/third_party/sqlite/src/src/analyze.c
27 @@ -142,7 +142,7 @@ static void analyzeOneTable(
28 /* Do not gather statistics on views or virtual tables */
29 return;
30 }
31 - if( memcmp(pTab->zName, "sqlite_", 7)==0 ){
32 + if( sqlite3_strnicmp(pTab->zName, "sqlite_", 7)==0 ){
33 /* Do not gather statistics on system tables */
34 return;
35 }
36 @@ -548,7 +548,7 @@ static int analysisLoader(void *pData, int argc, char **argv , char **NotUsed){
37 if( pIndex==0 ) break;
38 pIndex->aiRowEst[i] = v;
39 if( *z==' ' ) z++;
40 - if( memcmp(z, "unordered", 10)==0 ){
41 + if( strcmp(z, "unordered")==0 ){
42 pIndex->bUnordered = 1;
43 break;
44 }
45 diff --git a/third_party/sqlite/src/src/build.c b/third_party/sqlite/src/src/bui ld.c
46 index 83a1db8..25a74ca 100644
47 --- a/third_party/sqlite/src/src/build.c
48 +++ b/third_party/sqlite/src/src/build.c
49 @@ -2477,7 +2477,7 @@ Index *sqlite3CreateIndex(
50 assert( pTab!=0 );
51 assert( pParse->nErr==0 );
52 if( sqlite3StrNICmp(pTab->zName, "sqlite_", 7)==0
53 - && memcmp(&pTab->zName[7],"altertab_",9)!=0 ){
54 + && sqlite3StrNICmp(&pTab->zName[7],"altertab_",9)!=0 ){
55 sqlite3ErrorMsg(pParse, "table %s may not be indexed", pTab->zName);
56 goto exit_create_index;
57 }
58 diff --git a/third_party/sqlite/src/src/expr.c b/third_party/sqlite/src/src/expr .c
59 index 2699ae1..9d1193b 100644
60 --- a/third_party/sqlite/src/src/expr.c
61 +++ b/third_party/sqlite/src/src/expr.c
62 @@ -578,12 +578,10 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr ){
63 ** has never appeared before, reuse the same variable number
64 */
65 int i;
66 - u32 n;
67 - n = sqlite3Strlen30(z);
68 for(i=0; i<pParse->nVarExpr; i++){
69 Expr *pE = pParse->apVarExpr[i];
70 assert( pE!=0 );
71 - if( memcmp(pE->u.zToken, z, n)==0 && pE->u.zToken[n]==0 ){
72 + if( strcmp(pE->u.zToken, z)==0 ){
73 pExpr->iColumn = pE->iColumn;
74 break;
75 }
76 diff --git a/third_party/sqlite/src/src/os_unix.c b/third_party/sqlite/src/src/o s_unix.c
77 index 2626ab4..998e353 100644
78 --- a/third_party/sqlite/src/src/os_unix.c
79 +++ b/third_party/sqlite/src/src/os_unix.c
80 @@ -4456,7 +4456,7 @@ static int fillInUnixFile(
81 pNew->h = h;
82 pNew->dirfd = dirfd;
83 pNew->zPath = zFilename;
84 - if( memcmp(pVfs->zName,"unix-excl",10)==0 ){
85 + if( strcmp(pVfs->zName,"unix-excl")==0 ){
86 pNew->ctrlFlags = UNIXFILE_EXCL;
87 }else{
88 pNew->ctrlFlags = 0;
89 diff --git a/third_party/sqlite/src/src/vdbeapi.c b/third_party/sqlite/src/src/v dbeapi.c
90 index 90baacc..80ceb9f 100644
91 --- a/third_party/sqlite/src/src/vdbeapi.c
92 +++ b/third_party/sqlite/src/src/vdbeapi.c
93 @@ -1222,7 +1222,7 @@ int sqlite3VdbeParameterIndex(Vdbe *p, const char *zName, int nName){
94 if( zName ){
95 for(i=0; i<p->nVar; i++){
96 const char *z = p->azVar[i];
97 - if( z && memcmp(z,zName,nName)==0 && z[nName]==0 ){
98 + if( z && strncmp(z,zName,nName)==0 && z[nName]==0 ){
99 return i+1;
100 }
101 }
102 --
103 2.2.1
104
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698