-
Notifications
You must be signed in to change notification settings - Fork 871
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop' into fix/partialDeleteM…
…ultiValueIndex
- Loading branch information
Showing
5 changed files
with
137 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
core/src/test/java/com/orientechnologies/orient/core/sql/BigDecimalQuerySupportTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.orientechnologies.orient.core.sql; | ||
|
||
import static org.testng.AssertJUnit.assertEquals; | ||
import java.math.BigDecimal; | ||
import java.util.List; | ||
|
||
import org.testng.annotations.Test; | ||
|
||
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; | ||
import com.orientechnologies.orient.core.record.impl.ODocument; | ||
import com.orientechnologies.orient.core.sql.OCommandSQL; | ||
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery; | ||
|
||
public class BigDecimalQuerySupportTest { | ||
|
||
@Test | ||
public void testDecimalPrecision() throws Exception { | ||
ODatabaseDocumentTx db = new ODatabaseDocumentTx("memory:" + BigDecimalQuerySupportTest.class.getName()); | ||
db.create(); | ||
try { | ||
|
||
db.command(new OCommandSQL("CREATE Class Test")).execute(); | ||
db.command(new OCommandSQL("CREATE Property Test.salary DECIMAL")).execute(); | ||
db.command(new OCommandSQL("INSERT INTO Test set salary = ?")).execute(new BigDecimal("179999999999.99999999999999999999")); | ||
List<ODocument> list = db.query(new OSQLSynchQuery<ODocument>("SELECT * FROM Test")); | ||
|
||
ODocument doc = (ODocument) list.get(0); | ||
BigDecimal salary = doc.field("salary"); | ||
|
||
assertEquals(new BigDecimal("179999999999.99999999999999999999"), salary); | ||
} finally { | ||
db.drop(); | ||
} | ||
} | ||
|
||
} |