detect add to table beyond MAX_TABLE_SIZE

Change-Id: I9b1357e583620c59898cd7a649a5b39a6d7e3739
(cherry picked from commit e326b5e06d74685b1853d61c465e5be0b5bf1595)
(cherry picked from commit 4e2c5ffa89b77e4d6b0a1dc964d330d2ae3636d6)