This is a server problem (all 4-digit error messages starting with “1” are) . The same error would occur with any client executing the same statement.
Please check this google-result:
http://www.google.dk/search?client=opera&rls=da&q=Error+Code+:+1206+The+total+number+of+locks+exceeds+the+lock+table+size&sourceid=opera&ie=utf-8&oe=utf-8
.. if you find something relevant.
I suggest that you try to
1) execute UNLOCK TABLES
2) (or simpler) restart the server
3) and if server is a version affected by one of the bugs reported in above search upgrade the server. BTW: what is the server version?