ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Pavlukhin <vololo...@gmail.com>
Subject Re: Question: Table scheme 'default'
Date Fri, 31 Jan 2020 08:28:58 GMT
Vladimir,

I will try to shed a light on this.
1. Statically configured tables in caches (QueryEntity) by default
resides in a schema having the same name as a cache it belongs to
("default" is a cache and a schema name for a table Person in your
example).
2. As you might know SQL literals are case-insensitive if they used
without quotes. And Ignite SQL uses a quite naive approach for a
case-insensitive comparison. It simply converts all case-insensitive
names to upper case and compares after that.
3. And we observe consequences of such naive comparison. A schema name
(equal to a cache name) is treated case-sensitive and saved as is
("default" in lower case). Query "SELECT ... FROM default.Person"
passes schema name as case-insensitive. Ignite converts a schema from
the query to upper case "DEFAULT" and searches for a schema with that
name (using ordinary case-sensitive string comparison). But as there
is only "default" in lower case it fails to find a schema.

So, it is a bug. But for me personally it looks like the bug causes a
not major usability problem.

ср, 29 янв. 2020 г. в 12:27, Nikolay Izhikov <nizhikov@apache.org>:
>
> Vladimir.
>
> Please, provide a simple, self-contained reproducer to the issue you described.
>
> > 29 янв. 2020 г., в 11:16, Vladimir Steshin <vladsz83@gmail.com> написал(а):
> >
> > Hi ppl. Wanted to ask is issue a bug. Minor propably.
> >
> > Recently noticed that one simple query returns a value which can't be found
> > 'as is' in following query. I tried to find and drop all the tables I
> > created with "create table":
> >
> > select schema_name, table_name, cache_name from sys.tables
> >
> > And there are tables which were not created with 'create table...'. For
> > example, table 'default.Person' from the test/tutorial I was researching.
> > Ok. I tried to delete them too. Now I know this is prohibited. But why I
> > got error: scheme 'default' not found? I just received this schema name
> > from previous query.
> >
> > To avoid this I had to capitalize schema name taking it into "":
> > "default".Person. Then I got normal error like 'only cache created tables
> > can be removed with drop table.'.
> >
> > One select returns value which can't be found in second select
> > (delete/drop). Isn't it a bug from SQL's point of view?
>


-- 
Best regards,
Ivan Pavlukhin

Mime
View raw message