Commit Graph

63 Commits

Author SHA1 Message Date
Michal Čihař
2dce033943 Move configuration management in DBI to separate method
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 11:57:51 +02:00
Michal Čihař
25a38b2067 Determine correct user/password for connect in DatabaseInterface
The API only specifies what kind of link we want and we will get it.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 11:51:09 +02:00
Michal Čihař
f30f65c67a Indentify connection type by one flag
Use integer values rather than set of boolean flags. This makes it
easier to make decision and makes the code more readable. Also removes
confusion what should happen in case both boolean flags are set.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 11:36:07 +02:00
Michal Čihař
f46fd34081 Remove is_controluser flag from DBI backends
They no longer need it (it was used only for empty password fallback).

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 11:34:55 +02:00
Michal Čihař
bee2805b34 Remove auxiliary_connection flag from DBI backends
They do not use it anyway.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-29 11:23:29 +02:00
Michal Čihař
bb18c5e02f Merge branch 'QA_4_6' 2016-07-28 11:06:43 +02:00
Pavel Rochnyack
c310304712 Restore Overhead column in Server > Databases > Enable Statistics.
(Was removed in 582b02262b)

Signed-off-by: Pavel Rochnyack <pavel2000@ngs.ru>
2016-07-27 19:56:43 +01:00
Michal Čihař
3847cee0a4 Merge branch 'QA_4_6' 2016-06-17 11:20:05 +02:00
Michal Čihař
f5e8953356 Share backtrace processing for debugging and error reporting
We want to achieve same thing in both cases - backtrace which is
stripped from sensitive information, has reasonable size and can be
read. Sharing the code will make it easier to fix possible problems and
also will make both cases behave consistent.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-17 11:18:39 +02:00
Isaac Bennetch
e6db8e18ee Fix some CodeSniffer warnings and errors
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2016-06-12 23:12:23 -04:00
Michal Čihař
f3925a8b7c Merge branch 'QA_4_6' 2016-06-03 15:22:29 +02:00
Michal Čihař
2ae8b9248e Simplify server port handling
The intval function does return 0 for empty string, so we really do not
have to special case here.

Issue #12279

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-06-03 15:21:48 +02:00
Michal Čihař
aaa707ab4d Merge branch 'QA_4_6' 2016-05-17 10:18:52 +02:00
Michal Čihař
11089cbe41 Use https for links to dev.mysql.com
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-17 10:16:44 +02:00
Michal Čihař
cc9550579c Merge branch 'QA_4_6' 2016-05-11 15:14:57 +02:00
Michal Čihař
6b8f56dffd Imporove simplification of backtrace for console
Replace only objects, include regular items verbatim.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-11 15:14:12 +02:00
Michal Čihař
d57d4e6e5a Do not include call to _dbgQuery in backtrace
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-11 15:11:37 +02:00
Michal Čihař
e52cf14ae7 Merge branch 'QA_4_6' 2016-05-11 15:03:25 +02:00
Michal Čihař
d67facb641 Avoid storing objects in session when debugging SQL
When $cfg['DBG']['sql'] is enabled, we used to store full backtrace in
session. This includes DBI objects which then can cause problems on
session start.

Issue #12229

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-05-11 15:03:15 +02:00
Michal Čihař
56e59c19f4 Add option to log executed SQL queries to syslog
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-29 11:20:55 +02:00
Michal Čihař
57dce34085 Merge branch 'QA_4_6' 2016-04-18 16:30:01 +02:00
Michal Čihař
cfbc31bfa6 Better reporting of connection errors
We really do not care about traceback or parameters in this case, all we
need is to display the message coming from PHP.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-18 13:32:52 +02:00
Michal Čihař
fd7d036cde Merge pull request #12170 from nijel/remove-cache
Remove undocumented caching for table status
2016-04-18 12:15:42 +02:00
Michal Čihař
3e2029e750 Move MySQL charsets handling to the Charsets class
Issue #11731

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-11 12:55:42 +02:00
Michal Čihař
e2deac4b22 Move getting collation to the DBI layer
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-11 11:42:29 +02:00
Michal Čihař
1fe277e988 Use $this instead of accessing DBI from globals
We're already in the object scope, there is no need to go to globals for
self.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-11 11:19:33 +02:00
Michal Čihař
a5ac300264 Remove undocumented caching for table status
This feature is not documented, not in the default config, so probably
not used at all.

