[MDEV-23001] Precreate static Item_bool() to simplify code Created: 2020-06-24 Updated: 2021-06-01 Resolved: 2021-05-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Fix Version/s: | 10.6.1 |
| Type: | Task | Priority: | Minor |
| Reporter: | Michael Widenius | Assignee: | Michael Widenius |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | beginner-friendly | ||
| Description |
|
cd sql conds= new (thd->mem_root) Item_bool(thd, true); // Always true We also have a few cases like this that should also be replaced (Search for Item_int that is set to a value of 0 or 1): Instead of creating these on the fly, it would be better to have two static Item_bool variables (one true and one false), created statically or at startup, that we could use everywhere. This would make the code smaller and faster Proposed code in item.cc: Item_bool_static Item_false("FALSE", 0); The main difference between the above and a normal item is that the above would not take THD as an argument and thus the Item's should not be put on the item list in THD. Suggestion how to start:
|
| Comments |
| Comment by Dan Solodko [ 2020-07-06 ] |
|
https://github.com/MariaDB/server/pull/1619 waiting for review |