← Back to team overview

maria-developers team mailing list archive

Re: MDEV-10142 - bb-10.2-compatibility


Hello Alexander,
I built a patch for concat of strings and nulls when sql_mode=oracle.
Can you review it ?

Best regards,

-----Message d'origine-----
De : Alexander Barkov [mailto:bar@xxxxxxxxxxx] 
Envoyé : mardi 20 décembre 2016 03:40
À : jerome brauge; MariaDB Developers
Objet : Re: MDEV-10142 - bb-10.2-compatibility

Hello Jerome,

On 12/19/2016 05:16 PM, jerome brauge wrote:
> Hello,
> To build this branch on windows (Visual Studio Express 2015), I have to add "#pragma warning( disable : 4099 )" in sql_lex.h.
> But I don't know if it's the right solution.

What happened without #pragma?

> I have some questions:
>  - I read the comment of Michael Widenius on subtask MDEV-10574.
>    I think that it's important to change behavior of string functions whose returns a string (like rtrim, ltrim, substring, concat, ...) to return null instead of ''. 
>    Without this, we have to use UDF instead native functions and it's never good from a performance point of view.
>    Have you made a decision ?

The current plan is to do these transformations:

1. Transform Insert
- insert values ("") -> insert values (null)

2. Transform Select

- where v=x => (v <> "" and V=X)
- where v is null => (v="" or v is null)

We didn't plan to change functions yet. Thanks for bringing this up.
We'll discuss this.

> - On Oracle, we can easily disable/enable triggers. I found an old request for this on jira : MDEV-7579. As you already manage order_action now, perhaps you can simply use negative orders to indicate disabled triggers.

Thanks. We'll also discuss this.
I'll let you know a few days later.

> - do you have planning to implement operator || to concat strings ? 

This feature is available since early MySQL versions, just to make sure to set sql_mode:

> MariaDB [test]> SET sql_mode=ORACLE;
> Query OK, 0 rows affected (0.00 sec)
> MariaDB [test]> SELECT 'a'||'b';
> +----------+
> | 'a'||'b' |
> +----------+
> | ab       |
> +----------+
> 1 row in set (0.00 sec)
> Best regards,
> J. Brauge

Attachment: 0001-Adding-sql_mode-CONCAT_NULL_YIELDS_NULL_OFF-which-is.patch
Description: 0001-Adding-sql_mode-CONCAT_NULL_YIELDS_NULL_OFF-which-is.patch

Follow ups