Commit Graph

57 Commits

Author SHA1 Message Date
Aleksander Machniak
05ea5a5548 Add ignore_errors option to rcube_db, so error logging can be disabled temporarily
Use ignore_errors to make sure the DDL upgrade errors are printed only once.
2017-07-02 11:51:05 +02:00
Aleksander Machniak
72f19c079f Installer: Fix DB schema initialization on MS SQL Server 2017-04-06 12:17:59 +02:00
Aleksander Machniak
e160e48069 Fix undesired effects when postgres database uses different timezone than PHP host (#5708)
Allow passing DateTime variables as query arguments. Their value will
be converted to date/time input string in format specific to the database type
(with timezone on postgres).
2017-04-03 12:06:23 +02:00
ka7
9a35768c26 spelling fixes (#5690) 2017-03-12 12:14:19 +01:00
Aleksander Machniak
c1c0a0d815 Implemented rcube::sleep() method for disconnecting all external connection in long-running/sleeping scripts 2016-09-21 11:20:43 -04:00
Aleksander Machniak
184de7735c CS fixes (mostly phpdoc) 2016-08-18 08:50:59 +02:00
Aleksander Machniak
c478536741 Make SQL selects less expensive in memory for some cases where we fetch big data chunks 2016-06-10 18:45:28 +02:00
Aleksander Machniak
7e3298753a Use ternary operator where aplicable 2015-11-14 10:08:07 +01:00
Aleksander Machniak
0ee57208b3 Add possibility to set PDO::ATTR_PREFETCH and PDO::ATTR_TIMEOUT via DSN string 2015-09-23 12:58:05 +02:00
Aleksander Machniak
a958748947 CS fixes 2015-06-07 15:26:33 +02:00
Aleksander Machniak
48d01837a0 Fix tables listing routine on mysql and postgres so it skips system or other database tables and views (#1490337) 2015-04-06 12:00:09 +02:00
Aleksander Machniak
496972bf95 Fix backtick character handling in sql queries (#1490312) 2015-03-12 09:44:31 +01:00
Aleksander Machniak
8f485469c7 Add possibility to configure max_allowed_packet value for all database engines (#1490283) 2015-02-24 12:23:11 +01:00
Aleksander Machniak
7b924535fd CS fixes 2015-01-03 13:59:07 +01:00
Thomas Bruederli
a63b9b546c Add plugin hook 'db_table_name' as requested in #1489837 2014-11-03 15:14:38 +01:00
Aleksander Machniak
fb8adc8a19 Remove Oracle driver based on PDO_OCI extension 2014-09-18 16:48:53 +02:00
Aleksander Machniak
8451577659 Added transactions support 2014-09-17 20:39:16 +02:00
Aleksander Machniak
d7c91c14f8 Add Oracle driver which uses OCI8 extension - the one that supports CLOB columns 2014-09-17 19:58:54 +02:00
Aleksander Machniak
34a0902089 Use consistent column/table quoting in sql queries 2014-09-12 14:37:51 +02:00
Aleksander Machniak
4baf96a4ca Added license headers to driver files, CS fixes 2014-09-08 09:50:59 +02:00
Aleksander Machniak
3ce4f0a839 Revert [78a58162], TABLE_SCHEMA column does not exist in mysql, also
tables in postgres can be in 'public' schema.
2014-04-29 12:29:11 +02:00
Aleksander Machniak
90f7aa9e39 Fix varius db_prefix issues (#1489839)
- Move DDL script execution code to rcube_db class(es).
- Improve prefix replacement code, so index names are also modified
2014-04-29 11:34:43 +02:00
Marc-Oliver Teschke
78a58162d8 When checking if DB schema is up-to-date, limit the checks to tables in our current schema. Otherwise installer might return false positives when DB user has access to multiple schemas.
Signed-off-by: Marc-Oliver Teschke <teschke@planwerk6.de>
2014-04-14 17:08:01 +02:00
Aleksander Machniak
00de8ddf8d Small performance improvements, use str_replace() instead of strtr(),
do not parse query if there are no params to replace,
keep one instance of (potentially long) query less in memory
2013-11-06 13:11:31 +01:00
Aleksander Machniak
899e594474 Key duplicate error on postgres uses SQLSTATE=23505 2013-10-14 09:09:01 +02:00
Thomas Bruederli
6a6992f650 Assign the chosen mode to the table map 2013-10-07 11:52:21 +02:00
Thomas Bruederli
a69f9918cd Improve selection of replicated database connection:
- Analyze query and prefer dsnr unless a write operation for a table involved has been carried out before
- New config option and setter method to enforce connection mode on table level
2013-10-07 11:29:52 +02:00
Thomas Bruederli
92d18cf32e New option to disable the use of already established dsnw connections for subsequent reads 2013-10-04 13:50:12 +02:00
Thomas Bruederli
0ee22c2145 Retry queries on deadlock errors from InnoDB row-level locking (MySQL) 2013-09-12 17:17:07 +02:00
Aleksander Machniak
60b6d7c389 Fix database cache expunge issues (#1489149) - added 'expires' column 2013-06-09 11:07:46 +02:00
Aleksander Machniak
d186405c00 Simplified db connection initialisation code 2013-06-08 20:14:33 +02:00
Aleksander Machniak
66407a75d1 Fix date format issues on MS SQL Server (#1488918) 2013-06-08 19:53:04 +02:00
Aleksander Machniak
aa44ce6e97 Add optional argument to now() for simple interval calculations on SQL-side 2013-06-05 18:54:26 +02:00
Aleksander Machniak
be4b5c2fe5 Fix "duplicate entry" errors on inserts to imap cache tables (#1489146) 2013-06-05 15:20:53 +02:00
Aleksander Machniak
5df4fe56d5 Fix backward copat. with cached values serialized but not base64-encoded (#1489142) 2013-06-02 14:44:09 +02:00
Aleksander Machniak
a6b0ca60a4 Fix bug where serialized strings were truncated in PDO::quote() (#1489142) 2013-06-02 14:33:11 +02:00
Aleksander Machniak
43079d8e2d Simplify/fix debug lines truncation 2013-05-15 13:20:48 +02:00
Aleksander Machniak
9b8d22ebe1 Limit debug log entry (line) size to 4096 characters to prevent
memory_limit/preformance issues when debug is enabled (imap, smtp, db)
2013-05-08 20:19:58 +02:00
Aleksander Machniak
ce89ecd542 Fix various PHP code bugs found using static analysis (#1489086) 2013-05-06 12:23:27 +02:00
Aleksander Machniak
8defd73ee0 Inlcude SQL query in the log on SQL error (#1489064) 2013-04-30 11:49:35 +02:00
Aleksander Machniak
399db1b647 Add db_prefix configuration option in place of db_table_*/db_sequence_* options
Make possible to use db_prefix for schema initialization in Installer (#1489067)
Fix updatedb.sh script so it recognizes also table prefix for external DDL files
2013-04-27 18:31:40 +02:00
Aleksander Machniak
282dff4f18 Add rcube_db::escape() method, fix escapeSimple() to use escape instead of quote() 2013-04-17 19:33:42 +02:00
Aleksander Machniak
c465ee1e06 Fix typo simpleEscape -> escapeSimple 2013-04-17 17:37:05 +02:00
Aleksander Machniak
39a034b50d Add rcube_db::escapeSimple() method for backward compat.
Conflicts:

	plugins/virtuser_query/virtuser_query.php
2013-04-17 17:14:00 +02:00
Thomas Bruederli
7889c57b77 Match regex on multi-line sql statements 2013-03-24 12:03:16 +01:00
Thomas Bruederli
a85d54e1e8 Hack to reset PDO statement iterators after counting 2013-03-23 17:57:58 +01:00
Thomas Bruederli
d4f8a4f28a Re-implement rcube_db::num_rows() to ensure backwards compatibility 2013-03-13 19:02:31 +01:00
Aleksander Machniak
ac37746c2a Add type 'ident' in quote() so we can quote identifiers (eg. column names) there.
Using array2list() for list of identifiers is now possible.
2013-03-06 08:37:41 +01:00
Aleksander Machniak
bc2c02feec When connection to read-only db fails try to connect to write-master, but only if it is defined 2013-02-17 10:52:45 +01:00
Aleksander Machniak
41db2bf47d Slightly improve database driver chack 2013-01-31 13:18:38 +01:00