Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4991

Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4993

Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php:4991) in /www/htdocs/v030397/mysql-qotd/wp-includes/feed-rss2-comments.php on line 8
Comments on: Question 7: Which of the following statements abort, if the mysql client was started with --safe-updates? http://mysql-qotd.casperia.net/archives/70 mysql 5.0/5.1 questions for learning purposes Fri, 06 Aug 2010 16:56:36 +0000 http://wordpress.org/?v=abc hourly 1 By: urs http://mysql-qotd.casperia.net/archives/70/comment-page-1#comment-10 urs Thu, 04 Feb 2010 23:34:38 +0000 http://mysql-qotd.casperia.net/?p=70#comment-10 <b> Answers: a b When a function is used on a column, its corresponding index cannot be used. c works, because the index on id can be used. <code>mysql> delete from table1 where id+1=10; ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column</code> <code>mysql> update table1 v1 set v1.name='v' where abs(id)=12; ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column</code> </b>
Answers:

a b

When a function is used on a column, its corresponding index cannot be used.
c works, because the index on id can be used.

mysql> delete from table1 where id+1=10;
ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column

mysql> update table1 v1 set v1.name='v' where abs(id)=12;
ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column

]]>