summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2017-10-17 17:20:46 +0300
committerAleksey Midenkov <midenok@gmail.com>2017-10-17 17:20:46 +0300
commit17bd486f361a150cb6e4c0320c1fa8e344beb76b (patch)
tree3d21baab4ac00cd11f64dd182fe7c55f31a38b4d
parent8e193661d29494e14ff59e484020c51369f65aa4 (diff)
downloadmariadb-git-17bd486f361a150cb6e4c0320c1fa8e344beb76b.tar.gz
SQL: thd_start_utime() fix [fixes #284]
-rw-r--r--mysql-test/suite/versioning/common.inc3
-rw-r--r--mysql-test/suite/versioning/r/alter.result3
-rw-r--r--mysql-test/suite/versioning/r/auto_increment.result3
-rw-r--r--mysql-test/suite/versioning/r/commit_id.result3
-rw-r--r--mysql-test/suite/versioning/r/create.result3
-rw-r--r--mysql-test/suite/versioning/r/ddl.result3
-rw-r--r--mysql-test/suite/versioning/r/delete.result3
-rw-r--r--mysql-test/suite/versioning/r/insert.result3
-rw-r--r--mysql-test/suite/versioning/r/partition.result3
-rw-r--r--mysql-test/suite/versioning/r/select.result3
-rw-r--r--mysql-test/suite/versioning/r/select_sp.result3
-rw-r--r--mysql-test/suite/versioning/r/update.result3
-rw-r--r--mysql-test/suite/versioning/r/view.result3
-rw-r--r--sql/sql_class.cc2
14 files changed, 27 insertions, 14 deletions
diff --git a/mysql-test/suite/versioning/common.inc b/mysql-test/suite/versioning/common.inc
index 3c4d11b84ab..ca3ccd41752 100644
--- a/mysql-test/suite/versioning/common.inc
+++ b/mysql-test/suite/versioning/common.inc
@@ -1,5 +1,6 @@
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
delimiter ~~;
create procedure if not exists verify_vtq()
@@ -9,7 +10,7 @@ begin
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
- begin_timestamp > '1-1-1 0:0:0' as C,
+ begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result
index 9e812769ee3..d6cbaf96b73 100644
--- a/mysql-test/suite/versioning/r/alter.result
+++ b/mysql-test/suite/versioning/r/alter.result
@@ -249,6 +249,7 @@ t CREATE TABLE `t` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
create procedure if not exists verify_vtq()
begin
set @i= 0;
@@ -256,7 +257,7 @@ select
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
-begin_timestamp > '1-1-1 0:0:0' as C,
+begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/mysql-test/suite/versioning/r/auto_increment.result b/mysql-test/suite/versioning/r/auto_increment.result
index 7eb027f52d6..533a5cc45af 100644
--- a/mysql-test/suite/versioning/r/auto_increment.result
+++ b/mysql-test/suite/versioning/r/auto_increment.result
@@ -1,5 +1,6 @@
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
create procedure if not exists verify_vtq()
begin
set @i= 0;
@@ -7,7 +8,7 @@ select
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
-begin_timestamp > '1-1-1 0:0:0' as C,
+begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/mysql-test/suite/versioning/r/commit_id.result b/mysql-test/suite/versioning/r/commit_id.result
index a53ba70a9b3..56ca1f4bec3 100644
--- a/mysql-test/suite/versioning/r/commit_id.result
+++ b/mysql-test/suite/versioning/r/commit_id.result
@@ -1,5 +1,6 @@
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
create procedure if not exists verify_vtq()
begin
set @i= 0;
@@ -7,7 +8,7 @@ select
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
-begin_timestamp > '1-1-1 0:0:0' as C,
+begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/mysql-test/suite/versioning/r/create.result b/mysql-test/suite/versioning/r/create.result
index 851d287f31e..a190ac30fd9 100644
--- a/mysql-test/suite/versioning/r/create.result
+++ b/mysql-test/suite/versioning/r/create.result
@@ -1,5 +1,6 @@
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
create procedure if not exists verify_vtq()
begin
set @i= 0;
@@ -7,7 +8,7 @@ select
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
-begin_timestamp > '1-1-1 0:0:0' as C,
+begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/mysql-test/suite/versioning/r/ddl.result b/mysql-test/suite/versioning/r/ddl.result
index 1bfca2da8f6..759cb5f449a 100644
--- a/mysql-test/suite/versioning/r/ddl.result
+++ b/mysql-test/suite/versioning/r/ddl.result
@@ -1,5 +1,6 @@
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
create procedure if not exists verify_vtq()
begin
set @i= 0;
@@ -7,7 +8,7 @@ select
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
-begin_timestamp > '1-1-1 0:0:0' as C,
+begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/mysql-test/suite/versioning/r/delete.result b/mysql-test/suite/versioning/r/delete.result
index 7b7e836f84d..910d99c8643 100644
--- a/mysql-test/suite/versioning/r/delete.result
+++ b/mysql-test/suite/versioning/r/delete.result
@@ -1,5 +1,6 @@
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
create procedure if not exists verify_vtq()
begin
set @i= 0;
@@ -7,7 +8,7 @@ select
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
-begin_timestamp > '1-1-1 0:0:0' as C,
+begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/mysql-test/suite/versioning/r/insert.result b/mysql-test/suite/versioning/r/insert.result
index d7b7bd972dc..4bfa4fe0720 100644
--- a/mysql-test/suite/versioning/r/insert.result
+++ b/mysql-test/suite/versioning/r/insert.result
@@ -1,5 +1,6 @@
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
create procedure if not exists verify_vtq()
begin
set @i= 0;
@@ -7,7 +8,7 @@ select
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
-begin_timestamp > '1-1-1 0:0:0' as C,
+begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index 2107c065a56..2ba2b870ae9 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -1,5 +1,6 @@
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
create procedure if not exists verify_vtq()
begin
set @i= 0;
@@ -7,7 +8,7 @@ select
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
-begin_timestamp > '1-1-1 0:0:0' as C,
+begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result
index f4eb8c35d0e..6c179d2e166 100644
--- a/mysql-test/suite/versioning/r/select.result
+++ b/mysql-test/suite/versioning/r/select.result
@@ -1,5 +1,6 @@
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
create procedure if not exists verify_vtq()
begin
set @i= 0;
@@ -7,7 +8,7 @@ select
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
-begin_timestamp > '1-1-1 0:0:0' as C,
+begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/mysql-test/suite/versioning/r/select_sp.result b/mysql-test/suite/versioning/r/select_sp.result
index a4d0bbfde0d..44b7d4e25b4 100644
--- a/mysql-test/suite/versioning/r/select_sp.result
+++ b/mysql-test/suite/versioning/r/select_sp.result
@@ -1,5 +1,6 @@
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
create procedure if not exists verify_vtq()
begin
set @i= 0;
@@ -7,7 +8,7 @@ select
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
-begin_timestamp > '1-1-1 0:0:0' as C,
+begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result
index a9f345963e5..d54add35def 100644
--- a/mysql-test/suite/versioning/r/update.result
+++ b/mysql-test/suite/versioning/r/update.result
@@ -1,5 +1,6 @@
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
create procedure if not exists verify_vtq()
begin
set @i= 0;
@@ -7,7 +8,7 @@ select
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
-begin_timestamp > '1-1-1 0:0:0' as C,
+begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/mysql-test/suite/versioning/r/view.result b/mysql-test/suite/versioning/r/view.result
index 45bc113cc27..ff009be57f5 100644
--- a/mysql-test/suite/versioning/r/view.result
+++ b/mysql-test/suite/versioning/r/view.result
@@ -1,5 +1,6 @@
set @@session.time_zone='+00:00';
select ifnull(max(transaction_id), 0) into @start_trx_id from information_schema.innodb_vtq;
+set @test_start=now(6);
create procedure if not exists verify_vtq()
begin
set @i= 0;
@@ -7,7 +8,7 @@ select
@i:= @i + 1 as No,
transaction_id > 0 as A,
commit_id > transaction_id as B,
-begin_timestamp > '1-1-1 0:0:0' as C,
+begin_timestamp > @test_start as C,
commit_timestamp >= begin_timestamp as D
from information_schema.innodb_vtq
where transaction_id > @start_trx_id;
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 4226da573cb..4a780812ec4 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -4644,7 +4644,7 @@ extern "C" time_t thd_start_time(const MYSQL_THD thd)
of the current query. */
extern "C" unsigned long long thd_start_utime(const MYSQL_THD thd)
{
- return thd->start_utime;
+ return thd->start_time * 1000000 + thd->start_time_sec_part;
}