Commit Graph

66 Commits (219e353ac1fff08e572bc108d96e06c58273a2d7)

Author SHA1 Message Date
Aleksander Machniak 60c8dd2e23 Fix regression where using an absolute path to SQLite database file on Windows didn't work (#7196) 5 years ago
Aleksander Machniak 1613f3ab4c
INSERT OR REPLACE implementation (#6771)
For now with support in postgres and mysql databases.
For now used in rcube_cache, rcube_imap_cache and enigma plugin
5 years ago
Aleksander Machniak 2f928a516d Fix DB Write test on SQLite database ("database is locked" error) (#7064)
Also fix so SQLite DSN with a relative path to the database file works in Installer
5 years ago
Aleksander Machniak 67898b23e4 Fix tables listing routine when DSN contained a database with unsupported suffix (#7034) 5 years ago
Aleksander Machniak a80d73602f Fix db_prefix handling in queries with `TRUNCATE TABLE <name>` and `UNIQUE <name>` (#7013) 5 years ago
Aleksander Machniak 1afa46d28d PHPDoc and CS fixes 5 years ago
Jack Cherng 198585d8a0 Fix implode() wrong parameter order (#6866)
It has been deprecated in PHP 7.4.

Such as PHP deprecated:  implode(): Passing glue string after array is deprecated. Swap the parameters in /var/www/roundcubemail/program/lib/Roundcube/rcube_db.php on line 917

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
5 years ago
Aleksander Machniak 57c67db029 Remove year(s) from copyright headers + some cleanup 6 years ago
laodc 672e57ea48 Patched bug where rcube_db::quote() was causing an infinite connection loop. (#6175)
As rcube_db::quote() checks to see if the connection is up before quoting, this would cause the class to try connect again, as rcube_db::$dbh was not being set until AFTER conn_configure was completed, causing a loop.

So updated rcube_db::$dbh in the rcube::conn_create() function instead allowing access to the new object straight away.

It's needed for edeb5d7.
7 years ago
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.
8 years ago
Aleksander Machniak 72f19c079f Installer: Fix DB schema initialization on MS SQL Server 8 years ago
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).
8 years ago
ka7 9a35768c26 spelling fixes (#5690) 8 years ago
Aleksander Machniak c1c0a0d815 Implemented rcube::sleep() method for disconnecting all external connection in long-running/sleeping scripts 8 years ago
Aleksander Machniak 184de7735c CS fixes (mostly phpdoc) 8 years ago
Aleksander Machniak c478536741 Make SQL selects less expensive in memory for some cases where we fetch big data chunks 9 years ago
Aleksander Machniak 7e3298753a Use ternary operator where aplicable 9 years ago
Aleksander Machniak 0ee57208b3 Add possibility to set PDO::ATTR_PREFETCH and PDO::ATTR_TIMEOUT via DSN string 9 years ago
Aleksander Machniak a958748947 CS fixes 10 years ago
Aleksander Machniak 48d01837a0 Fix tables listing routine on mysql and postgres so it skips system or other database tables and views (#1490337) 10 years ago
Aleksander Machniak 496972bf95 Fix backtick character handling in sql queries (#1490312) 10 years ago
Aleksander Machniak 8f485469c7 Add possibility to configure max_allowed_packet value for all database engines (#1490283) 10 years ago
Aleksander Machniak 7b924535fd CS fixes 10 years ago
Thomas Bruederli a63b9b546c Add plugin hook 'db_table_name' as requested in #1489837 10 years ago
Aleksander Machniak fb8adc8a19 Remove Oracle driver based on PDO_OCI extension 10 years ago
Aleksander Machniak 8451577659 Added transactions support 10 years ago
Aleksander Machniak d7c91c14f8 Add Oracle driver which uses OCI8 extension - the one that supports CLOB columns 10 years ago
Aleksander Machniak 34a0902089 Use consistent column/table quoting in sql queries 10 years ago
Aleksander Machniak 4baf96a4ca Added license headers to driver files, CS fixes 10 years ago
Aleksander Machniak 3ce4f0a839 Revert [78a58162], TABLE_SCHEMA column does not exist in mysql, also
tables in postgres can be in 'public' schema.
11 years ago
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
11 years ago
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>
11 years ago
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
11 years ago
Aleksander Machniak 899e594474 Key duplicate error on postgres uses SQLSTATE=23505 11 years ago
Thomas Bruederli 6a6992f650 Assign the chosen mode to the table map 11 years ago
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
11 years ago
Thomas Bruederli 92d18cf32e New option to disable the use of already established dsnw connections for subsequent reads 11 years ago
Thomas Bruederli 0ee22c2145 Retry queries on deadlock errors from InnoDB row-level locking (MySQL) 11 years ago
Aleksander Machniak 60b6d7c389 Fix database cache expunge issues (#1489149) - added 'expires' column 12 years ago
Aleksander Machniak d186405c00 Simplified db connection initialisation code 12 years ago
Aleksander Machniak 66407a75d1 Fix date format issues on MS SQL Server (#1488918) 12 years ago
Aleksander Machniak aa44ce6e97 Add optional argument to now() for simple interval calculations on SQL-side 12 years ago
Aleksander Machniak be4b5c2fe5 Fix "duplicate entry" errors on inserts to imap cache tables (#1489146) 12 years ago
Aleksander Machniak 5df4fe56d5 Fix backward copat. with cached values serialized but not base64-encoded (#1489142) 12 years ago
Aleksander Machniak a6b0ca60a4 Fix bug where serialized strings were truncated in PDO::quote() (#1489142) 12 years ago
Aleksander Machniak 43079d8e2d Simplify/fix debug lines truncation 12 years ago
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)
12 years ago
Aleksander Machniak ce89ecd542 Fix various PHP code bugs found using static analysis (#1489086) 12 years ago
Aleksander Machniak 8defd73ee0 Inlcude SQL query in the log on SQL error (#1489064) 12 years ago
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
12 years ago