The exec() method is defined in libs/Zend/Db/Adapter/Pdo/Abstract.php which is subclassed by libs/Zend/Db/Adapter/Pdo/Mysql.php which is subclassed by core/Db/Pdo/Mysql.php (aka Piwik_Db_Pdo_Mysql).
What PHP version are you using? Are you hosting another copy of Zend Framework?