Refactoring does NOT take care of procudures and views
This is a big problem for me.
I renamed one table using the refactoring function.
But all views and procedures which used this table were not automatically changed as I expected.
Now I can't even open the views or procedures to manually edit them. All I get is: "unable to parse source text" which derives (so I think) from the now no more existing tables.
I was able to edit the views with the help of phpMyAdmin. But I can't edit the procedure.
This is a big issue for me.
Could you please describe the steps to reproduce the issue in details?
Please also provide us the CREATE definitions of the objects.
Additionally, please specify the version of dbForge.
-
Herb commented
To add. I find I am able to open the same files using MYSQL Workbench.
-
Herb commented
I have the same problem. After I upgraded dbForge I suddenly have files I cant open. Very annoying. I like your product but its the second time I have problems after an upgrade
"Unable to parse source text" -
Jürgen Schulze commented
Refactoring->Rename->Confirm - That's it
But the views were not touched
And about the procedure; I was able to open (and run it) with heidisql. So I guess the fail is with you. Here is the complete code that can't be open now anymore:ThisSP:BEGIN
DECLARE done INT DEFAULT 0;
DECLARE colsum float DEFAULT 0;
DECLARE M_Count_Columns int DEFAULT 0;
DECLARE M_Column_Field varchar(60);
DECLARE M_Columns VARCHAR(8000) DEFAULT '';
DECLARE M_orderbyfield VARCHAR(60);
DECLARE M_sqltext, M_rowsumstring, M_wherestring VARCHAR(8000);
DECLARE M_stmt VARCHAR(8000);
DECLARE cur1 CURSOR FOR SELECT CAST(Column_Field AS CHAR) FROM Temp;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;IF (P_Where<>'') then
SET M_wherestring=P_Where;
ELSE
SET M_wherestring='1=1';
END IF;DROP TABLE IF EXISTS Temp;
SET @M_sqltext = CONCAT('CREATE TEMPORARY TABLE Temp ',
' SELECT DISTINCT ',P_Column_Field,
' AS Column_Field',
' FROM ',P_From,
' WHERE ', M_wherestring,
' ORDER BY ', P_Column_Field);#SELECT @M_sqltext;LEAVE ThisSP;
PREPARE M_stmt FROM @M_sqltext;
EXECUTE M_stmt;SELECT COUNT(*) INTO M_Count_Columns
FROM Temp
WHERE Column_Field IS NOT NULL;
IF (M_Count_Columns > 0) THEN
OPEN cur1;
REPEAT
FETCH cur1 INTO M_Column_Field;
IF (NOT done) and (M_Column_Field IS NOT NULL) THEN
SET M_Columns = CONCAT(M_Columns,' REPLACE( GROUP_CONCAT( CASE WHEN ',P_Column_Field,'=''',M_Column_Field,'''',
' THEN ',P_Value,
' ELSE NULL END, ''''), '','', '''') AS ''', M_Column_Field ,''',');
END IF;
UNTIL done END REPEAT;
#SELECT colsum;LEAVE ThisSP;
SET M_Columns = Left(M_Columns,Length(M_Columns)-1);
#SELECT M_Columns;LEAVE ThisSP;
IF (P_Rowsumname<>'') THEN
SET M_rowsumstring=CONCAT(', (SELECT SUM(',P_Value,') FROM ',P_From,' tab2 WHERE ',M_wherestring,' AND tab1.',P_Row_Field,'=tab2.',P_Row_Field,') AS ', P_Rowsumname);
ELSE
SET M_rowsumstring='';
END IF;
#SELECT M_rowsumstring;LEAVE ThisSP;IF (P_Orderby<>'') THEN
SET M_orderbyfield=P_Orderby;
ELSE
SET M_orderbyfield=P_Row_Field;
END IF;
#SELECT M_orderbyfield;LEAVE ThisSP;
SET @M_sqltext = CONCAT('SELECT ',P_Row_Field,', ',M_Columns, M_rowsumstring,
' FROM ', P_From,' AS tab1',
' WHERE ', M_wherestring,
' GROUP BY ', P_Row_Field,
' ORDER BY ', M_orderbyfield);#SELECT @M_sqltext;LEAVE ThisSP;
# save ot print on screen?
IF (P_Savetable<>'') THEN
SET @M_sqltext=CONCAT('CREATE TABLE ',P_Savetable,' ', @M_sqltext);
ELSE
# do nothing, but we have to do somthing otherwise we can't compile
SET @M_sqltext=@M_sqltext;
END IF;
#SELECT @M_sqltext;LEAVE ThisSP;
PREPARE M_stmt FROM @M_sqltext;EXECUTE M_stmt;
END IF;
END