Skip to content

Commit f1b6fc6

Browse files
committed
Preparation of wxSQLite3 version 3.3.1
1 parent 2a75ab1 commit f1b6fc6

File tree

6 files changed

+51
-13
lines changed

6 files changed

+51
-13
lines changed

docs/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = wxSQLite3
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 3.3.0
41+
PROJECT_NUMBER = 3.3.1
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

include/wx/wxsqlite3.h

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "wx/wxsqlite3def.h"
2828

2929
/// wxSQLite3 version string
30-
#define wxSQLITE3_VERSION_STRING wxT("wxSQLite3 3.3.0")
30+
#define wxSQLITE3_VERSION_STRING wxT("wxSQLite3 3.3.1")
3131

3232
#define WXSQLITE_ERROR 1000
3333

@@ -65,7 +65,8 @@ enum wxSQLite3LimitType
6565
WXSQLITE_LIMIT_ATTACHED = 7,
6666
WXSQLITE_LIMIT_LIKE_PATTERN_LENGTH = 8,
6767
WXSQLITE_LIMIT_VARIABLE_NUMBER = 9,
68-
WXSQLITE_LIMIT_TRIGGER_DEPTH = 10
68+
WXSQLITE_LIMIT_TRIGGER_DEPTH = 10,
69+
WXSQLITE_LIMIT_WORKER_THREADS = 11
6970
};
7071

7172
/// Enumeration of journal modes
@@ -98,9 +99,10 @@ enum wxSQLite3StatementStatus
9899
#define WXSQLITE_OPEN_SHAREDCACHE 0x00020000
99100
#define WXSQLITE_OPEN_PRIVATECACHE 0x00040000
100101

101-
#define WXSQLITE_CHECKPOINT_PASSIVE 0
102-
#define WXSQLITE_CHECKPOINT_FULL 1
103-
#define WXSQLITE_CHECKPOINT_RESTART 2
102+
#define WXSQLITE_CHECKPOINT_PASSIVE 0
103+
#define WXSQLITE_CHECKPOINT_FULL 1
104+
#define WXSQLITE_CHECKPOINT_RESTART 2
105+
#define WXSQLITE_CHECKPOINT_TRUNCATE 3
104106

105107
inline void operator++(wxSQLite3LimitType& value)
106108
{
@@ -133,8 +135,8 @@ class WXDLLIMPEXP_SQLITE3 wxSQLite3Exception
133135
static const wxString ErrorCodeAsString(int errorCode);
134136

135137
private:
136-
int m_errorCode; ///< SQLite3 error code associated with this exception
137-
wxString m_errorMessage; ///< SQLite3 error message associated with this exception
138+
int m_errorCode; ///< SQLite3 error code associated with this exception
139+
wxString m_errorMessage; ///< SQLite3 error message associated with this exception
138140
};
139141

140142
/// SQL statment buffer for use with SQLite3's printf method
@@ -2662,6 +2664,12 @@ class WXDLLIMPEXP_SQLITE3 wxSQLite3Database
26622664
*/
26632665
void ReleaseMemory();
26642666

