Commenting bug

Discussion of open issues, suggestions and bugs regarding database management and administration tools for MySQL
Post Reply
vkimura
Posts: 41
Joined: Sat 21 Feb 2009 08:56
Location: Vancouver, BC, Canada

Commenting bug

Post by vkimura » Sat 21 Feb 2009 09:32

Hi,

I'm on trial version and I find dbforge for Mysql is pretty good thus far. But when I comment and save I find that the comments misalign themselves and move (it tabs some of the comments). It happens usually when I save but not all the time. Is this a bug? It's kind of annoying. Can't code without comments. I have to re-align the comments every time.

I downloaded 3.10.222.

I hope this can get fixed soon.

Much thanks,
Vkimura

Elias
Devart Team
Posts: 73
Joined: Tue 29 May 2007 14:02

Post by Elias » Mon 23 Feb 2009 08:35

Hello, does the problem happen in the sql editor while automating code formatting?
Can you give us a step by step instruction to reproduce the problem?
Last edited by Elias on Mon 23 Feb 2009 15:00, edited 1 time in total.

vkimura
Posts: 41
Joined: Sat 21 Feb 2009 08:56
Location: Vancouver, BC, Canada

indent on comments

Post by vkimura » Mon 23 Feb 2009 13:51

Hi Elias,

It happens inconsistently. If I'm making many changes and commenting I would say that it happens every 10 or 15 minutes. I've only been coding with stored procedures so I don't know if that helps and right after I make a save.

