Wednesday, February 2, 2011

MySQL Temporary Table Bug ERROR #1137

Apparently you can not reference two temporary tables in 5.1 using a simple join.

I was trying to create test environment based on my tables so that I could have a place to advance on this stored routine. The MEMORY storage engine provided me the comfort of performance and the fact that anything temporary you create will be destroyed at the end of your session. No DROP TABLES command is necessary. Perfect place for my test environment, I would not have touch my live data held within two tables.

So, I made a stored procedure to handle the creation and insert of the both of them. When I tried to join the two temps using my query with an INNER JOIN it gave my the error:
ERROR #1137. Can't reopen 'temp_ta'.

That got so frustrating after seeing it several times. So, I had to create the two out of the heap. Modify and continue with the creation of stored routines.

MySQL needs to fix this bug in its latest releases. Thank you community of open source developers.

2 comments:

  1. Hi,
    your blog is looking good to me.
    but google ads make me annoy.
    anyways, keep it up and share technical notes with technical people.
    i like your welcome sentence.

    ReplyDelete
  2. Thanks for the feedback Syed. I'll take it into consideration.

    ReplyDelete

Please leave me a few lines and tell me what you think.