mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Merge the changes need to compile on WinRT into trunk.
FossilOrigin-Name: 61360ca6ca3448477d5c662d3642beef6dd2079e
This commit is contained in:
44
src/pragma.c
44
src/pragma.c
@@ -804,6 +804,50 @@ void sqlite3Pragma(
|
||||
}
|
||||
}else
|
||||
|
||||
#if SQLITE_OS_WIN
|
||||
/*
|
||||
** PRAGMA data_store_directory
|
||||
** PRAGMA data_store_directory = ""|"directory_name"
|
||||
**
|
||||
** Return or set the local value of the data_store_directory flag. Changing
|
||||
** the value sets a specific directory to be used for database files that
|
||||
** were specified with a relative pathname. Setting to a null string reverts
|
||||
** to the default database directory, which for database files specified with
|
||||
** a relative path will probably be based on the current directory for the
|
||||
** process. Database file specified with an absolute path are not impacted
|
||||
** by this setting, regardless of its value.
|
||||
**
|
||||
*/
|
||||
if( sqlite3StrICmp(zLeft, "data_store_directory")==0 ){
|
||||
if( !zRight ){
|
||||
if( sqlite3_data_directory ){
|
||||
sqlite3VdbeSetNumCols(v, 1);
|
||||
sqlite3VdbeSetColName(v, 0, COLNAME_NAME,
|
||||
"data_store_directory", SQLITE_STATIC);
|
||||
sqlite3VdbeAddOp4(v, OP_String8, 0, 1, 0, sqlite3_data_directory, 0);
|
||||
sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1);
|
||||
}
|
||||
}else{
|
||||
#ifndef SQLITE_OMIT_WSD
|
||||
if( zRight[0] ){
|
||||
int res;
|
||||
rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res);
|
||||
if( rc!=SQLITE_OK || res==0 ){
|
||||
sqlite3ErrorMsg(pParse, "not a writable directory");
|
||||
goto pragma_out;
|
||||
}
|
||||
}
|
||||
sqlite3_free(sqlite3_data_directory);
|
||||
if( zRight[0] ){
|
||||
sqlite3_data_directory = sqlite3_mprintf("%s", zRight);
|
||||
}else{
|
||||
sqlite3_data_directory = 0;
|
||||
}
|
||||
#endif /* SQLITE_OMIT_WSD */
|
||||
}
|
||||
}else
|
||||
#endif
|
||||
|
||||
#if !defined(SQLITE_ENABLE_LOCKING_STYLE)
|
||||
# if defined(__APPLE__)
|
||||
# define SQLITE_ENABLE_LOCKING_STYLE 1
|
||||
|
||||
Reference in New Issue
Block a user