2667+
/// Get system error code
2668+
/**
2669+
* Get the underlying system error code after a SQLite function has failed, i.e. a file couldn't be opened
2670+
*/
2671+
int GetSystemErrorCode() const;
2672+
26652673
/// Convert database limit type to string
26662674
/**
26672675
* \param type The database limit type to be converted to string representation.

include/wx/wxsqlite3def.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@
4747
4848
<dl>
4949
50+
<dt><b>3.3.1</b> - <i>April 2016</i></dt>
51+
<dd>
52+
Upgrade to SQLite version 3.12.1<br>
53+
Added method wxSQLite3Database::GetSystemErrorCode<br>
54+
55+
56+
</dd>
5057
<dt><b>3.3.0</b> - <i>December 2015</i></dt>
5158
<dd>
5259
Upgrade to SQLite version 3.9.2<br>

include/wx/wxsqlite3dyn.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ DYNFUNC(return, int, sqlite3_stmt_readonly, (sqlite3_s
183183
#if SQLITE_VERSION_NUMBER >= 3007000
184184
DYNFUNC(return, int, sqlite3_stmt_status, (sqlite3_stmt* pStmt, int op, int resetFlg), (pStmt, op, resetFlg));
185185
#endif
186+
#if SQLITE_VERSION_NUMBER >= 3012001
187+
DYNFUNC(return, int, sqlite3_system_errno, (sqlite3* db), (db));
188+
#endif
186189
DYNFUNC(return, int, sqlite3_threadsafe, (void), ());
187190
// DYNFUNC(return, int, sqlite3_total_changes, (sqlite3 *db), (db));
188191
// DYNFUNC(return, void *, sqlite3_trace, (sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg), (db, xTrace, pArg));

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ tools operate in Unicode or UTF-8 mode.
2525

2626
## <a name="history"></a>Version history
2727

28+
* 3.3.1 - *April 2016*
29+
- Upgrade to SQLite version 3.12.1
30+
- Added method `wxSQLite3Database::GetSystemErrorCode`
2831
* 3.3.0 - *December 2015*
2932
- Upgrade to SQLite version 3.9.2 (including adjusted SQLite amalgamation source to fix problem with the user authentication module)
3033
- Transition from SourceForge to GitHub
31-
- Removal of build files for wxWidgets 2.9.x
32-
- Default build for wxWidgets 3.0.x
33-
- Added support for premake5 (version 5.0-alpha6 or later)
3434
* 3.2.1 - *March 2015*
3535
- Upgrade to SQLite version 3.8.8.3
3636
- Fixed a bug in method GetParamName

src/wxsqlite3.cpp

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4031,7 +4031,11 @@ int wxSQLite3Database::GetLimit(wxSQLite3LimitType id)
40314031
int value = -1;
40324032
#if SQLITE_VERSION_NUMBER >= 3005008
40334033
CheckDatabase();
4034+
#if SQLITE_VERSION_NUMBER >= 3008007
4035+
if (id >= WXSQLITE_LIMIT_LENGTH && id <= WXSQLITE_LIMIT_WORKER_THREADS)
4036+
#else
40344037
if (id >= WXSQLITE_LIMIT_LENGTH && id <= WXSQLITE_LIMIT_VARIABLE_NUMBER)
4038+
#endif
40354039
{
40364040
value = sqlite3_limit(m_db->m_db, id, -1);
40374041
}
@@ -4046,7 +4050,11 @@ int wxSQLite3Database::SetLimit(wxSQLite3LimitType id, int newValue)
40464050
int value = -1;
40474051
#if SQLITE_VERSION_NUMBER >= 3005008
40484052
CheckDatabase();
4053+
#if SQLITE_VERSION_NUMBER >= 3008007
4054+
if (id >= WXSQLITE_LIMIT_LENGTH && id <= WXSQLITE_LIMIT_WORKER_THREADS)
4055+
#else
40494056
if (id >= WXSQLITE_LIMIT_LENGTH && id <= WXSQLITE_LIMIT_VARIABLE_NUMBER)
4057+
#endif
40504058
{
40514059
value = sqlite3_limit(m_db->m_db, id, newValue);
40524060
}
@@ -4070,21 +4078,33 @@ void wxSQLite3Database::ReleaseMemory()
40704078
#endif
40714079
}
40724080

4081+
int wxSQLite3Database::GetSystemErrorCode() const
4082+
{
4083+
int rc = 0;
4084+
#if SQLITE_VERSION_NUMBER >= 3012000
4085+
if (m_db != NULL)
4086+
{
4087+
rc = sqlite3_system_errno(m_db->m_db);
4088+
}
4089+
#endif
4090+
return rc;
4091+
}
4092+
40734093
static const wxChar* limitCodeString[] =
40744094
{ wxT("SQLITE_LIMIT_LENGTH"), wxT("SQLITE_LIMIT_SQL_LENGTH"),
40754095
wxT("SQLITE_LIMIT_COLUMN"), wxT("SQLITE_LIMIT_EXPR_DEPTH"),
40764096
wxT("SQLITE_LIMIT_COMPOUND_SELECT"), wxT("SQLITE_LIMIT_VDBE_OP"),
40774097
wxT("SQLITE_LIMIT_FUNCTION_ARG"), wxT("SQLITE_LIMIT_ATTACHED"),
40784098
wxT("SQLITE_LIMIT_LIKE_PATTERN_LENGTH"), wxT("SQLITE_LIMIT_VARIABLE_NUMBER"),
4079-
wxT("SQLITE_LIMIT_TRIGGER_DEPTH")
4099+
wxT("SQLITE_LIMIT_TRIGGER_DEPTH"), wxT("SQLITE_LIMIT_WORKER_THREADS")
40804100
};
40814101

40824102

40834103
/* static */
40844104
wxString wxSQLite3Database::LimitTypeToString(wxSQLite3LimitType type)
40854105
{
40864106
const wxChar* limitString = wxT("Unknown");
4087-
if (type >= WXSQLITE_LIMIT_LENGTH && type <= WXSQLITE_LIMIT_VARIABLE_NUMBER)
4107+
if (type >= WXSQLITE_LIMIT_LENGTH && type <= WXSQLITE_LIMIT_WORKER_THREADS)
40884108
{
40894109
limitString = limitCodeString[type];
40904110
}

0 commit comments

Comments
 (0)