Hi Sergei!

This email is a followup to the brief discussion on Zulip here:

https://mariadb.zulipchat.com/#narrow/stream/118759-general/topic/preserve.20original.20formatting.20for.20views

You mentioned we store the view's definition (source) inside the FRM. I've used that information to extend the I_S.views table with a source column. The patch is very small, but I have 2 questions:
1. Is this how the feature should look like? I wonder if we should prepend create view <view-name> to the SOURCE column, to make it behave very similar to SHOW CREATE VIEW. Perhaps SOURCE as a column name is not the most well chosen name.
2. I don't know if I should use:
      table->field[11]->store(tables->source.str, tables->source.length,
                              tables->view_creation_ctx->get_client_cs());

or
      table->field[11]->store(tables->source.str, tables->source.length,
                              cs);


when storing the source data.

Here is the patch:
https://github.com/MariaDB/server/compare/10.6-mdev-10825

As soon as we agree on the complete specs for the feature, I'll clean up test failures in other tests, etc.

Vicențiu