If a table does not have a primary or unique field, heidisql shows error on deleting any record.
Error on deleting a record
DELETE FROM `mysettings` WHERE `ShownLevel`= AND `SettingName`='dehde' AND `Value`='' AND `CategoryName`='' AND `ValueTypeName`='' AND `Hint`='' AND `Description`='' AND `Path`='' LIMIT 1;
/* SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND `SettingName`='dehde' AND `Value`='' AND `CategoryName`='' AND `ValueTypeNam' at line 1 */
/* SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND `SettingName`='dehde' AND `Value`='' AND `CategoryName`='' AND `ValueTypeNam' at line 1 */
I use the lastest version/build. You can see the screen capture on http://www.cansarigul.com/heidi.png
CREATE TABLE `mysettings` (
`ShownLevel` INT(5) UNSIGNED NOT NULL,
`SettingName` VARCHAR(50) NOT NULL COLLATE 'utf8_turkish_ci',
`Value` TEXT NOT NULL COLLATE 'utf8_turkish_ci',
`CategoryName` VARCHAR(255) NOT NULL COLLATE 'utf8_turkish_ci',
`ValueTypeName` VARCHAR(255) NOT NULL COLLATE 'utf8_turkish_ci',
`Hint` VARCHAR(50) NOT NULL COLLATE 'utf8_turkish_ci',
`Description` VARCHAR(500) NOT NULL COLLATE 'utf8_turkish_ci',
`Path` VARCHAR(255) NOT NULL COLLATE 'utf8_turkish_ci'
)
COLLATE='utf8_turkish_ci'
ENGINE=InnoDB
ROW_FORMAT=DEFAULT
CREATE TABLE `mysettings` (
`ShownLevel` INT(5) UNSIGNED NOT NULL,
`SettingName` VARCHAR(50) NOT NULL COLLATE 'utf8_turkish_ci',
`Value` TEXT NOT NULL COLLATE 'utf8_turkish_ci',
`CategoryName` VARCHAR(255) NOT NULL COLLATE 'utf8_turkish_ci',
`ValueTypeName` VARCHAR(255) NOT NULL COLLATE 'utf8_turkish_ci',
`Hint` VARCHAR(50) NOT NULL COLLATE 'utf8_turkish_ci',
`Description` VARCHAR(500) NOT NULL COLLATE 'utf8_turkish_ci',
`Path` VARCHAR(255) NOT NULL COLLATE 'utf8_turkish_ci'
)
COLLATE='utf8_turkish_ci'
ENGINE=InnoDB
ROW_FORMAT=DEFAULT
Ah, got it: You had inserted one row and without some refresh you tried to update this new row, right? If you leave out some numeric value in a new row it looks like an empty string, not like "0". This empty string is not what's actually in the table - HeidiSQL just has not refreshed this row, which should probably be done after some INSERT. Not required after UDPATEs though but could be helpful. Will check if I can do that.
Could be that this is not posible in tables without primary key, as in your case. Probably doable with a
but that would introduce an unstable behaviour, as there can easily be rows inserted between INSERT and SELECT so we don't get the right row. Shit.
SELECT ... FROM table LIMIT <rowcount-1>, 1
but that would introduce an unstable behaviour, as there can easily be rows inserted between INSERT and SELECT so we don't get the right row. Shit.
Please login to leave a reply, or register at first.