Tidb: Add remaining miscellaneous functions

Created on 25 Nov 2018  路  8Comments  路  Source: pingcap/tidb

Remaining Misc functions from MySQL 5.7:

  • [x] ANY_VALUE() Suppress ONLY_FULL_GROUP_BY value rejection (fixed in #9255)
  • [x] DEFAULT() Return the default value for a table column Fixed in https://github.com/pingcap/tidb/pull/8540 @bb7133
  • [x] INET_ATON() Return the numeric value of an IP address
  • [x] INET_NTOA() Return the IP address from a numeric value
  • [x] INET6_ATON() Return the numeric value of an IPv6 address
  • [x] INET6_NTOA() Return the IPv6 address from a numeric value
  • [x] IS_IPV4() Whether argument is an IPv4 address
  • [x] IS_IPV4_COMPAT() Whether argument is an IPv4-compatible address
  • [x] IS_IPV4_MAPPED() Whether argument is an IPv4-mapped address
  • [x] IS_IPV6() Whether argument is an IPv6 address
  • [x] MASTER_POS_WAIT() Block until the slave has read and applied all updates up to the specified position (can't really add: not applicable to TiDB).
  • [x] NAME_CONST() Causes the column to have the given name #9261
  • [x] RAND() Return a random floating-point value
  • [x] SLEEP() Sleep for a number of seconds
  • [x] UUID() Return a Universal Unique Identifier (UUID)
  • [ ] UUID_SHORT() Return an integer-valued universal identifier https://github.com/pingcap/tidb/issues/4620
  • [x] VALUES() Defines the values to be used during an INSERT
statuhelp-wanted typcompatibility

Most helpful comment

Hi @morgo , name_const is supported in #9261

All 8 comments

Hi @morgo , DEFAULT() will be fixed in https://github.com/pingcap/tidb/pull/8540, thanks

Thank you! I will check it off when it merges.

The any_value issue is fixed in #9255

Thanks! I'll check it off as it merges.

Hi @morgo , name_const is supported in #9261

I am going to close this tracking issue now:

  • NAME_CONST() has a PR open, and will likely merge soon.
  • UUID_SHORT() will be difficult to add since it requires a short server_id-like concept (and we can leave https://github.com/pingcap/tidb/issues/4620 open to track it).

Hi @morgo, is it nice to have a no-op implementation of MASTER_POS_WAIT?

Yes, it's similar to get_lock (unsafe to noop by default, but could be enabled with tidb_enable_noop_functions). I don't think it's high priority though - get_lock is used by packaged applications (it was added so Rails migrations would work). Packaged applications tend not to expect replication, so I have not seen anything use MASTER_POS_WAIT.

Was this page helpful?
0 / 5 - 0 ratings