Bug #10108 Server crashes using Select from view with sec_to_time function
Submitted: 23 Apr 2005 3:10 Modified: 23 Apr 2005 3:24
Reporter: Jochen Wartenberg Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.3-beta-standard OS:Linux (SuSE Linux 9.2)
Assigned to: CPU Architecture:Any

[23 Apr 2005 3:10] Jochen Wartenberg
Description:
Using sec_to_time function in a view lets the server crash when using this view.
If sec_to_time is not used data can be selected from view.

Error message from server:
mysql@linux-jochen:~> mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=3
max_connections=100
threads_connected=2
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 32384 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0x89eea08
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0xbfe3ecd8, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x809ac27
0x8342518
0x8083933
0x8051411
0x80957b0
0x80911ae
0x80e4eaa
0x80d80a6
0x80d8b66
0x80d525f
0x80abf29
0x80b1b19
0x80aa624
0x80a9f70
0x80a9514
0x833fccc
0x836961a
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x89fa370 = select * from test06
thd->thread_id=2
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.

How to repeat:
"create view test06 as
select year(datum), month(datum), sec_to_time(sum((exe_time))), exe_time
FROM `po_jogging`
group by year(datum), month(datum)"

datum is type date, exe_time is type time.
[23 Apr 2005 3:24] Jorge del Conde
I was unable to reproduce this bug w/5.0.5 from bk:

mysql> create table po_jogging(datum date, exe_time time);
Query OK, 0 rows affected (0.00 sec)

mysql> create view test06 as select year(datum), month(datum), sec_to_time(sum((exe_time))), exe_time
    -> FROM `po_jogging`
    -> group by year(datum), month(datum);
Query OK, 0 rows affected (0.01 sec)

mysql> select * from test06;
Empty set (0.00 sec)

mysql> insert into po_jogging values(now(), now());
Query OK, 1 row affected (0.01 sec)

mysql> select * from test06;
+-------------+--------------+------------------------------+----------+
| year(datum) | month(datum) | sec_to_time(sum((exe_time))) | exe_time |
+-------------+--------------+------------------------------+----------+
|        2005 |            4 | 62:33:58                     | 22:52:38 |
+-------------+--------------+------------------------------+----------+
1 row in set (0.00 sec)

mysql>
[23 Apr 2005 6:04] Jochen Wartenberg
I just have installed 5.0.4.
The bug does no longer appear.

Thanks
Jochen