[teiid-issues] [JBoss JIRA] (TEIID-5206) Allow exponential values in OData V4 payloads with decimals

Ramesh Reddy (JIRA) issues at jboss.org
Tue Jan 9 15:14:00 EST 2018


    [ https://issues.jboss.org/browse/TEIID-5206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13512124#comment-13512124 ] 

Ramesh Reddy commented on TEIID-5206:
-------------------------------------

Test with
{code}
~~~
1. Create table in mysql
create table test_tbl( \
id INT(10) NOT NULL AUTO_INCREMENT, \
title VARCHAR(100) NOT NULL, \
author VARCHAR(40) NOT NULL, \
price DECIMAL(15,4) NOT NULL, \
submission_date DATE, \
PRIMARY KEY ( id ) \
);
2. Create datasource
                <datasource jndi-name="java:/guest_mysql5_DS" pool-name="guest_mysql5_DS" enabled="true">
                    <connection-url>jdbc:mysql://localhost:3306/test?sessionVariables=sql_mode=ANSI</connection-url>
                    <driver>mysql</driver>
                    <security>
                        <user-name>guest</user-name>
                        <password>welcome1</password>
                    </security>
                </datasource>
3. Create dynamic VDB, the "price" column is "Big Decimal"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<vdb name="Test" version="2">
<description/>
<model name="test">
<property name="importer.TableTypes" value="TABLE" />
<property name="importer.UseQualifiedName" value="false" />
<source connection-jndi-name="java:/guest_mysql5_DS" name="test" translator-name="mysql5"/>
</model>
</vdb>
4. Using restful interface to add/update value, the validation error was thrown, please check the log attached.
		HttpAuthenticationFeature auth = HttpAuthenticationFeature.basic("teiidUser", "Redhat!23");
		Client client = ClientBuilder.newBuilder()
		        .register(auth)
		        .build();
		WebTarget target = client.target(getBaseURI());
		
		// MySQL get test
//	    String restGetResp =
//	    	target.path("Test").path("test").path("test_tbl")
//	    	.request().accept(MediaType.APPLICATION_JSON).get()
//	    	.readEntity(String.class);
//	    System.out.println(restGetResp);
		// MySQL post test
	    String entity = 
			"{\"id\":3,\"title\":\"title 3\",\"author\":\"author 3\",\"price\":99999999.99,\"submission_date\":\"2017-12-08\"}";
	    String restPostResp = 
	    		target.path("Test").path("test").path("test_tbl")
	    		.request(MediaType.APPLICATION_JSON).post(Entity.entity(entity, MediaType.APPLICATION_JSON))
	    		.readEntity(String.class);
	    System.out.println(restPostResp);
{code}

> Allow exponential values in OData V4 payloads with decimals
> -----------------------------------------------------------
>
>                 Key: TEIID-5206
>                 URL: https://issues.jboss.org/browse/TEIID-5206
>             Project: Teiid
>          Issue Type: Bug
>          Components: OData
>    Affects Versions: 8.12
>            Reporter: Ramesh Reddy
>            Assignee: Ramesh Reddy
>             Fix For: 10.x
>
>
> This is link to the upstream Olingo issue https://issues.apache.org/jira/browse/OLINGO-1150



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the teiid-issues mailing list