[MCOL-63] Transaction does not get committed by the "commit" command after selecting the unix_timestamp() function Created: 2016-05-20  Updated: 2016-06-07  Resolved: 2016-06-07

Status: Closed
Project: MariaDB ColumnStore
Component/s: ExeMgr
Affects Version/s: None
Fix Version/s: 1.0.0

Type: Bug Priority: Major
Reporter: Daniel Lee (Inactive) Assignee: David Hall (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

Build tested:

getcalpontsoftwareinfo Fri May 20 13:28:21 2016

Name : infinidb-platform Relocations: (not relocatable)
Version : 5.0 Vendor: MariaDB, Inc.
Release : 0 Build Date: Sun 15 May 2016 07:24:29 PM CDT
Install Date: Mon 16 May 2016 05:21:51 PM CDT Build Host: srvbuilder

This issue is uncovered by the DMLRate test in Autopilot.

set autocommit=0;
select unix_timestamp();
insert into lineitem values(700000000,10000,1000,1,10,950.50,0.03,0.02,'N','O','1999-01-01','1999-01-01','1999-01-01','DELIVER IN PERSON','TRUCK','test test test test test');
select unix_timestamp();
commit;

The commit command does not commit the transaction. Another query session did not see the inserted row and the table lock remained in place.

If the "select unix_timestamp();" after insert is omitted, then the transaction worked as expected.



 Comments   
Comment by Dipti Joshi (Inactive) [ 2016-05-23 ]

dleeyh Is this behavior only when using unix_timestamp() within transaction Or any other function in the transaction ?

Comment by Justin Swanhart (Inactive) [ 2016-06-06 ]

were any other functions tried? is it just that one function, or do other temporal functions not work like from_unixtime(..) or now()? How about select substr('1', 1, 1) for example, to see if string functions have issues.

Comment by Daniel Lee (Inactive) [ 2016-06-06 ]

Instead of the unix_timestamp() function, I tried few other functions, such as min() and max(), and they did not cause the same issue.

Comment by Justin Swanhart (Inactive) [ 2016-06-06 ]

those are aggregate functions, did you test any non-aggregate functions, did you test any other temporal functions?

It is very odd that unix_timestamp would have such a side effect.

Could you please test a string function and a temporal function if it has not been tested?

Comment by David Hall (Inactive) [ 2016-06-06 ]

Note that many functions, including the temporal functions, are implemented in columnstore and don't use the ones in MariaDB code. MySQL has added the DATE_ITEM type to the optimizer since 5.1.73, and it breaks some of those implementations independently. Each needs to be tried to see what works and what doesn't. Fixes are usually straight forward.

Comment by Justin Swanhart (Inactive) [ 2016-06-06 ]

okay, so something is strange here, because my test works, so this might not be related to unix_timestamp() or is side effect of previous test perhaps, or related to data types in lineitem perhaps?:
MariaDB [test]> set autocommit=0;
Query OK, 0 rows affected (0.00 sec)

MariaDB [test]> insert into t1 values(2);
Query OK, 1 row affected (0.02 sec)

MariaDB [test]> select unix_timestamp();
------------------

unix_timestamp()

------------------

1465257426

------------------
1 row in set (0.01 sec)

MariaDB [test]> commit;
Query OK, 0 rows affected (0.00 sec)

MariaDB [test]> select * from t1;
------

c1

------

1
2

------
2 rows in set (0.01 sec)

Comment by Justin Swanhart (Inactive) [ 2016-06-07 ]

in fact, why would select unix_timestamp(); even use columnstore? it uses no real tables...

So i created lineitem, and the test passes.

So this is some side effect of another portion of that test.

Comment by Dipti Joshi (Inactive) [ 2016-06-07 ]

jswanhartIt is possible that the binaries that dleeyh tested this with on May 20th and the binaries that you are testing with are not same. Can you confirm the version of your binaries ? May be your binaries has updates that have fixed this behavior.

What we need to see is if the behavior reported by Daniel Lee is in the latest build - if not then we can close this, other wise analyze it further.

Comment by Daniel Lee (Inactive) [ 2016-06-07 ]

Build verified:

mscadmin> getsoft
getsoftwareinfo Mon Jun 6 22:13:55 2016

Name : mariadb-columnstore-platform Relocations: (not relocatable)
Version : 1.0 Vendor: MariaDB Corporation Ab
Release : 0 Build Date: Fri 03 Jun 2016 06:12:55 PM EDT
Install Date: Fri 03 Jun 2016 06:41:56 PM EDT Build Host: srvbuilder
Group : Applications Source RPM: mariadb-columnstore-1.0-0.src.rpm

This is no longed an issue in the build tested.

Tested in a 1UM-2PM stack.

MariaDB [mytest]> select unix_timestamp();
------------------

unix_timestamp()

------------------

1465265421

------------------
1 row in set (0.01 sec)

MariaDB [mytest]> insert into lineitem values(700000000,10000,1000,1,10,950.50,0.03,0.02,'N','O','1999-01-01','1999-01-01','1999-01-01','DELIVER IN PERSON','TRUCK','test test test test test');
Query OK, 1 row affected (2.15 sec)

MariaDB [mytest]> select unix_timestamp();
------------------

unix_timestamp()

------------------

1465265445

------------------
1 row in set (0.00 sec)

MariaDB [mytest]> commit;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mytest]> desc lineitem;
-------------------------------------------------+

Field Type Null Key Default Extra

-------------------------------------------------+

l_orderkey int(11) YES   NULL  
l_partkey int(11) YES   NULL  
l_suppkey int(11) YES   NULL  
l_linenumber bigint(20) YES   NULL  
l_quantity decimal(12,2) YES   NULL  
l_extendedprice decimal(12,2) YES   NULL  
l_discount decimal(12,2) YES   NULL  
l_tax decimal(12,2) YES   NULL  
l_returnflag char(1) YES   NULL  
l_linestatus char(1) YES   NULL  
l_shipdate date YES   NULL  
l_commitdate date YES   NULL  
l_receiptdate date YES   NULL  
l_shipinstruct char(25) YES   NULL  
l_shipmode char(10) YES   NULL  
l_comment varchar(44) YES   NULL  

-------------------------------------------------+
16 rows in set (0.00 sec)

MariaDB [mytest]> select * from lineitem where l_orderkey = 700000000;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

l_orderkey l_partkey l_suppkey l_linenumber l_quantity l_extendedprice l_discount l_tax l_returnflag l_linestatus l_shipdate l_commitdate l_receiptdate l_shipinstruct l_shipmode l_comment

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

700000000 10000 1000 1 10.00 950.50 0.03 0.02 N O 1999-01-01 1999-01-01 1999-01-01 DELIVER IN PERSON TRUCK test test test test test

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.28 sec)

MariaDB [mytest]> quit
Bye

[root@s1um1 ~]# /usr/local/mariadb/columnstore/bin/viewtablelock
No tables are locked in the database.

Generated at Thu Feb 08 02:18:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.