matiu/SQL--Bibliosoph — Issue #1: SELECT in procedures
Author: wols
Created: 2012-02-13 21:23:03+00:00
State: open

#-----8<-----8<-----
--[ create_procedure_ploginfo ]

CREATE PROCEDURE `PLogInfo` (
in_message VARCHAR(1024),
in_keyvalue VARCHAR(32)
)

MAIN_BLOCK:BEGIN

DECLARE loc_threshold INT DEFAULT 0;
SELECT `threshold`
FROM `TLogLevel`
WHERE `keyvalue` = in_keyvalue
INTO loc_threshold;
CALL PLogLvl(in_message,in_keyvalue,4,loc_threshold);

END MAIN_BLOCK

--[]
#-----8<-----8<-----

...with SELECT statement in MAIN_BLOCK:
#-----8<-----8<-----
Constructing Bibliosoph
Prepared 1 Statements
Created methods for [1] queries
many create_procedure_ploginfo
DBD::mysql::st fetchall_arrayref failed: fetch() without execute() at
/usr/lib/perl5/vendor_perl/5.14.2/SQL/Bibliosoph/Query.pm line 64.
DBD::mysql::st fetchall_arrayref failed: fetch() without execute() at
/usr/lib/perl5/vendor_perl/5.14.2/SQL/Bibliosoph/Query.pm line 64.
#-----8<-----8<-----

...without SELECT statement in MAIN_BLOCK:
#-----8<-----8<-----
Constructing Bibliosoph
Prepared 1 Statements
Created methods for [1] queries
oth create_procedure_ploginfo
#-----8<-----8<-----

Here differs 'many' and 'oth'.
'create_procedure_ploginfo' should not be a '^SELECT ' statement for
your 'create_method_for' in Bibliosoph.pm.

Is here not a type 'CREATE' in 'create_methods_from' missing? All behind
'CREATE (FUNCTION|PROCEDURE)' could be mask for execute.