Re: [Maria-developers] MDEV-12803 Improve function parameter data type control

2017-05-26 Thread Alexander Barkov
Hello Alexey,

Thanks for your feedback.

Sending a new version, as discussed in this email and on IRC.
Please find attached.

- Removed Item_geometry_func_importer
- Renamed Item_xxx_geometry_property to Item_xxx_args_geometry
- Renamed Item_xxx_dyadic_operation to Item_xxx_args_geometry_geometry.



This is the new hierarchy:


Item_str_func
  Item_geometry_func
Item_geometry_func_args_geometry
  Item_func_centroid
  Item_func_envelope
  Item_func_boundary
  Item_func_spatial_decomp
  Item_func_spatial_decomp_n
  Item_func_buffer
  Item_func_pointonsurface
Item_func_geometry_from_text
Item_func_geometry_from_wkb
Item_func_geometry_from_json
Item_func_point
Item_func_spatial_collection
Item_func_spatial_operation
  Item_binary_func_args_geometry
Item_func_as_wkb
Item_real_func
  Item_real_func_args_geometry
Item_func_x
Item_func_y
Item_func_area
Item_func_glength
  Item_real_func_args_geometry_geometry
Item_func_distance
Item_long_func
  Item_long_func_args_geometry
Item_func_issimple
  Item_func_isring
Item_func_isclosed
Item_func_dimension
Item_func_numgeometries
Item_func_numinteriorring
Item_func_numpoints
Item_func_srid
Item_bool_func
  Item_bool_func_args_geometry
Item_func_isempty
  Item_bool_func_args_geometry_geometry
Item_func_spatial_relate
Item_str_ascii_func
  Item_str_ascii_func_args_geometry
Item_func_as_wkt
Item_func_as_geojson
Item_func_geometry_type


Thanks!


