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

Side by Side Diff: third_party/sqlite/src/src/analyze.c

Issue 15070002: Backport SQLite memcmp patch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unnecessary variable. Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/memcmp.patch ('k') | third_party/sqlite/src/src/build.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ** 2005 July 8 2 ** 2005 July 8
3 ** 3 **
4 ** The author disclaims copyright to this source code. In place of 4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing: 5 ** a legal notice, here is a blessing:
6 ** 6 **
7 ** May you do good and not evil. 7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others. 8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give. 9 ** May you share freely, never taking more than you give.
10 ** 10 **
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 #endif 135 #endif
136 136
137 v = sqlite3GetVdbe(pParse); 137 v = sqlite3GetVdbe(pParse);
138 if( v==0 || NEVER(pTab==0) ){ 138 if( v==0 || NEVER(pTab==0) ){
139 return; 139 return;
140 } 140 }
141 if( pTab->tnum==0 ){ 141 if( pTab->tnum==0 ){
142 /* Do not gather statistics on views or virtual tables */ 142 /* Do not gather statistics on views or virtual tables */
143 return; 143 return;
144 } 144 }
145 if( memcmp(pTab->zName, "sqlite_", 7)==0 ){ 145 if( sqlite3_strnicmp(pTab->zName, "sqlite_", 7)==0 ){
146 /* Do not gather statistics on system tables */ 146 /* Do not gather statistics on system tables */
147 return; 147 return;
148 } 148 }
149 assert( sqlite3BtreeHoldsAllMutexes(db) ); 149 assert( sqlite3BtreeHoldsAllMutexes(db) );
150 iDb = sqlite3SchemaToIndex(db, pTab->pSchema); 150 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
151 assert( iDb>=0 ); 151 assert( iDb>=0 );
152 assert( sqlite3SchemaMutexHeld(db, iDb, 0) ); 152 assert( sqlite3SchemaMutexHeld(db, iDb, 0) );
153 #ifndef SQLITE_OMIT_AUTHORIZATION 153 #ifndef SQLITE_OMIT_AUTHORIZATION
154 if( sqlite3AuthCheck(pParse, SQLITE_ANALYZE, pTab->zName, 0, 154 if( sqlite3AuthCheck(pParse, SQLITE_ANALYZE, pTab->zName, 0,
155 db->aDb[iDb].zName ) ){ 155 db->aDb[iDb].zName ) ){
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 for(i=0; *z && i<=n; i++){ 541 for(i=0; *z && i<=n; i++){
542 v = 0; 542 v = 0;
543 while( (c=z[0])>='0' && c<='9' ){ 543 while( (c=z[0])>='0' && c<='9' ){
544 v = v*10 + c - '0'; 544 v = v*10 + c - '0';
545 z++; 545 z++;
546 } 546 }
547 if( i==0 ) pTable->nRowEst = v; 547 if( i==0 ) pTable->nRowEst = v;
548 if( pIndex==0 ) break; 548 if( pIndex==0 ) break;
549 pIndex->aiRowEst[i] = v; 549 pIndex->aiRowEst[i] = v;
550 if( *z==' ' ) z++; 550 if( *z==' ' ) z++;
551 if( memcmp(z, "unordered", 10)==0 ){ 551 if( strcmp(z, "unordered")==0 ){
552 pIndex->bUnordered = 1; 552 pIndex->bUnordered = 1;
553 break; 553 break;
554 } 554 }
555 } 555 }
556 return 0; 556 return 0;
557 } 557 }
558 558
559 /* 559 /*
560 ** If the Index.aSample variable is not NULL, delete the aSample[] array 560 ** If the Index.aSample variable is not NULL, delete the aSample[] array
561 ** and its contents. 561 ** and its contents.
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 #endif 710 #endif
711 711
712 if( rc==SQLITE_NOMEM ){ 712 if( rc==SQLITE_NOMEM ){
713 db->mallocFailed = 1; 713 db->mallocFailed = 1;
714 } 714 }
715 return rc; 715 return rc;
716 } 716 }
717 717
718 718
719 #endif /* SQLITE_OMIT_ANALYZE */ 719 #endif /* SQLITE_OMIT_ANALYZE */
OLDNEW
« no previous file with comments | « third_party/sqlite/memcmp.patch ('k') | third_party/sqlite/src/src/build.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698