| Bug #9429 | When I select view use function , server crashed | ||
|---|---|---|---|
| Submitted: | 28 Mar 2005 7:28 | Modified: | 28 Mar 2005 15:39 |
| Reporter: | yan chang | Email Updates: | |
| Status: | Can't repeat | Impact on me: | |
| Category: | MySQL Server | Severity: | S2 (Serious) |
| Version: | 5.0.3-beta | OS: | Windows (windows 2000 server) |
| Assigned to: | CPU Architecture: | Any | |
[28 Mar 2005 15:39]
Jorge del Conde
mysql> create table myview (mydate datetime, b varchar(20));
-> //
Query OK, 0 rows affected (0.00 sec)
mysql> insert into myview values (now(), 'hola')//
Query OK, 1 row affected (0.00 sec)
mysql> select * from myview where mydate>=to_date('2005-02-02','test')//
+---------------------+------+
| mydate | b |
+---------------------+------+
| 2005-03-28 11:03:33 | hola |
+---------------------+------+
1 row in set (0.00 sec)

Description: When I select view use function , server crashed I hava function,like this CREATE FUNCTION `to_date`(s VARCHAR(200), f VARCHAR(200)) RETURNS varchar(10) NOT DETERMINISTIC SQL SECURITY DEFINER COMMENT '' BEGIN RETURN s; END // I test it mysql> select to_date('2005-03-02','yyyyyyyyyy'); +------------------------------------+ | to_date('2005-03-02','yyyyyyyyyy') | +------------------------------------+ | 2005-03-02 | +------------------------------------+ 1 row in set (0.00 sec) but when I do it select * from myview where mydate>=to_date('2005-02-02','test') when I close connection,server is crashed! mydate is datetime field. How to repeat: 1 you can create funtion like this CREATE FUNCTION `to_date`(s VARCHAR(200), f VARCHAR(200)) RETURNS varchar(10) NOT DETERMINISTIC SQL SECURITY DEFINER COMMENT '' BEGIN RETURN s; END 2 you create view from table have a datetime field 3 you do select select * from myview where mydate>=to_date('2005-02-02','test')