New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alter function result type and run query can cause server to crash (utf8 only) [CORE5849] #6110
Comments
Commented by: @asfernandes Cannot reproduce the crash in Linux. |
Commented by: @livius2 Create database with UTF8 charset and 16K page |
Commented by: @livius2 If this matter i use flamerobin for this (maybe transaction setting matter) WI-V3.0.4.32989 Firebird 3.0 |
Modified by: @livius2summary: Alter function result type and run query can cause server to crash => Alter function result type and run query can cause server to crash (utf8 only) |
Commented by: @asfernandes Cannot reproduce with ISQL wit no-autocommit in latest v3 branch: asfernandes@cheetah:~/fb/dev/firebird-3.0.git$ isql asfernandes@cheetah:~/fb/dev/firebird-3.0.git$ isql -n -term ! z.fdb FUN1 FUN2 FUN1 FUN2 |
Commented by: @livius2 Hi Adriano, Did you manage to reproduce the problem? |
Commented by: @livius2 problem still exists in |
Modified by: @livius2Version: 3.0.5 [ 10885 ] environment: WI-V3.0.4.32954 Firebird 3.0 => WI-V3.0.4.32954 Firebird 3.0 |
Commented by: @livius2 shorter testcase tested under Firebird4 from isql under Windows 7 S:\GITHUB\firebirdLivius2\temp\x64\debug\firebird>isql FUN1 FUN2 FUN1Statement failed, SQLSTATE = 08006 |
Modified by: @livius2description: SET TERM ^ ; RETURN VAR_RESULT; SET TERM ^ ; ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ SET TERM ^ ; RETURN VAR_RESULT; ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ error reading data from the connection... FIREBIRDDEV Wed Jun 20 09:52:34 2018 => SET TERM ^ ; RETURN VAR_RESULT; SET TERM ^ ; ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ SET TERM ^ ; VAR_RESULT = '1020208000062518034721312321'; RETURN VAR_RESULT; |
Commented by: @livius2 I found an error cause. But i do not know how to get dependencies inside CreateAlterFunctionNode::execute? When i just added a clean whole cache by MET_clear_cache(tdbb); |
Submitted by: @livius2
SET TERM ^ ;
CREATE FUNCTION FUN2(A CHAR(8), B CHAR(4), C CHAR(12)) RETURNS CHAR(2)
AS
DECLARE VARIABLE VAR_RESULT VARCHAR(50);
BEGIN
VAR_RESULT = A || B || C;
IF (char_length(VAR_RESULT)=20) then
VAR_RESULT = '21312321';
RETURN VAR_RESULT;
END^
SET TERM ; ^
SET TERM ^ ;
CREATE FUNCTION FUN1(A CHAR(8), B CHAR(4), C CHAR(12)) RETURNS CHAR(26)
AS
BEGIN
RETURN FUN2(A, B, C) || A;
END^
SET TERM ; ^
------------------------------------------------------------------------------------------
run the query:
SELECT FUN1('1020', '2080', '000625180347'), FUN2('1020', '2080', '000625180347') FROM RDB$DATABASE
commit;
------------------------------------------------------------------------------------------
alter result type
SET TERM ^ ;
ALTER FUNCTION FUN2(A CHAR(8), B CHAR(4), C CHAR(12)) RETURNS CHAR(50)
AS
DECLARE VARIABLE VAR_RESULT VARCHAR(50);
BEGIN
VAR_RESULT = '1020208000062518034721312321';
RETURN VAR_RESULT;
END^
SET TERM ; ^
commit;
------------------------------------------------------------------------------------------
run the query:
SELECT FUN1('1020', '2080', '000625180347') FROM RDB$DATABASE
The text was updated successfully, but these errors were encountered: