zclllyybb commented on PR #58829: URL: https://github.com/apache/doris/pull/58829#issuecomment-3658510411
> > 我怀疑这里的行为差异不是BIN函数的问题,而是mysql的隐式类型转换规则问题。你能否找出源码,确认下mysql直接提供了BIN(varchar)的接口,而非发生varchar->int的类型转换? > > https://github.com/mysql/mysql-server/blob/mysql-8.0.44/sql/item_strfunc.cc#L3035-L3104 > > BIN(N)实际执行的是`CONV(N, 10, 2)`, 从这里 代码看的确是存在类型转换 mysql中会根据第一个参数(`args[0]`)的类型不同有不同的处理, 非 `(args[0]->data_type() == MYSQL_TYPE_BIT || args[0]->type() == VARBIN_ITEM)` 的情况都会先转为longlong Since that is the case, the behavior difference between Doris and MySQL is as expected. Thank you for your work, but Doris' current behavior shouldn't be change~ -- 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]
