[
https://issues.apache.org/jira/browse/IGNITE-15214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Fedor Malchikov updated IGNITE-15214:
--------------------------------------
Description:
reproducer:
{code:python}
from pyignite import Client
from datetime import datetime
c = Client(username='', password='', use_ssl=False)
c.connect('localhost', 10800)
current_time = datetime.now()
c.sql('create table test(key int primary key, date datetime)')
c.sql(f"insert into test VALUES (1, ?)", query_args=[current_time])
c.sql(f"insert into test VALUES (2, '{current_time}')")
for row in c.sql('SELECT key, date FROM test'):
date = row
print(date[0], date[1][0])
c.close()
{code}
output:
{code:python}
1 2021-07-30 00:00:00
2 2021-07-30 13:51:22.618000
{code}
in dbeaver:
!image-2021-07-30-14-05-48-220.png!
was:
reproducer:
{code:python}
from pyignite import Client
from datetime import datetime
c = Client(username='', password='', use_ssl=False)
c.connect('localhost', 10800)
current_time = datetime.now()
c.sql('create table test(key int primary key, date datetime)')
c.sql(f"insert into test VALUES (1, ?)", query_args=[current_time])
c.sql(f"insert into test VALUES (2, '{current_time}')")
for row in c.sql('SELECT key, date FROM test'):
date = row
print(date[0], date[1][0])
c.close()
{code}
output:
{code:python}
1 2021-07-30 00:00:00
2 2021-07-30 13:51:22.618000
{code}
in dbeaver:
!image-2021-07-30-14-03-16-822.png!
> [python] When inserting datetime via query_args, only the date is inserted.
> ---------------------------------------------------------------------------
>
> Key: IGNITE-15214
> URL: https://issues.apache.org/jira/browse/IGNITE-15214
> Project: Ignite
> Issue Type: Bug
> Components: thin client
> Affects Versions: python-0.5.1
> Reporter: Fedor Malchikov
> Priority: Critical
> Attachments: image-2021-07-30-14-05-48-220.png
>
>
> reproducer:
> {code:python}
> from pyignite import Client
> from datetime import datetime
> c = Client(username='', password='', use_ssl=False)
> c.connect('localhost', 10800)
> current_time = datetime.now()
> c.sql('create table test(key int primary key, date datetime)')
> c.sql(f"insert into test VALUES (1, ?)", query_args=[current_time])
> c.sql(f"insert into test VALUES (2, '{current_time}')")
> for row in c.sql('SELECT key, date FROM test'):
> date = row
> print(date[0], date[1][0])
> c.close()
> {code}
> output:
> {code:python}
> 1 2021-07-30 00:00:00
> 2 2021-07-30 13:51:22.618000
> {code}
> in dbeaver:
> !image-2021-07-30-14-05-48-220.png!
--
This message was sent by Atlassian Jira
(v8.3.4#803005)