Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MaxDB - Everything about MaxDB, formerly known as SAP DB
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
MySQL++ - Programming with the C++ API to MySQL
ODBC - ODBC with the MySQL Connector/ODBC driver
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
mysql:it 's a db not a dbms how it 's possible?!
Does the binary log enabling affect the MySQL performances?
Strange behavior, Table Level Permission
FULLTEXT query format question
Preventing Duplicate Entries
Comparing and writing out BLOBS
Executing MySQL Commands From Within C Program
Can 't access mysql after kernel upgrade
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Downgrade Mysql from 4 to 3 23
MySQL Cluster Software
mysql test 4 1 fails with the gis test
ERROR 2002: Can 't connect to local MySQL server through socket
Getting Identity after INSERT
Update one field with more fields from another table
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
mysql have same function mthod as Oracle decode()
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Windows 2000/XP 2013 user defined function crash.

Windows 2000/XP 2013 user defined function crash.

2005-05-27       - By Timmermans, Eugene

 Back
Reply:     1     2  

My simple function works when one row is selected but crashes when more
selected.



SELECT TEST1(CMT, 'A') FROM PROD.IPR limit 1



TEST1(CMT, 'A')



testvalue      



1 row in set (0.00 sec)



SELECT TEST1(CMT, 'A') FROM PROD.IPR limit 2

//

ERROR 2013 (HY000): Lost connection to MySQL server during query



C:\PROGRA~1\MYSQL\MYSQLS~1.0>mysqld --defaults-file=my.ini --console

050527 11:21:00  InnoDB: Database was not shut down normally!

InnoDB: Starting crash recovery.

InnoDB: Reading tablespace information from the .ibd files...

InnoDB: Restoring possible half-written data pages from the doublewrite

InnoDB: buffer...

050527 11:21:00  InnoDB: Starting log scan based on checkpoint at

InnoDB: log sequence number 0 773267422.

InnoDB: Doing recovery: scanned up to log sequence number 0 773267432

InnoDB: Last MySQL binlog file position 0 0, file name

050527 11:21:00  InnoDB: Started; log sequence number 0 773267432

050527 11:21:00  InnoDB: Starting recovery for XA transactions...

050527 11:21:00  InnoDB: 0 transactions in prepared state after recovery

050527 11:21:00 [Note] MYSQLD: ready for connections.

Version: '5.0.4-beta'  socket: ''  port: 3306  Official MySQL binary



DROP DATABASE IF EXISTS PROD;

//

CREATE DATABASE PROD CHARACTER SET latin1 COLLATE latin1_swedish_ci;

//

DROP TABLE PROD.IPR

//

CREATE TABLE PROD.IPR (

 acid INTEGER(8) NOT NULL,

 iprtype VARCHAR(10) NOT NULL,

 iprid VARCHAR(40) NULL,

 iprno INTEGER(9) NULL,

 iprcrop VARCHAR(60) NULL,

 iprname VARCHAR(240) NULL,

 issued DATETIME NULL,

 expired DATETIME NULL,

 cno INTEGER(8) NULL,

 citno INTEGER(8) NULL,

 cmt VARCHAR(240) NULL,

 site VARCHAR(8) NULL,

 userid CHAR(10) NULL,

 created DATETIME NULL,

 modified DATETIME NULL,

 INDEX ndx_fk_ipr_acit (citno),

 INDEX ndx_fk_ipr_coop (cno),

 INDEX ndx_fk_ipr_site (site(8)),

 INDEX oth_ipr_crop (iprcrop(60)),

 INDEX oth_ipr_iprid (iprid(40)),

 INDEX oth_ipr_iprno (iprno),

 INDEX pk_ipr (acid,iprtype(10),created),

 UNIQUE INDEX uniq_ipr (acid,iprtype(10),iprid(40))

)

ENGINE = INNODB;

//

USE PROD

//

insert into PROD.IPR ( CREATED, MODIFIED, ACID, IPRTYPE, IPRID, IPRNO,
IPRCROP, IPRNAME, ISSUED, EXPIRED, CNO, CITNO, CMT, SITE, USERID) VALUES


( '2003-11-05 15:31:46',NULL,123709,'CSR','ETII',NULL,'BARLEY','Eugene
Test IPR ID','2003-11-02 00:00:00','2003-11-04
00:00:00',2175903,14739,NULL,'DBMU','DBMUET    '),

( '2002-07-02 00:00:00','2002-09-13
00:00:00',17226,'CSR','GP-294',294,'wheat',NULL,'1989-05-01
00:00:00',NULL,2072497,14181,NULL,'PGRC','DBMUET    '),

( '2000-12-11 00:00:00','2002-09-13
00:00:00',37223,'CSR','CV-330',330,'OAT',NULL,'1991-07-01
00:00:00','1995-12-30 00:00:00',NULL,87,NULL,'PGRC','DBMUET    '),

( '2000-11-22 00:00:00','2002-09-13
00:00:00',35861,'CSR','CV-576',576,'wheat',NULL,'1976-09-01
00:00:00','1982-12-30 00:00:00',NULL,78,NULL,'PGRC','DBMUET    '),

( '2000-11-20 00:00:00','2002-09-13
00:00:00',35640,'CSR','CV-155',155,'OAT',NULL,'1958-11-01
00:00:00','1965-12-30 00:00:00',NULL,69,NULL,'PGRC','DBMUET    '),

( '2000-11-20 00:00:00','2002-09-13
00:00:00',35639,'CSR','CV-224',224,'OAT',NULL,'1969-05-01
00:00:00','1975-12-30 00:00:00',NULL,66,NULL,'PGRC','DBMUET    '),

( '2000-11-20 00:00:00','2002-09-13
00:00:00',35637,'CSR','CV-56',56,'OAT',NULL,'1926-10-10
00:00:00','1930-12-30 00:00:00',NULL,64,NULL,'PGRC','DBMUET    ');

//

drop function PROD.test1

//

create FUNCTION PROD.test1( indate VARCHAR(240),  informat VARCHAR(240))
RETURNS VARCHAR(240)

BEGIN

declare return_value VARCHAR(240);

   set return_value := 'testvalue';

   return return_value;

END;

//

SELECT TEST1(CMT, 'A') FROM PROD.IPR limit 1

//

+-- ---- ---- ----+

| TEST1(CMT, 'A') |

+-- ---- ---- ----+

| testvalue       |

+-- ---- ---- ----+

1 row in set (0.00 sec)



SELECT TEST1(CMT, 'A') FROM PROD.IPR limit 2

//

ERROR 2013 (HY000): Lost connection to MySQL server during query








Earn $52 per hosting referral at Lunarpages.