Log message #4186820

# At Username Text
# May 17th 2019, 17:39 admad it would be possible if in one case the time calculation is done in PHP but not for what you describe
# May 17th 2019, 17:38 admad @a.francazi how does it give you different when both run on same mysql instance?
# May 17th 2019, 17:38 niel45 oh,m and is it the same MySQL server also
# May 17th 2019, 17:36 niel45 i.e. both going through cake?
# May 17th 2019, 17:36 niel45 @a.francazai, is that using the same connection method?
# May 17th 2019, 17:28 a.francazi I'm UTC +02:00 btw
# May 17th 2019, 17:27 a.francazi i have a problem with timezone. if i do `SELECT now() - INTERVAL 1 DAY` on my mysql server it correctly gives me `2019-05-16 19:22:05`. But if I do `$query->newExpr('now() - INTERVAL 1 DAY')` in cakephp it somehow gets `2019-05-16 17:22:05` which is 2 hours off. why's that and where can i change it so it behaves correctly?
# May 17th 2019, 16:05 neothermic @jeremyharris It doesn't need to do a full table scan if you can give it an index to filter down from at first
# May 17th 2019, 16:04 dereuromark omg.. @admad I am surprised how easy it was to apply something similar to read() here. But one key difference: It is cleaner if the path is an array here right away: https://github.com/dereuromark/cakephp-dto/pull/22
# May 17th 2019, 16:02 neothermic ok, so I've concluded that for anything other than simple singular value extracts, Set::extract and Hash::extract are not 100% compatible with each other
# May 17th 2019, 15:23 jeremyharris I suppose the query explainer would give me the hard truth
# May 17th 2019, 15:23 admad i wonder what use case requires exact name matches like the query showed above yields
# May 17th 2019, 15:21 jeremyharris fair enough :P
# May 17th 2019, 15:21 admad only if the concatenation is more efficient than one LIKE
# May 17th 2019, 15:20 jeremyharris side question: from a performance standpoint, would one LIKE be more efficient than 2? I wouldn’t think so since it has to do a full table scan anyway
# May 17th 2019, 15:20 martin ```$user = $this->Users->find()->where(function ($exp, $query) use ($line) { $conc = $query->func()->concat([ 'firstname' => 'identifier', ' ', 'lastname' => 'identifier' ]); return $exp->eq($conc, $line); })->first();```
# May 17th 2019, 15:19 jeremyharris I guess if you’re he’s looking for an exact match, I just assumed fuzzy
# May 17th 2019, 15:18 admad why bother concating? `WHERE first_name like ‘%jeremy%’ OR last_name like ‘%jeremy%’` would yield the same matches
# May 17th 2019, 15:16 jeremyharris so something like WHERE CONCAT(first_name. ' ‘, last_name) like ‘%jeremy%’
# May 17th 2019, 15:16 martin found it
# May 17th 2019, 15:16 martin oh, yes just started thinking about googleing on concat instead combine :P
# May 17th 2019, 15:15 jeremyharris concat
# May 17th 2019, 15:15 martin I’ve users with a firstname and lastname field in database. now I need to search on full name? what is best way to do this? need to combine 2 fields (with space between). I know how to do this in mysql but how do I do it the right way in cake query?
# May 17th 2019, 15:09 admad i don't but that does look useful
# May 17th 2019, 15:04 dereuromark Is someone using DTOs yet as well? Does read() make sense similar to cake core? https://github.com/dereuromark/cakephp-dto/issues/21
# May 17th 2019, 14:33 voycey had the benefit of slimming down our code somewhat
# May 17th 2019, 14:33 voycey we re-wrote to be honest - it was a killer trying to migrate
# May 17th 2019, 14:06 neothermic we did cake 1 to cake 2 a few years back, and now the cake2 is even larger than before...
# May 17th 2019, 14:06 nils Haha, I don't envy you!
# May 17th 2019, 14:06 neothermic Welcome to my hell, except this codebase started late 2010 on cake1 :)
# May 17th 2019, 14:05 nils I guess. I'm the only developer in it. The project started 2013 so I get quite frustrated with the 2013-version of me. :slightly_smiling_face:
# May 17th 2019, 14:02 neothermic how large the codebase is, how many developers you have, how many cake2-isims you've got, how recent your cake2 install is, how much you rely on removed functionality, etc
# May 17th 2019, 14:01 neothermic I suspect the time it takes varies on multiple factors
# May 17th 2019, 14:01 neothermic I'm slowly doing that now
# May 17th 2019, 14:01 nils Did anyone migrate from 2.x to 3.x? How time consuming should I expect it to be?
# May 17th 2019, 14:00 neothermic but yeah, any thoughts on why this isn't behaving the same?
# May 17th 2019, 13:57 neothermic :)
# May 17th 2019, 13:57 dereuromark I know I am
# May 17th 2019, 13:56 dereuromark you know, there are things in life where you want to be replaced by machines
# May 17th 2019, 13:56 neothermic but this one is odd, as I'm not sure why I'm losing the subkey; is that expected?
# May 17th 2019, 13:56 neothermic well, the basic testcase is me running the change manually, comparing the outputs :)