[web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-05-11 Thread 'Awe' via web2py-users
Hello Leonel, opened this Issue on Mar 14, still no one assigned? Regards, Andreas Am Freitag, 9. März 2018 16:55:12 UTC+1 schrieb Leonel Câmara: > > This is definitely a bug, the solution doesn't seem easy, The problem is > that it should not apply the common filters on the alias used on the

[web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-19 Thread 'Awe' via web2py-users
OK, issue filed on: 2018-03-14 Andreas Am Montag, 12. März 2018 09:14:22 UTC+1 schrieb Awe: > > Hello Leonel, > thanks for analyzing. Will open issue today. > Andreas > > Am Freitag, 9. März 2018 16:55:12 UTC+1 schrieb Leonel Câmara: >> >> This is definitely a bug, the solution doesn't seem easy,

[web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-12 Thread 'Awe' via web2py-users
Hello Leonel, thanks for analyzing. Will open issue today. Andreas Am Freitag, 9. März 2018 16:55:12 UTC+1 schrieb Leonel Câmara: > > This is definitely a bug, the solution doesn't seem easy, The problem is > that it should not apply the common filters on the alias used on the left > join again

[web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-09 Thread Leonel Câmara
This is definitely a bug, the solution doesn't seem easy, The problem is that it should not apply the common filters on the alias used on the left join again as they are already applied on the left join ON query itself. Please file an issue here: https://github.com/web2py/pydal/issues --

[web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-09 Thread 'Awe' via web2py-users
Hello Anthony, Richard: Here is a link to download a demo app: https://c.gmx.net/@316857413586131071/y6xMeU53Ql2MtJz-wr0-CQ Just install it, on the main page click the link. I just did the input written in the very first post. Additionally I attached a screenshot showing my result. Many thanks

[web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-08 Thread Anthony
On Thursday, March 8, 2018 at 10:28:38 AM UTC-5, Leonel Câmara wrote: > > Record versioning uses a common filter. > > Common filters do not work if you do not provide a query which is what > happens when you do: > > db().select(db.test.ALL) > > You need to do: > > db(db.test.id >

[web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-08 Thread Leonel Câmara
Record versioning uses a common filter. Common filters do not work if you do not provide a query which is what happens when you do: db().select(db.test.ALL) You need to do: db(db.test.id > 0).select(db.test.ALL) And then it will work. Note that the calling the DAL without a query shortcut

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-08 Thread 'Awe' via web2py-users
You wrote: In [4]: query = (test2.type_marker=='object') | (test2.type_marker==None) & (test1.type_marker=='person') ...: In [5]: db().select(db.test.ALL) Out[5]: So in [5] you did not use the query definition, its db() AND the result is 3 Rows, it should be 2! Thats why I asked for the

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread Richard Vézina
That why I think you wrongly initialize you db in the first place while onboarding the record versioning feature... Please try on your side to create new app drop the model and fixture I include in one of my last email and start web2py shell and launch the various commands of yours... You should

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread Richard Vézina
In [4]: query = (test2.type_marker=='object') | (test2.type_marker==None) & (test1.type_marker=='person') ...: In [5]: db().select(db.test.ALL) Out[5]: I did there... Same result... That my point... On Wed, Mar 7, 2018 at 1:47 PM, 'Awe' via web2py-users < web2py@googlegroups.com> wrote:

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread 'Awe' via web2py-users
Hello Richard, you are right, the use case is parent child relation. All I want to point out is if you use this query: "query = (test2.type_marker=='object') | (test2.type_marker==None) & (test1.type_marker=='person')" you do not get the same result with record versioning enabled or disabled.

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread Richard Vézina
I don't get it, I don't understand what is the issue... I just demonstrate that with and without record versioning DAL returns the same set of result which what it should be doing no?? So my understanding of the issue is that you don't get the same query output when record versioning is on and

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread 'Awe' via web2py-users
Hello Richard, have read your post 3 times, but I can't find the right query result. Could you tell me where to find in your test the query which leads to: test1.titletest2.title PeterNone PaulLaptop Thank you. Am Mittwoch, 7. März 2018 17:33:33 UTC+1 schrieb

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread Richard Vézina
Here some tests : *WITH record versioning* In [1]: db(db.test.id < 0).select() Out[1]: In [2]: db(db.test.id > 0).select() Out[2]: In [3]: test1 = db.test.with_alias('test1') In [4]: test2 = db.test.with_alias('test2') In [5]: query = (test2.type_marker=='object') |

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-07 Thread 'Awe' via web2py-users
Great, many thanks for testing it. Andreas Am Dienstag, 6. März 2018 22:30:59 UTC+1 schrieb Richard: > > Can you make a model definition with a fixture for loading the table, I > will make some test with trunk and various version to determine if it a > regression... Nevermind I just thought you

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-06 Thread Richard Vézina
Can you make a model definition with a fixture for loading the table, I will make some test with trunk and various version to determine if it a regression... Nevermind I just thought you provide that in the first email... Let me have a look at that... Richard On Mon, Mar 5, 2018 at 2:02 PM,

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-05 Thread 'Awe' via web2py-users
Hello Richard, it is not a problem of deleted or changed records. As shown in the example, there is the table and versioning defined. After that 3 records are inserted and then the query is executed. The defined query: query = (test2.type_marker=='object') | (test2.type_marker==None) &

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-05 Thread Richard Vézina
Did you set the actual record that have been deleted to is_active = False?? Or all the records that haven't be deleted yet to TRUE?? You have to go in your backend and do an update there UPDATE stored_item SET is_active = TRUE WHERE is_active IS NULL If you didn't delete any record

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-04 Thread 'Awe' via web2py-users
Hello Richard, many thanks for analyzing. Everything you wrote is completely right. But I still do not understand the behaviour explained before. If you look at the table posted before, all is_acitve Flags are TRUE. to get the result I need, I have defined: query =

Re: [web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-02 Thread Richard Vézina
Hmmm... I think that if you have record versioning activated there shouldn't be any is_active row(s) with NULL value... I mean is_active flag is used to determine if the record in the "parent" table has been deleted or not, since you can truely deleted in case you use record versioning feature as

[web2py] Re: Unexpected behaviour executing a query with DAL and record versioning enabled

2018-03-02 Thread 'Awe' via web2py-users
So, I did check it again: It seems that DAL is not able to handle a left join using ISNULL condition in combination with enabled record versioning. There are two "is active" checks within the left join: OK The next two upcoming ANDs to check "is_active" are not necessary and actually prohibit