Description:
Hello,
I found an error in using the Entity SQL with command 'NOT BETWEEN'
Entity SQL:
---------------------------------
var sql = "SELECT VALUE c FROM OrderSet AS c WHERE field_integer NOT BETWEEN 1 && 20";
var query = context.CreateQuery<Order>(sql, condition.Parameters.ToArray());
MessageBox.Show(query.ToTraceString());
---------------------------------
Output query:
---------------------------------
SELECT ... FROM `order` AS `Extent1` WHERE NOT (`Extent1`.`Id` >= @p0) AND (`Extent1`.`Id` <= @p1)
---------------------------------
See the output, the final query don't contain an groupment negative for the conditional, this code "NOT (A >= @p0) AND (A <= @p1)" leaves negative only first conditional "NOT (A >= @p0)".
Try add more parenthesis in Entity SQL more don't getting effect. The output is same.
var sql = "SELECT VALUE c FROM OrderSet AS c WHERE (field_integer NOT BETWEEN 1 && 20)";
This query has same value, seen an parenthesis groupment the conditional.
My version is:
-> Visual Studio 2008 SP1
-> Connector 6.0.4.0
Tks
How to repeat:
Hello,
I found an error in using the Entity SQL with command 'NOT BETWEEN'
Entity SQL:
---------------------------------
var sql = "SELECT VALUE c FROM OrderSet AS c WHERE field_integer NOT BETWEEN 1 && 20";
var query = context.CreateQuery<Order>(sql, condition.Parameters.ToArray());
MessageBox.Show(query.ToTraceString());
---------------------------------
Output query:
---------------------------------
SELECT ... FROM `order` AS `Extent1` WHERE NOT (`Extent1`.`Id` >= @p0) AND (`Extent1`.`Id` <= @p1)
---------------------------------
See the output, the final query don't contain an groupment negative for the conditional, this code "NOT (A >= @p0) AND (A <= @p1)" leaves negative only first conditional "NOT (A >= @p0)".
Try add more parenthesis in Entity SQL more don't getting effect. The output is same.
var sql = "SELECT VALUE c FROM OrderSet AS c WHERE (field_integer NOT BETWEEN 1 && 20)";
This query has same value, seen an parenthesis groupment the conditional.
My version is:
-> Visual Studio 2008 SP1
-> Connector 6.0.4.0
Tks
Suggested fix:
No idea!