The formatting is set at defaults (i.e. I didn't make any changes to the options section). I hope this helps. I wish I could be of more help.

Please let me know if you can duplicate this problem. I'm using Vista Home Premium on my acer.

vkimura

Elias
Devart Team
Posts: 73
Joined: Tue 29 May 2007 14:02

Re: indent on comments

Post by Elias » Mon 23 Feb 2009 15:17

vkimura wrote:Hi Elias,

It happens inconsistently. If I'm making many changes and commenting I would say that it happens every 10 or 15 minutes. I've only been coding with stored procedures so I don't know if that helps and right after I make a save.

The formatting is set at defaults (i.e. I didn't make any changes to the options section). I hope this helps. I wish I could be of more help.

Please let me know if you can duplicate this problem. I'm using Vista Home Premium on my acer.

vkimura
Do you reproduce the problem while editing procedure in the procedure editor or in the script editor? Could you please give us a sample of your code to reproduce the problem.

vkimura
Posts: 41
Joined: Sat 21 Feb 2009 08:56
Location: Vancouver, BC, Canada

sample stored procedure

Post by vkimura » Mon 23 Feb 2009 16:05

Hi Elias,

Here is a sample. Kind of long I suppose but notice the last bit of commenting and how it's misaligned. I had to align the other comments:

CREATE DEFINER = 'root'@'localhost'
PROCEDURE howtopr1_test.insertClassTime_8(IN in_timestamp INT, IN in_year INT, IN in_month INT, IN in_day INT, IN in_student_id INT, IN in_custDbFirstNames_id INT, IN in_teacher_id INT, IN in_classType_id INT, IN in_classSize_id INT, IN in_classRoom_id INT, OUT sp_result_no TINYINT, OUT sp_error_warning VARCHAR(30), OUT sp_result_error VARCHAR(30))
BEGIN
DECLARE l_max_classtime_id INT; /* highest value of classTime_id field.*/
DECLARE l_new_max_classtime_id INT; /* add 1 to highest value of classTime_id field for new highest value. */
DECLARE l_classTime_id INT; /* classTime.classTime_id*/
DECLARE l_classDate_id INT; /* last_insert_id of classDate.id to insert into dc_dt_s_t_Many.classDate_id */

DECLARE EXIT HANDLER FOR SQLEXCEPTION SELECT
'ERROR: SQLEXCEPTION'
INTO
sp_result_error;
DECLARE EXIT HANDLER FOR SQLWARNING SELECT
'ERROR: SQLWARNING'
INTO
sp_result_error;
DECLARE EXIT HANDLER FOR NOT FOUND SELECT
'ERROR: NOT FOUND'
INTO
sp_result_error;

/*DECLARE l_timestamp INT DEFAULT 1233250200;
| DECLARE l_ts INT;
| DECLARE l_year INT DEFAULT 2009;
| DECLARE l_month INT DEFAULT 01;
| DECLARE l_day INT DEFAULT 29;*/

/*
| Check to see if selected timestamp value is set in `classtime.timeStamp` .
| If true then do not insert new values.*/

SET @myCount = 0;
SET in_timestamp = 1233254700;
SET in_year = 2009;
SET in_month = 1;
SET in_day = 29;
SET in_student_id = 168;
SET in_custDbFirstNames_id = NULL;
SET in_teacher_id = 3;
SET in_classType_id = 1;
SET in_classSize_id = 2;
SET in_classRoom_id = 1;

START TRANSACTION;

SELECT
COUNT(1)
INTO
@myCount
FROM
classTime
WHERE
`timestamp` = in_timestamp;

/*
| Allow multiple inserts; thus comment out the following line.
IF @myCount >= 0 THEN*/ /* only continue if there is no existing timestamp*/

/*
| Get current highest value of classTime_id field.
| Then later add value '1' for new highest value.*/
SELECT
MAX(classTime_id)
INTO
l_max_classtime_id
FROM
classTime;

/* Assign new highest value to classTime_id field to be used in
| classDate.classTime_id field*/
SELECT
l_max_classtime_id + 1
INTO
l_new_max_classtime_id;

/************************
| Insert selected timestamp ONLY if there is no other existing timestamp.
| classTime.timeStamp field is set to Unique and Index field.
************************/
IF @myCount = 0 THEN
INSERT INTO classTime (`classTime_id`, `timeStamp`) VALUES (`l_new_max_classtime_id`, `in_timestamp`);

/*
| Insert date and selected timestamp into `classDate` ONLY if there is
| no other existing timestamp as it would be redudant data.*/
INSERT INTO classDate (`year`, `month`, `day`, `classTime_id`) VALUES (`in_year`, `in_month`, `in_day`, `l_new_max_classtime_id`);

/*
| Get last_insert_id of classDate.id to insert into dc_dt_s_t_many.classDate_id.
| Only need to fetch LAST_INSERT_ID() of classDate if timestamp does not already exist.*/
SELECT
LAST_INSERT_ID()
INTO
l_classDate_id;

/*
| If there is already an existing classTime.timeStamp then
| retrieve the classTime.classTime_id WHERE classTime.timeStamp = in_timestamp.
| Additionally, retrieve the classDate.id WHERE classDate.classTime_id = classTime.classTime_id.
| These data to be used to INSERT into dc_dt_s_t_Many.*/
ELSEIF @myCount >= 1 THEN
SELECT
classTime_id
INTO
l_classTime_id
FROM
classTime;

SELECT
id
INTO
l_classDate_id
FROM
classDate;
END IF;

-- /************************
-- * Insert classDate_id, classTime_id, student_id, teacher_id, classType_id, classSize_id, classRoom_id
-- ************************/
-- /************************
-- * Reset in_custDbFirstNames to a NULL value since I couldn't submit a NULL value to the stored procedure
-- * (i.e. in_custDbFirstNames had to be set to 0)
-- ************************/
IF in_custDbFirstNames_id = 0 THEN
SET in_custDbFirstNames_id = NULL;
END IF;

INSERT INTO dc_dt_s_t_many (`classDate_id`, `classTime_id`, `student_id`, `custDbFirstNames_id`, `teacher_id`, `classType_id`, `classSize_id`, `classRoom_id`) VALUES (`l_classDate_id`, `l_new_max_classtime_id`, `in_student_id`, `in_custDbFirstNames_id`, `in_teacher_id`, `in_classType_id`, `in_classSize_id`, `in_classRoom_id`);
SET
sp_result_no = 1; /* if successfully entered into tables */
-- END IF;

COMMIT;

-- IF @myCount >= 1 THEN /* if there is an existing timestamp found in classTime table then do not insert */
-- SET sp_result_no = 0;
-- SET sp_error_warning = 'This timestamp already exists in the database.';
-- END IF;
/*SELECT l_ts;*/

/*
* If the database is not successfully updated
*/
IF sp_result_no != 1 THEN
SET sp_result_no = 0;
END IF;
END

I'm not certain if I'm using the procedure or scripting. How do I know which editor I'm using?

vkimura
Posts: 41
Joined: Sat 21 Feb 2009 08:56
Location: Vancouver, BC, Canada

image of commenting misalignment

Post by vkimura » Mon 23 Feb 2009 16:23

When I posted the coding it didn't format the coding the way it's actually displayed in my ide of devart. Uploading the image. Notice the end bit of the commenting. It was after I saved. I had to realign the other comments so it was readable for me.
http://omusicstudios.com/images/devart/ ... gnment.png

Elias
Devart Team
Posts: 73
Joined: Tue 29 May 2007 14:02

Post by Elias » Mon 23 Feb 2009 16:27

Thanks for the sample. You use a script editor when edit the .sql document. And you use an object editor when you open a procedure or any other object from the database, using the Database Explorer.

Post Reply