On 05/26/2017 11:50 AM, Alexey Botchkov wrote:
>>1. It will look like a C fragment in a C++ code.
>>   Why is it more natural than a virtual method?
> 
> The Item hierarchy and 'check_type' hierarchy are parallel.
> So it seems natural to me if we can assign an already-prepared
> parameter-validation function to the type.
> 
>> 2. It will make the Item size bigger.
> But it will make Item** virtual tables smaller.
> 
>> 4. It will need more CPU for m_check_arguments_function initialization.
> Must be really small overhead.
> 
>> Are you afraid that I'll have to modify class hierarchy?
> Yes. My only concern is that the class hierarchy becomes more complicated
> and with repeating code.
> 
> But after a while i sort of used to it so now i'm fine with the virtual
> method.
> 
> 
>> We have a convention that functions return true on error and false on
>> success.
> For the check_something function returning TRUE or FALSE doesn't mean an
> 'error'.
> It's just the condition fits or doesn't.
> But fine, our code has many examples of 'check' functions returning
> results this way.
> 
> Typenames discussed.
> So otherwise i'm ok with the patch.
> 
> Best regards.
> HF 
> 
> On Wed, May 24, 2017 at 4:22 PM, Alexander Barkov  > wrote:
> 
> Hi Alexey,
> 
> Thank you very much for your review!
> 
> Please see my comments below:
> 
> 
> On 05/23/2017 12:16 AM, Alexey Botchkov wrote:
> > Firstly I'd say i don't like the idea of the 'virtual check_arguments()'
> > function.
> > I belive it's more natural to have a member 'm_check_arguments_function'
> > that would be set in constructor (or be an argument to the constructor)
> > and the non-virtual 'check_arguments()' that would just call that 
> member.
> > This would make Item class structure much nicer and would even save us
> > memory.
> >
> > If you have good arguments for your approach, I have some
> > comments/questions to your patch :)
> 
> I'm not sure that a function member is better.
> 
> 1. It will look like a C fragment in a C++ code.
>Why is it more natural than a virtual method?
> 
> 2. It will make the Item size bigger.
> 
> 3. It will need more coding.
>Now we have to declare only virtual functions.
>With a function member, we'll have to do:
>- declare function anyway
>- add a code into constructors
> 
> 4. It will need more CPU for m_check_arguments_function initialization.
>On the contrary, having a virtual methods costs nothing,
>except a small initialization in VMTs during mysqld startup.
> 
> 
> What is your main concern?
> Are you afraid that I'll have to modify class hierarchy
> for other Item_xxx_func?  It should not be necessary.
> We'll just have a set of protected methods on the Item_func level,
> for most typical cases.
> 
> 
> >
> > Why this change?
> > +++ b/mysql-test/t/gis-rtree.test
> > @@ -61,7 +61,7 @@ while ($1)
> >let $2=10;
> >while ($2)
> >{
> > -eval DELETE FROM t2 WHERE Within(g,
> > Envelope(GeometryFromWKB(Point($1 * 10 - 9, $2 * 10 - 9), Point($1 * 10,
> > $2 * 10;
> > +eval DELETE FROM t2 WHERE Within(g,
> > Envelope(GeometryFromWKB(Point($1 * 10 - 9, $2 * 10 - 9), 0)));
> >  SELECT count(*) FROM t2;
> >  dec $2;
> 
> 
> It passed POINT() as the second argi

Re: [Maria-developers] Cannot push branch to github

2017-05-26 Thread Valentin Rakush
Hi Vicențiu, hi Sergei,

thank you for explanations, yesterday I have submitted pull request
https://github.com/MariaDB/server/pull/398 It does not have assignee or
reviewers and I am not sure if somebody will be able to see it. Please have
a look.

Thank you,
Valentin


On Thu, May 25, 2017 at 12:44 PM, Vicențiu Ciorbaru 
wrote:

> Hi Valentin!
>
> The correct way to do a pull request is to create your own fork of the
> server repository. You don't need any special permissions for that.
> Afterwards, push your changes to your fork. Finally, click on New pull
> request button in *your* repository. Select the appropriate branch for the
> base fork and the appropriate branch from your head fork. Submit the pull
> request and we'll take it from there.
>
> Regards,
> Vicențiu
>
> On Thu, 25 May 2017 at 12:37 Valentin Rakush 
> wrote:
>
>> Hi all,
>>
>> I am trying to do first pull request to https://github.com/MariaDB/server
>> but I cannot push my new branch to github. Git says
>>
>> "ERROR: Permission to MariaDB/server.git denied to alpes214.
>> fatal: Could not read from remote repository.
>>
>> Please make sure you have the correct access rights
>> and the repository exists."
>>
>>
>>
>> Should I talk to somebody to get access rights first?
>>
>> --
>> Kind regards,
>> Valentin Rakush
>> ___
>> Mailing list: https://launchpad.net/~maria-developers
>> Post to : maria-developers@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~maria-developers
>> More help   : https://help.launchpad.net/ListHelp
>>
>


-- 
Best Regards,
Valentin Rakush.
___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] Cannot push branch to github

2017-05-26 Thread Vicențiu Ciorbaru
Hi Valentin!

I've just replied to your pull request. I can guarantee a time for when it
will be reviewed, but it will happen. :) Thanks again for the contribution!

Regards,
Vicențiu

On Fri, 26 May 2017 at 15:54 Valentin Rakush 
wrote:

> Hi Vicențiu, hi Sergei,
>
> thank you for explanations, yesterday I have submitted pull request
> https://github.com/MariaDB/server/pull/398 It does not have assignee or
> reviewers and I am not sure if somebody will be able to see it. Please have
> a look.
>
> Thank you,
> Valentin
>
>
> On Thu, May 25, 2017 at 12:44 PM, Vicențiu Ciorbaru 
> wrote:
>
>> Hi Valentin!
>>
>> The correct way to do a pull request is to create your own fork of the
>> server repository. You don't need any special permissions for that.
>> Afterwards, push your changes to your fork. Finally, click on New pull
>> request button in *your* repository. Select the appropriate branch for the
>> base fork and the appropriate branch from your head fork. Submit the pull
>> request and we'll take it from there.
>>
>> Regards,
>> Vicențiu
>>
>> On Thu, 25 May 2017 at 12:37 Valentin Rakush 
>> wrote:
>>
>>> Hi all,
>>>
>>> I am trying to do first pull request to
>>> https://github.com/MariaDB/server but I cannot push my new branch to
>>> github. Git says
>>>
>>> "ERROR: Permission to MariaDB/server.git denied to alpes214.
>>> fatal: Could not read from remote repository.
>>>
>>> Please make sure you have the correct access rights
>>> and the repository exists."
>>>
>>>
>>>
>>> Should I talk to somebody to get access rights first?
>>>
>>> --
>>> Kind regards,
>>> Valentin Rakush
>>> ___
>>> Mailing list: https://launchpad.net/~maria-developers
>>> Post to : maria-developers@lists.launchpad.net
>>> Unsubscribe : https://launchpad.net/~maria-developers
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>
>
>
> --
> Best Regards,
> Valentin Rakush.
>
___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


[Maria-developers] Building LibraOffice w/ MariaDB installed fails apt-get build-dep

2017-05-26 Thread Howard Johnson

Hi,

I'm having trouble with MariaDB as is described here:

https://ask.libreoffice.org/en/question/96902/building-lo-w-mariadb-installed-fails/


I suspect that there might be an issue with the virtual package or 
something like that.


Any idea of what is going wrong or how to fix it?

Thanks

-- howard


___
Mailing list: https://launchpad.net/~maria-developers
Post to : maria-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Maria-developers] [Commits] df94429: MDEV-11196: Error:Run-Time Check Failure #2 - Stack around the variable 'key_buff'

2017-05-26 Thread Sergey Petrunia
Hi Varun,

Ok to push.

On Thu, May 25, 2017 at 07:41:50PM +0530, Varun wrote:
> revision-id: df944293721a7ad93d115a58f2b574067d1dc79f 
> (mariadb-10.1.20-282-gdf94429)
> parent(s): a1b6128dedb4419db9fadaf94c356d3477d4e06f
> author: Varun Gupta
> committer: Varun Gupta
> timestamp: 2017-05-25 19:40:08 +0530
> message:
> 
> MDEV-11196: Error:Run-Time Check Failure #2 - Stack around the variable 
> 'key_buff'
> was corrupted, server crashes in opt_sum_query
> 
> extended keys feature disabled if the length of extended key is longer than 
> MAX_KEY_LEN
> 
> ---
>  mysql-test/r/innodb_ext_key.result | 81 
> ++
>  mysql-test/t/innodb_ext_key.test   | 51 
>  sql/table.cc   | 39 +-
>  3 files changed, 170 insertions(+), 1 deletion(-)
> 
> diff --git a/mysql-test/r/innodb_ext_key.result 
> b/mysql-test/r/innodb_ext_key.result
> index 1305be8..de1323e 100644
> --- a/mysql-test/r/innodb_ext_key.result
> +++ b/mysql-test/r/innodb_ext_key.result
> @@ -1133,5 +1133,86 @@ where index_date_updated= 10 and index_id < 800;
>  id   select_type table   typepossible_keys   key key_len ref 
> rowsExtra
>  1SIMPLE  t2  range   index_date_updated  index_date_updated  
> 13  NULL#   Using index condition
>  drop table t0,t1,t2;
> +#
> +# MDEV-11196: Error:Run-Time Check Failure #2 - Stack around the variable 
> 'key_buff'
> +# was corrupted, server crashes in opt_sum_query
> +set @save_innodb_file_format= @@innodb_file_format;
> +set @save_innodb_large_prefix= @@innodb_large_prefix;
> +set global innodb_file_format = BARRACUDA;
> +set global innodb_large_prefix = ON;
> +CREATE TABLE t1 (
> +pk INT,
> +f1 VARCHAR(3),
> +f2 VARCHAR(1024),
> +PRIMARY KEY (pk),
> +KEY(f2)
> +) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
> +INSERT INTO t1 VALUES (1,'foo','abc'),(2,'bar','def');
> +SELECT MAX(t2.pk) FROM t1 t2 INNER JOIN t1 t3 ON t2.f1 = t3.f1 WHERE t2.pk 
> <= 4;
> +MAX(t2.pk)
> +2
> +drop table t1;
> +CREATE TABLE t1 (
> +pk1 INT,
> +pk2 INT,
> +f1 VARCHAR(3),
> +f2 VARCHAR(1021),
> +PRIMARY KEY (pk1,pk2),
> +KEY(f2)
> +) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
> +INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
> +explain format= json
> +select * from t1 force index(f2)  where pk1 <= 5 and pk2 <=5 and f2 = 'abc' 
> and f1 <= '3';
> +EXPLAIN
> +{
> +  "query_block": {
> +"select_id": 1,
> +"table": {
> +  "table_name": "t1",
> +  "access_type": "range",
> +  "possible_keys": ["f2"],
> +  "key": "f2",
> +  "key_length": "3070",
> +  "used_key_parts": ["f2", "pk1"],
> +  "rows": 1,
> +  "filtered": 100,
> +  "index_condition": "((t1.pk1 <= 5) and (t1.pk2 <= 5) and (t1.f2 = 
> 'abc'))",
> +  "attached_condition": "(t1.f1 <= '3')"
> +}
> +  }
> +}
> +drop table t1;
> +CREATE TABLE t1 (
> +f2 INT,
> +pk2 INT,
> +f1 VARCHAR(3),
> +pk1 VARCHAR(1000),
> +PRIMARY KEY (pk1,pk2),
> +KEY k1(pk1,f2)
> +) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
> +INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
> +explain format= json
> +select * from t1 force index(k1)  where f2 <= 5 and pk2 <=5 and pk1 = 'abc' 
> and f1 <= '3';
> +EXPLAIN
> +{
> +  "query_block": {
> +"select_id": 1,
> +"table": {
> +  "table_name": "t1",
> +  "access_type": "range",
> +  "possible_keys": ["k1"],
> +  "key": "k1",
> +  "key_length": "3011",
> +  "used_key_parts": ["pk1", "f2", "pk2"],
> +  "rows": 1,
> +  "filtered": 100,
> +  "index_condition": "((t1.f2 <= 5) and (t1.pk2 <= 5) and (t1.pk1 = 
> 'abc'))",
> +  "attached_condition": "(t1.f1 <= '3')"
> +}
> +  }
> +}
> +drop table t1;
>  set optimizer_switch=@save_ext_key_optimizer_switch;
> +set global innodb_file_format = @save_innodb_file_format;
> +set global innodb_large_prefix = @save_innodb_large_prefix;
>  SET SESSION STORAGE_ENGINE=DEFAULT;
> diff --git a/mysql-test/t/innodb_ext_key.test 
> b/mysql-test/t/innodb_ext_key.test
> index bf94b7d..c8acfc5 100644
> --- a/mysql-test/t/innodb_ext_key.test
> +++ b/mysql-test/t/innodb_ext_key.test
> @@ -778,5 +778,56 @@ where index_date_updated= 10 and index_id < 800;
>  
>  drop table t0,t1,t2;
>  
> +
> +--echo #
> +--echo # MDEV-11196: Error:Run-Time Check Failure #2 - Stack around the 
> variable 'key_buff'
> +--echo # was corrupted, server crashes in opt_sum_query
> +
> +set @save_innodb_file_format= @@innodb_file_format;
> +set @save_innodb_large_prefix= @@innodb_large_prefix;
> +set global innodb_file_format = BARRACUDA;
> +set global innodb_large_prefix = ON;
> +
> +CREATE TABLE t1 (
> +  pk INT,
> +  f1 VARCHAR(3),
> +  f2 VARCHAR(1024),
> +  PRIMARY KEY (pk),
> +  KEY(f2)
> +) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
> +
> +INSERT INTO t1 VALUES (1,'foo','abc'),(2,'bar','def');
> +SELECT MAX(t2.pk) FROM t1 t2 INNER JOIN t1 t3 ON t2.f1 = t3.f1 WHERE t2.pk 
> <= 4;
> +drop table t1;
> +
> +CRE