public function query($query)
    {
        $this->errorInfo = null;
        $this->errorCode = null;
        $query = trim(strtolower($query));
        if ($query === 'show tables') {
            $data = array();
            foreach ($this->tables as $k => $table) {
                $data[] = array('name' => $k);
            }
            return new Cursor($data);
        }
        $this->errorInfo = 'Invalid query';
        $this->errorCode = self::ERROR_QUERY;
    }