cai-jinlin commented on issue #58441:
URL: https://github.com/apache/doris/issues/58441#issuecomment-3641923661

   // 添加数据库引用恢复逻辑
   Status ExternalTable::read_fields(DataInput* in) {
       // 先调用父类方法
       Table::read_fields(in);
     
       // 读取数据库ID
       int64_t db_id;
       in->read_int64(&db_id);
       
       // 核心修复:根据ID找到Database并设置引用
       if (db_id != -1) {
           _db = Catalog::instance()->get_db(db_id);
           if (_db == nullptr) {
               LOG(WARNING) << "Cannot find db " << db_id << " for table " << 
_name;
           }
       }
       // 继续读取其他数据...
       return Status::OK();
   }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to