| 3266 | */ |
| 3267 | |
| 3268 | bool tdc_open_view(THD *thd, TABLE_LIST *table_list, uint flags) |
| 3269 | { |
| 3270 | TABLE not_used; |
| 3271 | TABLE_SHARE *share; |
| 3272 | bool err= TRUE; |
| 3273 | |
| 3274 | if (!(share= tdc_acquire_share(thd, table_list, GTS_VIEW))) |
| 3275 | return TRUE; |
| 3276 | |
| 3277 | DBUG_ASSERT(share->is_view); |
| 3278 | |
| 3279 | err= mysql_make_view(thd, share, table_list, (flags & OPEN_VIEW_NO_PARSE)); |
| 3280 | |
| 3281 | if (!err && (flags & CHECK_METADATA_VERSION)) |
| 3282 | { |
| 3283 | /* |
| 3284 | Check TABLE_SHARE-version of view only if we have been instructed to do |
| 3285 | so. We do not need to check the version if we're executing CREATE VIEW or |
| 3286 | ALTER VIEW statements. |
| 3287 | |
| 3288 | In the future, this functionality should be moved out from |
| 3289 | tdc_open_view(), and tdc_open_view() should became a part of a clean |
| 3290 | table-definition-cache interface. |
| 3291 | */ |
| 3292 | if (check_and_update_table_version(thd, table_list, share)) |
| 3293 | goto ret; |
| 3294 | } |
| 3295 | |
| 3296 | ret: |
| 3297 | tdc_release_share(share); |
| 3298 | |
| 3299 | return err; |
| 3300 | } |
| 3301 | |
| 3302 | |
| 3303 | /** |
no test coverage detected