SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[SA 7.1.228 Pro] - MySQL Formatting anomaly

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[SA 7.1.228 Pro] - MySQL Formatting anomaly
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 1394

Post [SA 7.1.228 Pro] - MySQL Formatting anomaly Reply with quote
Applying formatting rule
Code:

ALTER TABLE ...
   ...
   ,...
;

to
Code:

ALTER TABLE `ertekesites`.`eladasok` ADD CONSTRAINT eladasok_ibfk_1 FOREIGN KEY `eladasok_ibfk_1`(`id_adougyi_nap`) REFERENCES `ertekesites`.`adougyi_napok`(`id_adougyi_nap`) ON DELETE CASCADE ON UPDATE CASCADE`;

will result in corrupted code:
Code:

ALTER TABLE `ertekesites`.`eladasok` ADD CONSTRAINT eladasok_ibfk_1 FOREIGN KEY `eladasok_ibfk_1`(`id_adougyi_nap`) REFERENCES `ertekesites`.`adougyi_napok`(`id_adougyi_nap`)
ON DELETE CASCADE ON UPDATE`) ON DELETE CASCADE ON UPDATE CASCADE`
;

Mon Dec 01, 2014 11:27 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6499

Post Reply with quote
This weird effect is a result of the extra ` symbol just before the ending;

If you remove that extra `, then formatting of
Code:
ALTER TABLE `ertekesites`.`eladasok` ADD CONSTRAINT eladasok_ibfk_1 FOREIGN KEY `eladasok_ibfk_1`(`id_adougyi_nap`) REFERENCES `ertekesites`.`adougyi_napok`(`id_adougyi_nap`) ON DELETE CASCADE ON UPDATE CASCADE;

statement produces
Code:
ALTER TABLE `ertekesites`.`eladasok` ADD CONSTRAINT eladasok_ibfk_1 FOREIGN KEY
`eladasok_ibfk_1`(`id_adougyi_nap`) REFERENCES `ertekesites`.`adougyi_napok`(`id_adougyi_nap`)
ON DELETE CASCADE ON UPDATE CASCADE;


This result is valid. Note that the lines are wrapped because of a different line wrapping rule "Line Length for Code Wrapping"
Tue Dec 02, 2014 2:39 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1394

Post Reply with quote
Oh, dear, I must have been very tired letting that tiny grave accent to escape my sight :) Sorry for the false alarm.
Tue Dec 02, 2014 4:24 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.