[h2] Re: Changed behavior for NOT NULL columns with default values

2020-04-13 Thread Evgenij Ryazanov
Hello.

Your command is obliviously invalid. You can't insert a NULL into column 
with NOT NULL constraint. You need to use DEFAULT
INSERT INTO test_table(column1, update_time) VALUES ('test', DEFAULT);
or you can simply remove this column from the list of INSERT columns.
INSERT INTO test_table(column1) VALUES ('test');

MySQL historically allows different incorrect commands, but recent versions 
of MySQL disallow many of them by default. H2 allowed some incorrect 
commands in MySQL compatibility mode too, but some such support was removed 
to match default behavior of MySQL better and to remove unnecessary 
complications from H2.

It looks like MySQL does not allow NULL for NOT NULL columns any more in 
some cases, but still allows it in others. This difference wasn't found 
earlier and such support was removed completely from H2 and I don't think 
that it will be restored. You need to fix your command instead or continue 
to use some outdated version of H2.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/7e16badb-dbf8-4925-82c9-5561b3684d6e%40googlegroups.com.


[h2] Re: unable to create linked table on hive database/tables

2020-04-13 Thread Joseph Varghese
thx Evgenij for the direction I was able to build a custom driver and issue is 
resolved.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/96adb05e-cf56-48d3-9392-a59465146fc0%40googlegroups.com.


[h2] H2 in-memory database error “Data conversion error while using GEOMETRY" (JdbcSQLException: Data conversion error converting)

2020-04-13 Thread RAJIV S
Hi,
 I am getting below error while loading GeoJson into H2 table  . I am using 
java . 
Please help.


a8155d5f4049c052934acaff7ff87371007e0020bfc3e16d6dc1a47b4049c054477ff1527ff8'
 
(CZONE: THE_GEOM GEOMETRY
)"; SQL statement:
**INSERT INTO "CZONE" VALUES(?,?,?,?) -- (?1, ?2, ?3, ?4)** [22018-196]; 
SQL statement:
CALL 
GeoJsonRead('/usr/local/javaapp/test/conf/delhicongestionchargezone.geojson', 
'CZONE') [22018-196]
**org.h2.jdbc.JdbcSQLException: Data conversion error converting 
"X'aced0005737200216f72672e**



INSERT INTO "CZONE" VALUES(?,?,?,?) -- (?1, ?2, ?3, ?4) [22018-196]; SQL 
statement:
**CALL 
GeoJsonRead**('/usr/local/javaapp/test/conf/delhicongestionchargezone.geojson', 
'CZONE') [22018-196]
at org.h2.message.DbException.addSQL(DbException.java:132)
at org.h2.command.Command.executeQuery(Command.java:219)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:186)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:164)
at 
com.apex.exception.batch.event.TestBatchEvtZone.testGISCall(TestBatchEvtZone.java:1660)
at 
com.apex.exception.batch.event.TestBatchEvtZone.processDelhiZoneEvent(TestBatchEvtZone.java:238)
at 
com.apex.exception.batch.event.TestBatchEvtZone.processEvent(TestBatchEvtZone.java:208)
at 
com.apex.exception.batch.processor.TestBatchEventProcessor$1.call(TestBatchEventProcessor.java:298)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown 
Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.h2.jdbc.JdbcBatchUpdateException: Data conversion error 
converting "X'aced0005737200216f72672e6

**
Piece of code
**
 stmt.execute("CREATE ALIAS IF NOT EXISTS H2GIS_SPATIAL FOR 
\"org.h2gis.functions.factory.H2GISFunctions.load\"" );
 stmt.execute("CALL H2GIS_SPATIAL()");
 stmt.execute("CALL 
GeoJsonRead('/usr/local/javaapp/test/conf/delhicongestionchargezone.geojson', 
'CZONE')");
 stmt.execute("CREATE SPATIAL INDEX myspatialindex ON CZONE(THE_GEOM)");

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/68cd0c6f-50ac-4b6b-8c46-869596f1f39a%40googlegroups.com.


[h2] Changed behavior for NOT NULL columns with default values

2020-04-13 Thread Eyal Segal
I'm trying to migrate from H2 version 1.4.196 to 1.4.200 and I encountered 
a strange problem.
We're using H2 for unit tests to mimic MySql. The connection string is "...;
MODE=MYSQL;IGNORECASE=TRUE;IFEXISTS=TRUE;INIT=SET SCHEMA TEST"

When running the following:

CREATE TABLE test_table(column1 VARCHAR(10), update_time TIMESTAMP NOT NULL 
DEFAULT CURRENT_TIMESTAMP)

INSERT INTO test_table(column1, update_time) VALUES ('test', null)

I get an exception:
org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed 
for column "UPDATE_TIME"; SQL statement:
INSERT INTO test_table(column1, update_time) VALUES ('test', null) [23502-
200]
 at org.h2.message.DbException.getJdbcSQLException(DbException.java:459)
 at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
 at org.h2.message.DbException.get(DbException.java:205)
 at org.h2.message.DbException.get(DbException.java:181)
 at org.h2.table.Column.validateConvertUpdateSequence(Column.java:374)
 at org.h2.table.Table.validateConvertUpdateSequence(Table.java:845)
 at org.h2.command.dml.Insert.insertRows(Insert.java:187)
 at org.h2.command.dml.Insert.update(Insert.java:151)
 at org.h2.command.CommandContainer.update(CommandContainer.java:198)
 at org.h2.command.Command.executeUpdate(Command.java:251)
 at org.h2.jdbc.JdbcStatement.executeUpdateInternal(JdbcStatement.java:168)
 at org.h2.jdbc.JdbcStatement.executeUpdate(JdbcStatement.java:126)
 at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(
DelegatingStatement.java:234)
 at org.apache.commons.dbcp2.DelegatingStatement.executeUpdate(
DelegatingStatement.java:234)



This works well in both 1.4.196 and on MySql. Is this a regression? Is 
there a workaround?

Thanks!


-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/7a784d72-95df-4302-a7ca-0cb89ccadf13%40googlegroups.com.


Re: [h2] database benchmark performace mysql vs cache vs system vs directory file

2020-04-13 Thread Noel Grandin
I'm sorry to say, but you need to do more reading on how caches work, that
is not at all how it functions.

A brief overview of our architecture is here:
http://h2database.com/html/architecture.html

When people say that SQLite is faster than the filesystem, they mean it is
faster for the specific use-case of storing and retrieving structured
records.
It can be faster because it knows more about the structure and
access-pattern of the data than the filesystem.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/CAFYHVnXyeHom0xh%3DD4fUxCPQO7fCXmzH%2BOL-5T%2B7VgEt3qE58A%40mail.gmail.com.


Re: [h2] database benchmark performace mysql vs cache vs system vs directory file

2020-04-13 Thread Danilo Santos
as I understand it, this is copying and pasting a frequent part of the 
storage file into another smaller storage file.

but I was wondering if it would be faster to insert data directly into the 
directory system instead of storage files.

on the internet there are several theories, but none shows a benchmark, and 
I think that 1 creator of 1 database may have tested adversarial databases 
to analyze performance.

they say sqlite is 70% faster than the file system, but I can’t understand 
why, I still don’t have the means to test whether it’s true and I don’t 
even find test videos like they do on video cards even for ram, processor, 
ghz, core due to fps

Em domingo, 12 de abril de 2020 03:50:52 UTC-3, Noel Grandin escreveu:
>
> Not really, look up how an LRU cache works e.g.
>
> https://en.wikipedia.org/wiki/Cache_replacement_policies
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/160a8a36-1879-4823-8e06-3be0060846cf%40googlegroups.com.