[Maria-developers] (no subject)
Hello mariaDB developers! I am a participant of GSOC 2020 mentored by Nikita Malyavin and Sergey Golubchik. Currently I am working on mysqltest parser improvements and I have a question to discuss with everyone: To be short: Currently there are expressions in if and while to be calculated i.e if(<expr>) code But it is written using switch and works only in condition block. Code like: let $a= 1 + 2 Makes $a = "1 + 2" Obviously mysqltest syntax needs proper expressions thats why I decided to make them. There are following questions: What syntax do you want to see? let $a = 1 + 2 $a = 3 Is a bad idea because we will break lots of previous taest cases. let $a = $((1 + 2)) That is done in a bash style, so it seems to be more comfortable to everyone. Another question is what operators should be in expressions? To begin with I want to implement: +, -. *, /, ++, --, <, >, ==, != To implement expressions I want to use Byson to make it easier to rewrite parser if needed I would be glad to read feedback and critique. ------------------------------ GSOC2020 participant Balashenko Igor
Игорь, salute!
Hello mariaDB developers!
It's so nice to have someone willing to revive mysqltest :-)!
I am a participant of GSOC 2020 mentored by Nikita Malyavin and Sergey Golubchik. Currently I am working on mysqltest parser improvements and I have a question to discuss with everyone:
To be short:
Currently there are expressions in if and while to be calculated i.e
if(<expr>) code But it is written using switch and works only in condition block.
Code like:
let $a= 1 + 2 Makes $a = "1 + 2"
Obviously mysqltest syntax needs proper expressions thats why I decided to make them. There are following questions:
What syntax do you want to see?
let $a = 1 + 2 $a = 3 Is a bad idea because we will break lots of previous taest cases.
let $a = $((1 + 2)) That is done in a bash style, so it seems to be more comfortable to everyone.
Alternatively to $(()) - let $a = `1 + 2` or even $a = 1 + 2 the let-free form that may allow for simplifying the rhs to be also free from and evaluation hints/operators. We don't have the let-free assignment as of current, so this seems possible and new tests (writers :-)) would obviously prefer that.
Another question is what operators should be in expressions? To begin with I want to implement:
+, -. *, /, ++, --, <, >, ==, !=
`%' - the reminder is very popular. `/' I read would result in a quotient (the whole part of devision).
To implement expressions I want to use Byson to make it easier to rewrite parser if needed
I would be glad to read feedback and critique.
That *will* be coming ! :-) Cheers, Andrei Elkin, Replication
Hi, Игорь! On Jun 12, Игорь Балашенко wrote:
Hello mariaDB developers! I am a participant of GSOC 2020 mentored by Nikita Malyavin and Sergey Golubchik. Currently I am working on mysqltest parser improvements and I have a question to discuss with everyone:
To be short:
Currently there are expressions in if and while to be calculated i.e
if(<expr>) code But it is written using switch and works only in condition block.
and it only supports the form of "var OP const" where OP is a comparison operator.
Code like:
let $a= 1 + 2 Makes $a = "1 + 2"
Obviously mysqltest syntax needs proper expressions thats why I decided to make them. There are following questions:
What syntax do you want to see?
let $a = 1 + 2 $a = 3 Is a bad idea because we will break lots of previous taest cases.
On the other hand, they just need to be fixed once. Old behavior is quite unexpected and confusing. I think the result will be easier to use if let will just work as one intuitively expects.
let $a = $((1 + 2)) That is done in a bash style, so it seems to be more comfortable to everyone.
Also there's an approach that MySQL took: expr $a = 1 + 2 we don't have to be compatible with MySQL on the mysqltest language, still it's an option to consider.
Another question is what operators should be in expressions? To begin with I want to implement:
+, -. *, /, ++, --, <, >, ==, !=
if/while support ==, !=, <, <=, >, >= so you have to do at least those. And then, yes, math, +, -, *, /, %. increment/decrement are less useful, may be do them later? Don't forget query_get_value(), it's an existing "function", should still be supported. I'd like to see more string functions, but let's start from simple math. Regards, Sergei VP of MariaDB Server Engineering and security@mariadb.org
participants (3)
-
andrei.elkin@pp.inet.fi
-
Sergei Golubchik
-
Игорь Балашенко