Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7419

Function cli_safe_read not exported

Details

    Description

      Function cli_safe_read is very important for custom client software, which do read DB answer. Without this function you can not implement custom slave library:

      https://github.com/dimarik/mysqlslave

      Moreover, some other projects need it, for example Facebook's HipHop:
      http://nareshv.blogspot.in/2011/10/building-facebooks-hiphop-on-fedora-15.html

      It's easy to add cli_safe_read function to export list in libmysql/CMakeLists.txt

      Attachments

        Activity

          okay. I'll export cli_safe_read() and net_field_length(), but rename them to have mysql_ prefix.
          mysql_net_read_packet() and mysql_net_field_length().

          serg Sergei Golubchik added a comment - okay. I'll export cli_safe_read() and net_field_length(), but rename them to have mysql_ prefix. mysql_net_read_packet() and mysql_net_field_length().

          Thanks!

          It is good idea to use prefixes, but how can I detect which function I have?

          Are there any defines to check whether I have to user function with prefix or not?

          pianisteg Alexander Pankov added a comment - Thanks! It is good idea to use prefixes, but how can I detect which function I have? Are there any defines to check whether I have to user function with prefix or not?

          You can do, say

          #if MYSQL_VERSION_ID > 50541 && defined(MARIADB_BASE_VERSION)
          /* MariaDB-5.5.42 or later, with low-level mysql_net_ API */
          #else
          #define mysql_net_read_packet cli_safe_read
          #define mysql_net_field_length net_field_length
          #endif

          serg Sergei Golubchik added a comment - You can do, say #if MYSQL_VERSION_ID > 50541 && defined(MARIADB_BASE_VERSION) /* MariaDB-5.5.42 or later, with low-level mysql_net_ API */ #else #define mysql_net_read_packet cli_safe_read #define mysql_net_field_length net_field_length #endif

          One more question, have you merged thinge to 10.0.x and 10.1.x branches?

          pianisteg Alexander Pankov added a comment - One more question, have you merged thinge to 10.0.x and 10.1.x branches?

          No, I have not. But, of course, I will. This change will be in the next 10.0 release. And in the next 10.1 that follows in the next 10.0 release. That is, in 10.0.17 and 10.1.4

          serg Sergei Golubchik added a comment - No, I have not. But, of course, I will. This change will be in the next 10.0 release. And in the next 10.1 that follows in the next 10.0 release. That is, in 10.0.17 and 10.1.4

          People

            serg Sergei Golubchik
            pianisteg Alexander Pankov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.