use correct type when fetching appconfig #25226

Closed
butonic opened this Issue Jun 22, 2016 · 11 comments

Projects

None yet

4 participants

@butonic
Member
butonic commented Jun 22, 2016

OC 8.2.5

mysql> SELECT `configkey`, `configvalue` FROM `oc_appconfig` WHERE (`appid` = 'files_sharing') AND (`configkey` IN (70311, 231042, 312174));
Empty set, 3 warnings (6.15 sec)
mysql> SELECT `configkey`, `configvalue` FROM `oc_appconfig` WHERE (`appid` = 'files_sharing') AND (`configkey` IN  ('70311', '231042', '312174'));
Empty set (0.01 sec)
mysql> select count( * ) from oc_appconfig where (`appid` = 'files_sharing');
+------------+
| count( * ) |
+------------+
|      14619 |
+------------+
1 row in set (0.01 sec)

cc @DeepDiver1975 @PVince81 I'm on it.

@butonic
Member
butonic commented Jun 22, 2016 edited

Note the time difference ... 6 sec vs 0.01 sec

@butonic
Member
butonic commented Jun 22, 2016

testing a patch with the customer.

@butonic butonic added the bug label Jun 22, 2016
@butonic
Member
butonic commented Jun 22, 2016

it kills mysql => bug

@butonic butonic added the db:mysql label Jun 22, 2016
@butonic
Member
butonic commented Jun 22, 2016

please add this to 8.2.6

@butonic butonic added the blue-ticket label Jun 22, 2016
@PVince81
Collaborator

I heard "kill" ? Setting to critical.

@butonic I get you'll take care of it ?

@butonic butonic was assigned by PVince81 Jun 22, 2016
@butonic
Member
butonic commented Jun 22, 2016

@icewind1991 I understand you are using postgres. Can you verify the current code works at all? Because postgres seems to fail on type conversions:

owncloud=> SELECT configkey, configvalue FROM oc_appconfig WHERE appid = 'files_sharing';
              configkey               |   configvalue   
--------------------------------------+-----------------
 types                                | filesystem
 enabled                              | yes
 installed_version                    | 0.7.0
 incoming_server2server_share_enabled | yes
 outgoing_server2server_share_enabled | yes
 6                                    | 1453129146.8909
 49                                   | 1458564251.4985
 51                                   | 1461330861.6461
(8 Zeilen)

owncloud=> SELECT configkey, configvalue FROM oc_appconfig WHERE appid = 'files_sharing' and configkey IN (6, 49, 51);
FEHLER:  Operator existiert nicht: character varying = integer
ZEILE 1: ...onfig WHERE appid = 'files_sharing' and configkey IN (6, 49,...
                                                              ^
TIP:  Kein Operator stimmt mit dem angegebenen Namen und den Argumenttypen überein. Sie müssen möglicherweise ausdrückliche Typumwandlungen hinzufügen.
owncloud=> SELECT configkey, configvalue FROM oc_appconfig WHERE appid = 'files_sharing' and configkey IN ('6', '49', '51');
 configkey |   configvalue   
-----------+-----------------
 6         | 1453129146.8909
 49        | 1458564251.4985
 51        | 1461330861.6461
(3 Zeilen)

owncloud=> select count( * ) from oc_appconfig where ('appid' = 'files_sharing');
 count 
-------
     0
(1 Zeile)
@icewind1991
Member

This should have been covered by tests :/

@butonic
Member
butonic commented Jun 24, 2016

well you only see a warning in sql ... it works it just happens to have a dramatic effect in this instance. we have bigger instances that are less affected because of bigger hardware ... hard to test

@PVince81
Collaborator

We merged #25227 already, can we close the ticket or is there anything else to be done ?

@butonic
Member
butonic commented Jun 27, 2016

No forward port needed. 9.0 and 9.1 use a different mechanism to propagate changes.

@butonic butonic closed this Jun 27, 2016
@butonic
Member
butonic commented Jun 27, 2016

thx guys!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment