RTTS: A Replicated Temporary Table Strategy for Resolving Temporary Table Reopening Failures in MySQL 5.7 Academic Registration Systems
DOI:
https://doi.org/10.65405/الكلمات المفتاحية:
MySQL 5.7, Temporary Tables, Stored Procedures, Academic Registration Systems, Query Optimization, Database Reliability, RTTSالملخص
Academic registration systems frequently rely on stored procedures to process prerequisite validation, course eligibility assessment, academic restrictions, and concurrent student enrollment operations. In legacy MySQL environments, particularly MySQL 5.7, temporary tables are commonly used to simplify intermediate query processing. However, MySQL exhibits documented limitations related to reopening temporary tables when the same temporary dataset is accessed through multiple execution paths, nested subqueries, or complex join structures. These limitations often generate runtime errors such as “Can't reopen table” and “Table doesn't exist,” causing registration procedures to fail. This paper presents a real-world case study based on the GetAvailableCourses procedure implemented within an academic registration system serving 1,833 students and maintaining 165,282 historical academic records spanning multiple student cohorts from the 1990s to the present.
The study analyzes the root causes of temporary table reopening failures and proposes a Replicated Temporary Table Strategy (RTTS), in which synchronized temporary table replicas are created and assigned to independent execution paths. Experimental deployment within a production environment running MySQL 5.7.44 eliminated observed reopening failures while preserving existing business logic. The results demonstrate improved execution stability, maintainability, and reliability in academic registration workflows.
التنزيلات
المراجع
Oracle MySQL Bug #12198. Temporary Table Aliasing does not work inside stored procedure.
Oracle MySQL Bug #72318. Can't reopen temporary table with aliases in stored routines.
Schwartz, B., Zaitsev, P., & Tkachenko, V. High Performance MySQL. O’Reilly.
Winand, M. SQL Performance Explained.
Silberschatz, A., Korth, H., & Sudarshan, S. Database System Concepts.
Gray, J., & Reuter, A. Transaction Processing: Concepts and Techniques.
Oracle Corporation. MySQL 5.7 Reference Manual.
Connolly, T., & Begg, C. Database Systems: A Practical Approach to Design, Implementation, and Management.
Ramakrishnan, R., & Gehrke, J. Database Management Systems.
Date, C. J. An Introduction to Database Systems.










