summaryrefslogtreecommitdiff
path: root/mysql-test/t/update.test
diff options
context:
space:
mode:
authormonty@donna.mysql.com <>2000-12-28 03:56:38 +0200
committermonty@donna.mysql.com <>2000-12-28 03:56:38 +0200
commitc0f40d14cc36f56f5b4dba288583acd345429e4e (patch)
treec27e400395741740f2e230395445236b38db27c1 /mysql-test/t/update.test
parent361067e9150f7fa57d5b2ac722ed55df9c14cc53 (diff)
downloadmariadb-git-c0f40d14cc36f56f5b4dba288583acd345429e4e.tar.gz
Added support for hex strings to mysqlimport
A lot of new tests to mysqltest Fixed bug with BDB tables and autocommit
Diffstat (limited to 'mysql-test/t/update.test')
-rw-r--r--mysql-test/t/update.test29
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
new file mode 100644
index 00000000000..6010c311015
--- /dev/null
+++ b/mysql-test/t/update.test
@@ -0,0 +1,29 @@
+#
+# test of updating of keys
+#
+
+drop table if exists t1;
+create table t1 (a int auto_increment , primary key (a));
+insert into t1 values (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
+update t1 set a=a+10 where a > 34;
+update t1 set a=a+100 where a > 0;
+drop table t1;
+
+CREATE TABLE t1
+ (
+ place_id int (10) unsigned NOT NULL,
+ shows int(10) unsigned DEFAULT '0' NOT NULL,
+ ishows int(10) unsigned DEFAULT '0' NOT NULL,
+ ushows int(10) unsigned DEFAULT '0' NOT NULL,
+ clicks int(10) unsigned DEFAULT '0' NOT NULL,
+ iclicks int(10) unsigned DEFAULT '0' NOT NULL,
+ uclicks int(10) unsigned DEFAULT '0' NOT NULL,
+ ts timestamp(14),
+ PRIMARY KEY (place_id,ts)
+ );
+
+INSERT INTO t1 (place_id,shows,ishows,ushows,clicks,iclicks,uclicks,ts)
+VALUES (1,0,0,0,0,0,0,20000928174434);
+UPDATE t1 SET shows=shows+1,ishows=ishows+1,ushows=ushows+1,clicks=clicks+1,iclicks=iclicks+1,uclicks=uclicks+1 WHERE place_id=1 AND ts>="2000-09-28 00:00:00";
+select place_id,shows from t1;
+drop table t1;