
Question about the notification about inactivity for Micha (Technics)
Hello
I have a next question about the behaviour of the selection of inactive accounts.
The query to select the affected accounts (functions.inc.php, currently line 195) is this one:
SELECT `user_id`, `user_name`, `user_email` FROM `mlf2_userdata` WHERE `user_lock` = 0 AND `user_type` = 0 AND `inactivity_notification` = FALSE AND (`last_login` - (NOW() - INTERVAL 3 YEAR)) < 0 ORDER BY `last_login` ASC LIMIT 20;
Especially I am interested in AND (`last_login` - (NOW() - INTERVAL 3 YEAR)) < 0
. I tested the query part in phpMyAdmin with these two versions. First one with a test_date
, that is definitely older than 3 years and the second one with a test_date
that is only two years ago.
SELECT '2017-12-30 12:45:40' AS test_date, (NOW() - INTERVAL 3 YEAR) AS old_date, ('2017-12-30 12:45:40' - (NOW() - INTERVAL 3 YEAR)) AS subtraktion SELECT '2020-12-30 12:45:40' AS test_date, (NOW() - INTERVAL 3 YEAR) AS old_date, ('2020-12-30 12:45:40' - (NOW() - INTERVAL 3 YEAR)) AS subtraktion
These are the results.
2020-12-30 12:45:40 2019-05-12 20:12:31 -20190512199211
2017-12-30 12:45:40 2019-05-12 20:20:15 -20190512199998
In both cases I get a warning.
Warning: #1292 Falscher DOUBLE-Wert gekürzt: '2017-12-30 12:45:40'
/* free translation: shortened wrong DOUBLE value: */
I think, the logic of the condition is broken. The condition AND (`last_login` - (NOW() - INTERVAL 3 YEAR)) < 0
returns a negative value (< 0) (and is therefore TRUE
) in every single case. But that's a task for tomorrow.
Tschö, Auge
--
Trenne niemals Müll, denn er hat nur eine Silbe!
Complete thread:
- Question about the notification about inactivity for Micha -
Auge,
2022-05-09, 21:15
- Not receiving password reset emails -
bers,
2022-05-10, 05:28
- Not receiving password reset emails -
Micha,
2022-05-10, 06:29
- Not receiving password reset emails -
bers,
2022-05-10, 11:04
- Not receiving password reset emails -
Micha,
2022-05-10, 13:48
- Not receiving password reset emails -
bers,
2022-05-11, 04:39
- Not receiving password reset emails -
Auge,
2022-05-11, 06:26
- Not receiving password reset emails - bers, 2022-05-11, 07:36
- Not receiving password reset emails -
Micha,
2022-05-11, 07:28
- Not receiving password reset emails -
bers,
2022-05-11, 07:40
- Not receiving password reset emails -
Micha,
2022-05-11, 08:14
- Not receiving password reset emails -
bers,
2022-05-13, 08:45
- Not receiving password reset emails - bers, 2022-05-13, 08:55
- Not receiving password reset emails -
bers,
2022-05-13, 08:45
- Not receiving password reset emails -
Micha,
2022-05-11, 08:14
- Not receiving password reset emails -
bers,
2022-05-11, 07:40
- Not receiving password reset emails -
Auge,
2022-05-11, 06:26
- Not receiving password reset emails -
bers,
2022-05-11, 04:39
- Not receiving password reset emails -
Micha,
2022-05-10, 13:48
- Not receiving password reset emails -
bers,
2022-05-10, 11:04
- Not receiving password reset emails -
Micha,
2022-05-10, 06:29
- Question about the notification about inactivity for Micha - Micha, 2022-05-10, 06:28
- Answering the question about the inactivity notification -
Auge,
2022-05-12, 18:07
- Answering the question about the inactivity notification -
Micha,
2022-05-12, 19:07
- Answering the question about the inactivity notification -
Auge,
2022-05-13, 12:12
- Answering the question about the inactivity notification - Micha, 2022-05-13, 12:29
- Answering the question about the inactivity notification -
Auge,
2022-05-13, 12:12
- Answering the question about the inactivity notification -
Micha,
2022-05-12, 19:07
- Question about the notification about inactivity for Micha -
Auge,
2022-05-12, 18:25
- Question about the notification about inactivity for Micha -
Micha,
2022-05-12, 19:28
- Question about the notification about inactivity for Micha -
Auge,
2022-05-13, 08:02
- Question about the notification about inactivity for Micha -
Micha,
2022-05-13, 08:08
- Question about the notification about inactivity for Micha - Auge, 2022-05-13, 11:46
- Question about the notification about inactivity for Micha -
Micha,
2022-05-13, 08:08
- Question about the notification about inactivity for Micha -
Auge,
2022-05-13, 08:02
- Question about the notification about inactivity for Micha -
Micha,
2022-05-12, 19:28
- Not receiving password reset emails -
bers,
2022-05-10, 05:28