Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Windows only: remove duplicate code from sqlite3.c in db.c |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
2f58d48cabfb675fd418da343c05b15b |
| User & Date: | ron 2010-02-06 17:25:07.000 |
References
|
2010-02-08
| ||
| 14:50 | • New ticket [f64f9b57eb] warnings introduced in db.c since checkin [2f58d48cab]. artifact: df11fb436d user: rwilson | |
Context
|
2010-02-08
| ||
| 16:08 | Alternative fix for ticket [9ff56ae8a6]. check-in: 3cc4cd55d8 user: drh tags: trunk | |
|
2010-02-06
| ||
| 20:20 | fixed [9ff56ae8a6] - "fossil sha" crash check-in: 4027ad4b7e user: ron tags: dead-end | |
| 17:25 | Windows only: remove duplicate code from sqlite3.c in db.c check-in: 2f58d48cab user: ron tags: trunk | |
| 12:14 | Fix double-free of zCopy in date_to_uuid(). Ticket [dc2b2503031] check-in: 01a769a9fa user: drh tags: trunk | |
Changes
Changes to src/db.c.
| ︙ | ︙ | |||
510 511 512 513 514 515 516 |
va_end(ap);
if( db_step(&s)==SQLITE_ROW ){
z = mprintf("%s", sqlite3_column_text(s.pStmt, 0));
}
db_finalize(&s);
return z;
}
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 |
va_end(ap);
if( db_step(&s)==SQLITE_ROW ){
z = mprintf("%s", sqlite3_column_text(s.pStmt, 0));
}
db_finalize(&s);
return z;
}
/*
** Initialize a new database file with the given schema. If anything
** goes wrong, call db_err() to exit.
*/
void db_init_database(
const char *zFileName, /* Name of database file to create */
const char *zSchema, /* First part of schema */
... /* Additional SQL to run. Terminate with NULL. */
){
sqlite3 *db;
int rc;
const char *zSql;
va_list ap;
#ifdef __MINGW32__
zFileName = sqlite3_win32_mbcs_to_utf8(zFileName);
#endif
rc = sqlite3_open(zFileName, &db);
if( rc!=SQLITE_OK ){
db_err(sqlite3_errmsg(db));
}
sqlite3_busy_timeout(db, 5000);
sqlite3_exec(db, "BEGIN EXCLUSIVE", 0, 0, 0);
|
| ︙ | ︙ | |||
637 638 639 640 641 642 643 |
static sqlite3 *openDatabase(const char *zDbName){
int rc;
const char *zVfs;
sqlite3 *db;
zVfs = getenv("FOSSIL_VFS");
#ifdef __MINGW32__
| | | 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
static sqlite3 *openDatabase(const char *zDbName){
int rc;
const char *zVfs;
sqlite3 *db;
zVfs = getenv("FOSSIL_VFS");
#ifdef __MINGW32__
zDbName = sqlite3_win32_mbcs_to_utf8(zDbName);
#endif
rc = sqlite3_open_v2(
zDbName, &db,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
zVfs
);
if( rc!=SQLITE_OK ){
|
| ︙ | ︙ | |||
663 664 665 666 667 668 669 |
*/
void db_open_or_attach(const char *zDbName, const char *zLabel){
if( !g.db ){
g.db = openDatabase(zDbName);
db_connection_init();
}else{
#ifdef __MINGW32__
| | | 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 |
*/
void db_open_or_attach(const char *zDbName, const char *zLabel){
if( !g.db ){
g.db = openDatabase(zDbName);
db_connection_init();
}else{
#ifdef __MINGW32__
zDbName = sqlite3_win32_mbcs_to_utf8(zDbName);
#endif
db_multi_exec("ATTACH DATABASE %Q AS %s", zDbName, zLabel);
}
}
/*
** Open the user database in "~/.fossil". Create the database anew if
|
| ︙ | ︙ |