summaryrefslogtreecommitdiffstats
path: root/third_party/sqlite
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-05 16:17:40 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-05 16:17:40 +0000
commit986f4f740717ba72f9afe0dbf66906de27573365 (patch)
treee698c4e1ea86cb9fdf77330bea34a1ba8952a640 /third_party/sqlite
parent15dba1a65b73ae38b6a79f9dedd8fb820007404a (diff)
downloadchromium_src-986f4f740717ba72f9afe0dbf66906de27573365.zip
chromium_src-986f4f740717ba72f9afe0dbf66906de27573365.tar.gz
chromium_src-986f4f740717ba72f9afe0dbf66906de27573365.tar.bz2
Linux: backport SQLite's http://sqlite.org/src/ci/9109128cb5
This is a fix needed for experiments with using unpatched sqlite. BUG=22208 Review URL: http://codereview.chromium.org/7575027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95622 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/sqlite')
-rw-r--r--third_party/sqlite/README.chromium2
-rw-r--r--third_party/sqlite/amalgamation/sqlite3.c6
-rw-r--r--third_party/sqlite/src/src/os_unix.c6
-rw-r--r--third_party/sqlite/system-sqlite.patch48
4 files changed, 56 insertions, 6 deletions
diff --git a/third_party/sqlite/README.chromium b/third_party/sqlite/README.chromium
index dd729b8..d53d8ba 100644
--- a/third_party/sqlite/README.chromium
+++ b/third_party/sqlite/README.chromium
@@ -70,6 +70,7 @@ attach-integer.patch
webdb.patch
test.patch
mac_time_machine.patch
+system-sqlite.patch
So, e.g. you could do this to apply all our patches to vanilla SQLite:
@@ -83,6 +84,7 @@ patch -p0 < ../sqlite/icu-shell.patch
patch -p0 < ../sqlite/webdb.patch
patch -p0 < ../sqlite/test.patch
patch -p0 < ../sqlite/mac_time_machine.patch
+patch -p0 < ../sqlite/system-sqlite.patch
This will only be the case if all changes we make also update the corresponding
patch files. Therefore please remember to do that whenever you make a change!
diff --git a/third_party/sqlite/amalgamation/sqlite3.c b/third_party/sqlite/amalgamation/sqlite3.c
index 5115f81..3e794a9 100644
--- a/third_party/sqlite/amalgamation/sqlite3.c
+++ b/third_party/sqlite/amalgamation/sqlite3.c
@@ -28902,7 +28902,7 @@ static UnixUnusedFd *findReusableFd(const char *zPath, int flags){
**
** Even if a subsequent open() call does succeed, the consequences of
** not searching for a resusable file descriptor are not dire. */
- if( 0==stat(zPath, &sStat) ){
+ if( 0==osStat(zPath, &sStat) ){
unixInodeInfo *pInode;
unixEnterMutex();
@@ -28972,7 +28972,7 @@ static int findCreateFileMode(
memcpy(zDb, zPath, nDb);
zDb[nDb] = '\0';
- if( 0==stat(zDb, &sStat) ){
+ if( 0==osStat(zDb, &sStat) ){
*pMode = sStat.st_mode & 0777;
}else{
rc = SQLITE_IOERR_FSTAT;
@@ -29376,7 +29376,7 @@ static int unixAccess(
*pResOut = (osAccess(zPath, amode)==0);
if( flags==SQLITE_ACCESS_EXISTS && *pResOut ){
struct stat buf;
- if( 0==stat(zPath, &buf) && buf.st_size==0 ){
+ if( 0==osStat(zPath, &buf) && buf.st_size==0 ){
*pResOut = 0;
}
}
diff --git a/third_party/sqlite/src/src/os_unix.c b/third_party/sqlite/src/src/os_unix.c
index 2216470..e5b2540 100644
--- a/third_party/sqlite/src/src/os_unix.c
+++ b/third_party/sqlite/src/src/os_unix.c
@@ -4757,7 +4757,7 @@ static UnixUnusedFd *findReusableFd(const char *zPath, int flags){
**
** Even if a subsequent open() call does succeed, the consequences of
** not searching for a resusable file descriptor are not dire. */
- if( 0==stat(zPath, &sStat) ){
+ if( 0==osStat(zPath, &sStat) ){
unixInodeInfo *pInode;
unixEnterMutex();
@@ -4827,7 +4827,7 @@ static int findCreateFileMode(
memcpy(zDb, zPath, nDb);
zDb[nDb] = '\0';
- if( 0==stat(zDb, &sStat) ){
+ if( 0==osStat(zDb, &sStat) ){
*pMode = sStat.st_mode & 0777;
}else{
rc = SQLITE_IOERR_FSTAT;
@@ -5231,7 +5231,7 @@ static int unixAccess(
*pResOut = (osAccess(zPath, amode)==0);
if( flags==SQLITE_ACCESS_EXISTS && *pResOut ){
struct stat buf;
- if( 0==stat(zPath, &buf) && buf.st_size==0 ){
+ if( 0==osStat(zPath, &buf) && buf.st_size==0 ){
*pResOut = 0;
}
}
diff --git a/third_party/sqlite/system-sqlite.patch b/third_party/sqlite/system-sqlite.patch
new file mode 100644
index 0000000..f61f019
--- /dev/null
+++ b/third_party/sqlite/system-sqlite.patch
@@ -0,0 +1,48 @@
+This is a backport of http://sqlite.org/src/ci/9109128cb5,
+which is needed for experiments with using unpatched sqlite.
+If you hit a merge conflict on this file it is most likely
+that you've upgraded to version of sqlite that includes this patch.
+Index: src/os_unix.c
+===================================================================
+--- src/os_unix.c
++++ src/os_unix.c
+@@ -4787,11 +4787,11 @@
+ ** ignored and -1 is returned. The caller will try to open a new file
+ ** descriptor on the same path, fail, and return an error to SQLite.
+ **
+ ** Even if a subsequent open() call does succeed, the consequences of
+ ** not searching for a resusable file descriptor are not dire. */
+- if( 0==stat(zPath, &sStat) ){
++ if( 0==osStat(zPath, &sStat) ){
+ unixInodeInfo *pInode;
+
+ unixEnterMutex();
+ pInode = inodeList;
+ while( pInode && (pInode->fileId.dev!=sStat.st_dev
+@@ -4863,11 +4863,11 @@
+ while( nDb>0 && zPath[nDb]!='-' ) nDb--;
+ if( nDb==0 ) return SQLITE_OK;
+ memcpy(zDb, zPath, nDb);
+ zDb[nDb] = '\0';
+
+- if( 0==stat(zDb, &sStat) ){
++ if( 0==osStat(zDb, &sStat) ){
+ *pMode = sStat.st_mode & 0777;
+ }else{
+ rc = SQLITE_IOERR_FSTAT;
+ }
+ }else if( flags & SQLITE_OPEN_DELETEONCLOSE ){
+@@ -5208,11 +5208,11 @@
+ assert(!"Invalid flags argument");
+ }
+ *pResOut = (osAccess(zPath, amode)==0);
+ if( flags==SQLITE_ACCESS_EXISTS && *pResOut ){
+ struct stat buf;
+- if( 0==stat(zPath, &buf) && buf.st_size==0 ){
++ if( 0==osStat(zPath, &buf) && buf.st_size==0 ){
+ *pResOut = 0;
+ }
+ }
+ return SQLITE_OK;
+ }
+