1 # Routine to be called by t/view.inc
3 # The variable $after_select must be set before calling this routine.
5 eval CREATE VIEW v1 AS SELECT $after_select;
6 SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA =
'test' AND TABLE_NAME =
'v1';
8 # Extract the VIEW's SELECT from INFORMATION_SCHEMA.VIEWS
9 let $query1 = `SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA =
'test' AND TABLE_NAME =
'v1'`;
11 # Extract the VIEW's SELECT from SHOW CREATE VIEW
13 # View Create View character_set_client collation_connection
14 # v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select '<--- .....
15 let $value= query_get_value(SHOW CREATE VIEW v1, Create View, 1);
16 let $query2 = `SELECT SUBSTR(
"$value",INSTR(
"$value",
' as select ') + CHAR_LENGTH(
' as '))`;
19 # Recreate the view based on SELECT from INFORMATION_SCHEMA.VIEWS
20 eval CREATE VIEW v1 AS $query1;
22 # Recreate the view based on SHOW CREATE VIEW
23 eval CREATE VIEW v1 AS $query2;