Start the "Blind Toss series", this series is purely blind toss, may have no practical significance.
MySQL Stored Procedure generation table:
Create a new user table that contains the ID, username, password, usertable fields.
Then create the stored procedure:
Create PROCEDUREcreate_table ()BEGINDECLARENint DEFAULT 0;DECLARET_errorINTEGER DEFAULT 0; DECLARE CONTINUEHANDLER forSQLEXCEPTIONSETT_error=1; Temp_loop:loopstartTRANSACTION; SET @m=Replace(UUID (),'-',"');Set @str=Concat'CREATE TABLE x',@m,'(id int)');Preparestmt from @str;EXECUTEstmt;Set @insertstr=Concat'INSERT INTO User (username,password,usertable) VALUES ("Test", "TESTP", "x',@m,'")');PrepareStmt1 from @insertstr;EXECUTESTMT1;IFT_error= 1 Then ROLLBACK; ELSE COMMIT; END IF; SetN=N+1;IFN>= - ThenLEAVE Temp_loop;END IF;ENDLOOP;END
Get the UUID through the UUID () and then remove the-line, and then add an X to the front, why add X, because the table name directly with the UUID will sometimes error, specific reasons unknown.
Then generate the Username,password, and then insert the resulting table name into the Usertable field.
Execute a stored procedure by using call Creat_table ().