~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

Viewing changes to mysql-test/suite/storage_engine/update.test

  • Committer: Package Import Robot
  • Author(s): Otto Kekäläinen
  • Date: 2013-12-22 10:27:05 UTC
  • Revision ID: package-import@ubuntu.com-20131222102705-mndw7s12mz0szrcn
Tags: upstream-5.5.32
Import upstream version 5.5.32

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
2
# Basic UPDATE statements.
 
3
# UPDATE LOW_PRIORITY is covered in update_low_prio test
 
4
# UPDATE IGNORE is covered in update_ignore test
 
5
# Multi-table update is covered in update_multi test
 
6
#
 
7
 
 
8
--source have_engine.inc
 
9
 
 
10
--disable_warnings
 
11
DROP TABLE IF EXISTS t1;
 
12
--enable_warnings
 
13
 
 
14
--source create_table.inc
 
15
INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(4,'d'),(5,'e'),(10000,'foobar');
 
16
INSERT INTO t1 (a,b) SELECT a, b FROM t1;
 
17
 
 
18
UPDATE t1 SET a=a+100;
 
19
if ($mysql_errname)
 
20
{
 
21
  --let $functionality = UPDATE
 
22
  --source unexpected_result.inc
 
23
}
 
24
if (!$mysql_errname)
 
25
{
 
26
  --sorted_result
 
27
  SELECT a,b FROM t1;
 
28
 
 
29
  UPDATE t1 SET a=a-100, b=DEFAULT WHERE a>100;
 
30
  --sorted_result
 
31
  SELECT a,b FROM t1;
 
32
 
 
33
  # ORDER BY and LIMIT
 
34
  UPDATE t1 SET b = 'update' WHERE a <= 4 ORDER BY b DESC, a ASC LIMIT 1;
 
35
  --sorted_result
 
36
  SELECT a,b FROM t1;
 
37
}
 
38
 
 
39
# Cleanup
 
40
DROP TABLE t1;
 
41
 
 
42
--source cleanup_engine.inc
 
43