15:45 — Started working from a cafe. This computer has windows and no debugger so I can only look at the code and make few changes.
15:27 — Trying to apply patch to 10.5 using git apply but it's giving out error 'trailing whitespace' I'll just apply it manually and make a commit and wait for power to come back. [It's super hot here :( ]
16:20 — Still power is not back. I have commited the code to a new branch 'derived-update' and I have been studying these changes.
- !thd->lex->can_not_use_merged() &&
+ (!thd->lex->can_not_use_merged() || is_derived()) &&
I feel like is_derived() is a redundant check here because init_derived is only
called by derived tables.
I'll back home now and view the changes on my phone until power gets back. (sigh)
17:40 — Power is back! I'll pull changes from the github and compile the server.
17:44 — Started building the server. [Did 'git clean -Xdf' to prevent any unknown errors]
18:13 — Building complete.
18:14 — Trying tests given by Igor.
18:23 — All checks are working fine.
18:25 — In the email Igor said "add corresponding changes for updatable CTEs (find where they are opened) to make them usable for UPDATEs."
When I try cte update I get this:
MariaDB [test]> with cte as (select * from t1) update cte set a=14; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'update cte set a=14' at line 1
I think this one is already fixed by me in an earlier commit. Let me try to add those changes again.
18:35 — Added changes. Going to recompile the server.
18:39 — While server is compiling, Igor asked "Please add views that use updatable CTE and updates/deletes with them."
By views that use updatable CTE, I am thinking of something like this:
create view v as (with cte1 as (select * from t1) select * from cte1);
Let me check if this is possible or not in SQL server:
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cte1 as (select * from t1) select * from cte1)' at line 1"