This was introduced in revert commit
19432a02cc, so I believe it was not
intentional.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-07 09:31:51 +02:00
Michal Čihař
f9ef2eb37e Improve performance with SkipLockedTables
We now fetch all table status in one query, so this has pretty much same
speed as SkipLockedTables disabled.

Issue #12129

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-07 09:25:53 +02:00
Michal Čihař
e875d4b50b Adjust tracking test to new code
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-06 11:58:20 +02:00
Michal Čihař
f42674aa0f Better document why these aliases are needed
It's no longer for MySQL forward compatibility, but rather for
possibility to switch between SHOW TABLES and INFORMATION_SCHEMA using
DisableIS directive.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-06 11:05:31 +02:00
Michal Čihař
635f83a634 Remove unused method
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-06 11:04:25 +02:00
Michal Čihař
6c712a3c15 Revert "Remove compatibility code with MySQL < 5.0"
This is still needed

Fixes #12161

This reverts commit edd264c91f.
2016-04-06 10:55:38 +02:00
Michal Čihař
c136a74705 Cache current user information for DBI lifetime
We query this information quite often, so it makes sense to fetch it
only once from the MySQL server.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-04-06 09:45:53 +02:00
Michal Čihař
5bd9fc4e40 Check if DBG is set and store the result
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-03-08 14:23:25 +01:00
Michal Čihař
1b9ea10f11 Move logging helpers to class
Issue #11731

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-03-08 11:14:28 +01:00
Durgesh
0b64827930 Refactored url parmeters generating, Issue #11990
Signed-off-by: Durgesh <007durgesh219@gmail.com>
2016-02-22 14:36:41 +05:30
Michal Čihař
edd264c91f Remove compatibility code with MySQL < 5.0
It doesn't seem to be needed now.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-02-12 17:20:44 +01:00
Michal Čihař
94dccc6a00 Remove MySQL version caching
In my testing the session/cache access is slower than fetching single
value from MySQL and calculating the values.

Also the caching would need some logic for invalidation as the server
can be upgraded or configuration changed.

Fixes #11924

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-02-08 10:59:38 +01:00
Michal Čihař
c2c85cd15c Fix class names
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-01-28 17:15:47 +01:00
Michal Čihař
ed96969ff9 Merge branch 'QA_4_5' 2016-01-28 09:23:27 +01:00
Michal Čihař
cbca7ca202 Show MySQL error messages in user language
Fixes #11789

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-01-13 08:49:02 +01:00
Marc Delisle
9df4afb256 This one needed a lettered operator
Signed-off-by: Marc Delisle <marc@infomarc.info>
2016-01-05 17:23:41 -05:00
Marc Delisle
68f8adfd84 No letters for logical operators
https://github.com/dseguy/clearPHP/blob/master/rules/no-letter-logical.md

Signed-off-by: Marc Delisle <marc@infomarc.info>
2016-01-05 17:17:43 -05:00
Michal Čihař
a74efb0c30 Simplify getting first element of an array
Calling current() after reset() is duplicate as reset() already returns
current index value.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-01-05 12:37:50 +01:00
Michal Čihař
e1c9dec998 Merge commit '912f96114dc803404e2854ebb5796757a4eeedb6' 2016-01-05 08:21:32 +01:00
Michal Čihař
55b317c699 Remove /*overload*/ prefix from mb_* calls
I believe this was temporary flagging to see which code is migrated and
can be safely removed now.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-01-04 16:35:28 +01:00
Marc Delisle
911f8274c7 Clarify class and variable name
Signed-off-by: Marc Delisle <marc@infomarc.info>
2015-12-31 08:09:47 -05:00
Michal Čihař
58ba4b83b8 Merge branch 'QA_4_5' 2015-12-28 11:51:20 +01:00
Marc Delisle
d9bec7f085 HTML line break shown after a MySQL connection error message
Signed-off-by: Marc Delisle <marc@infomarc.info>
2015-12-07 09:02:07 -05:00
Michal Čihař
0d15a96427 Merge branch 'QA_4_5' 2015-12-04 12:14:41 +01:00