How does \Magento\Framework\DB\Adapter\Pdo\Mysql::getCheckSql() work?

Context: How does \Magento\Catalog\Model\ResourceModel\Product\Gallery::createBaseLoadSelect() work?