Description:
Using a unequal number of single or double quotes inside a mulit-line comment (/**/) can
make an SQL script not run through. Sometimes the script simply runs through silently, so
one may think everthing was OK. Some other times, unpredictable error messages occur,
depending on the rest of the code that is truncated.
Note:
1. You can also put in three quotes, five, seven, ... etc. it stays the same.
2. Putting an equal number of quotes does not seem to do harm, as long as it stays in the
same comment.
How to repeat:
INSERT INTO GameStat VALUES ( 110, 55, 4, 81);
INSERT INTO GameStat VALUES ( 111, 55, 6, 75);
INSERT INTO GameStat VALUES ( 112, 56, 0, 68);
INSERT INTO GameStat VALUES ( 113, 56, 8, 89);
/* TV Dieburg GameStat ID's (4), 9, 20, 25, 30, 43, 44, (59), 62 */
^
|
UH-OH!
from here the rest of the script is not executed!!! I wondered where the data had gone
when I reran the script one day - I seem to have put in some '''''...
/* Ginsheim J S F */
INSERT INTO PlayerStat VALUES ( 0, 9, 0, 10, 1, 2); /* Karsten */
INSERT INTO PlayerStat VALUES ( 1, 9, 1, 14, 1, 3); /* Johannes */
INSERT INTO PlayerStat VALUES ( 2, 9, 2, 6, 0, 3); /* Ahmed */
INSERT INTO PlayerStat VALUES ( 3, 9, 4, 13, 1, 5); /* Daniel */
INSERT INTO PlayerStat VALUES ( 4, 9, 6, 7, 0, 0); /* Michael K. */
INSERT INTO PlayerStat VALUES ( 5, 9, 7, 15, 1, 2); /* Patrick */
INSERT INTO PlayerStat VALUES ( 6, 9, 8, 5, 0, 0); /* Joann */
INSERT INTO PlayerStat VALUES ( 7, 9, 9, 8, 1, 2); /* Michael W. */
.
.
.
lots more omitted without notice
Suggested fix:
Well, simply avoid all kinds of quotes and other non-standard characters in comments!
Description: Using a unequal number of single or double quotes inside a mulit-line comment (/**/) can make an SQL script not run through. Sometimes the script simply runs through silently, so one may think everthing was OK. Some other times, unpredictable error messages occur, depending on the rest of the code that is truncated. Note: 1. You can also put in three quotes, five, seven, ... etc. it stays the same. 2. Putting an equal number of quotes does not seem to do harm, as long as it stays in the same comment. How to repeat: INSERT INTO GameStat VALUES ( 110, 55, 4, 81); INSERT INTO GameStat VALUES ( 111, 55, 6, 75); INSERT INTO GameStat VALUES ( 112, 56, 0, 68); INSERT INTO GameStat VALUES ( 113, 56, 8, 89); /* TV Dieburg GameStat ID's (4), 9, 20, 25, 30, 43, 44, (59), 62 */ ^ | UH-OH! from here the rest of the script is not executed!!! I wondered where the data had gone when I reran the script one day - I seem to have put in some '''''... /* Ginsheim J S F */ INSERT INTO PlayerStat VALUES ( 0, 9, 0, 10, 1, 2); /* Karsten */ INSERT INTO PlayerStat VALUES ( 1, 9, 1, 14, 1, 3); /* Johannes */ INSERT INTO PlayerStat VALUES ( 2, 9, 2, 6, 0, 3); /* Ahmed */ INSERT INTO PlayerStat VALUES ( 3, 9, 4, 13, 1, 5); /* Daniel */ INSERT INTO PlayerStat VALUES ( 4, 9, 6, 7, 0, 0); /* Michael K. */ INSERT INTO PlayerStat VALUES ( 5, 9, 7, 15, 1, 2); /* Patrick */ INSERT INTO PlayerStat VALUES ( 6, 9, 8, 5, 0, 0); /* Joann */ INSERT INTO PlayerStat VALUES ( 7, 9, 9, 8, 1, 2); /* Michael W. */ . . . lots more omitted without notice Suggested fix: Well, simply avoid all kinds of quotes and other non-standard characters in comments!