Skip to content

Commit

Permalink
LDEV-4691 qoq / hsqldb use sql.enforce_strict_size=false; 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Sep 12, 2023
1 parent 64ad7a5 commit 6255fae
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,7 @@ private static void _loadDataSources(ConfigServerImpl configServer, ConfigImpl c
try {
setDatasource(config, datasources, QOQ_DATASOURCE_NAME,
new ClassDefinitionImpl("org.hsqldb.jdbcDriver", "org.lucee.hsqldb", "2.7.2.jdk8", config.getIdentification()), "hypersonic-hsqldb", "", -1,
"jdbc:hsqldb:mem:tempQoQ;sql.regular_names=false;", "sa", "", null, DEFAULT_MAX_CONNECTION, -1, -1, 60000, true, true, DataSource.ALLOW_ALL, false, false, null, new StructImpl(), "",
"jdbc:hsqldb:mem:tempQoQ;sql.regular_names=false;sql.enforce_strict_size=false;", "sa", "", null, DEFAULT_MAX_CONNECTION, -1, -1, 60000, true, true, DataSource.ALLOW_ALL, false, false, null, new StructImpl(), "",
ParamSyntax.DEFAULT, false, false, false, false);

}
Expand Down
36 changes: 36 additions & 0 deletions test/tickets/LDEV4691.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
component extends="org.lucee.cfml.test.LuceeTestCase" labels="qoq" {

function run( testResults , testBox ) {

describe( title='QofQ' , body=function(){

it( title='QoQ check decimal types scale are preserved' , body=function() {
var dec = 5.57;
var q1 = QueryNew( "id,dec", "integer,decimal" );
q1.addRow( { id: 1, dec: dec } );
var q2 = QueryNew( "id,str", "integer,varchar" );
q2.addRow( { id: 1, str: "testing" } );

var q3sql = "
select q1.*
from q1, q2
where q1.id = q2.id
";
var q3 = QueryExecute( q3sql, {}, {dbtype: "query"} );
// q3.dec should be 5.57. It was 6 instead.
expect( q3.dec ).toBe( dec );

var q4sql = "
select *
from q1, q2
where q1.id = q2.id
";
var q4 = QueryExecute( q4sql, {}, {dbtype: "query"} );
// q4.dec should be 5.57. It was 6 instead.
expect( q4.dec ).toBe( dec );
});
});

}

}

0 comments on commit 6255fae

Please sign in to comment.