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

shell client control sequences not working (xterm, kde konsole)

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0.14
    • Fix Version/s: 10.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      openSUSE 13.1

      Description

      I recently updated to version 10.0.14 from 10.0.11 (using the openSUSE database build service) and in 10.0.14, the shell client no longer accepts control sequences like control+r (search in history) or control+left/right (move cursor one word to the left/right). In case of control+r nothing happens, pressing control+left/right prints ';5D' / ';5C' instead of moving the cursor.

      Control sequences work fine in 10.0.11. Also, after downgrading to 10.0.11 and using the up key to browser through the command history spaces are replaced by \040 for commands entered in the 10.0.14 shell client.

      This happens in both KDE's konsole and plain xterm using BASH as shell (I haven't tested other terminals).

      I have libreadline version 6.2 installed (libreadline6-6.2-68.12.1.x86_64), not sure if this is relevant or what else to report.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Hi,

            I'm getting different results, but it might depend on the compilation settings and environment. (I've built both versions with simple cmake && make, on the same openSUSE 13.1, and on both versions Ctrl-R works and Ctrl+left/right doesn't).

            When you downgraded to 10.0.11, did you rebuild it again, or did you use the previously built binaries?

            Could you please paste the output of ldd <path to mysql> for both versions, and INFO_BIN and INFO_SRC files from both builds? When it's built in-source, the files reside in <basedir>/Docs, but I'm not sure where they end up with your build/install setup.

            Show
            elenst Elena Stepanova added a comment - Hi, I'm getting different results, but it might depend on the compilation settings and environment. (I've built both versions with simple cmake && make, on the same openSUSE 13.1, and on both versions Ctrl-R works and Ctrl+left/right doesn't). When you downgraded to 10.0.11, did you rebuild it again, or did you use the previously built binaries? Could you please paste the output of ldd <path to mysql> for both versions, and INFO_BIN and INFO_SRC files from both builds? When it's built in-source, the files reside in <basedir>/Docs, but I'm not sure where they end up with your build/install setup.
            Hide
            serg Sergei Golubchik added a comment -

            I've seen it (someone complained on IRC and then we've figured it out). Your build uses libedit, not readline. That's why you get \040 in the history and that's why control sequences don't work.

            Our readline.cmake file works like this: first it tries to use system readline. Your have readline version 6.2 — but readline6 is GPLv3, which is not compatible with GPLv2. So we can only use readline5, not readline6. If no usable system readline was found, readline.cmake tries to use system libedit. And if that doesn't work, it resorts to bundled readline.

            In 10.0.14 we've fixed libedit detection in our cmake files (it was broken, because of typos the readline.cmake file it never worked).

            That's why certain builds that were using bundled readline before now use system libedit.

            If you build yourself and want to use readline — make sure you either have readline5 installed or don't have libedit installed. Or run cmake with -DNOT_FOR_DISTRIBUTION=1, that will link with readline6, but you won't be able to distribute the resulting binary, it won't be GPL anymore.

            Show
            serg Sergei Golubchik added a comment - I've seen it (someone complained on IRC and then we've figured it out). Your build uses libedit, not readline. That's why you get \040 in the history and that's why control sequences don't work. Our readline.cmake file works like this: first it tries to use system readline. Your have readline version 6.2 — but readline6 is GPLv3, which is not compatible with GPLv2. So we can only use readline5, not readline6. If no usable system readline was found, readline.cmake tries to use system libedit. And if that doesn't work, it resorts to bundled readline. In 10.0.14 we've fixed libedit detection in our cmake files (it was broken, because of typos the readline.cmake file it never worked). That's why certain builds that were using bundled readline before now use system libedit. If you build yourself and want to use readline — make sure you either have readline5 installed or don't have libedit installed. Or run cmake with -DNOT_FOR_DISTRIBUTION=1, that will link with readline6, but you won't be able to distribute the resulting binary, it won't be GPL anymore.
            Hide
            Christian Christian Quast added a comment -

            thanks a lot for the quick and detailed response.

            openSUSE 13.1 still offers libreadline 5 which is co-installable with libreadline 6 (at least the lib, not the headers). I guess, I am going to report this to the package maintainers over at the openSUSE build service.

            The OBS offers two sets of packages installing mariadb and its clients. The 'default' mariadb* packages install 10.0.14 and the mariadb_100* packages install 10.0.11. I didn't find any information why they offer two sets of packages but maybe it's related to this problem?

            thanks again.

            Show
            Christian Christian Quast added a comment - thanks a lot for the quick and detailed response. openSUSE 13.1 still offers libreadline 5 which is co-installable with libreadline 6 (at least the lib, not the headers). I guess, I am going to report this to the package maintainers over at the openSUSE build service. The OBS offers two sets of packages installing mariadb and its clients. The 'default' mariadb* packages install 10.0.14 and the mariadb_100* packages install 10.0.11. I didn't find any information why they offer two sets of packages but maybe it's related to this problem? thanks again.
            Hide
            elenst Elena Stepanova added a comment -

            So, I've tried three variants on openSUSE 13.1 with 10.0.11 and 10.0.14

              10.0.11 10.0.14
            no readline5, no libedit builds with bundled, Ctrl+R works, Ctrl+left/right don't builds with bundled, Ctrl+R works, Ctrl+left/right don't
            no readline5, libedit builds with bundled, Ctrl+R works, Ctrl+left/right don't links with libedit, Ctrl+R and Ctrl+left/right don't work
            readline5-devel links with readline, Ctrl+R and Ctrl+left/right work links with readline, Ctrl+R and Ctrl+left/right work

            I also observed the history problems after switching from readline to libedit and back.

            So, the way you described the current behavior is consistent with 10.0.14 linked with libedit; but if Ctrl+left/right worked with your 10.0.11, it seems you actually had readline5 at that point?
            On the other hand, you mentioned that you reverted to 10.0.11, and apparently it works again?
            That's why I'm still curious about your INFO_BIN and ldd mysql on both versions, if you don't mind.

            Side observations for Sergei Golubchik's consideration:

            • as we already briefly discussed, I think it would be good to have some indication in cmake configuration when it resorts to using the bundled readline – now it doesn't set WITH_READLINE, even though the option means exactly that. It becomes especially confusing when there is readline6 in the system – cmake finds it, sets READLINE_LIBRARY and such, but doesn't use it at the end.
            • it's somewhat strange that Ctrl-left/right work with the system readline but don't work with the bundled one, is it expected?
            Show
            elenst Elena Stepanova added a comment - So, I've tried three variants on openSUSE 13.1 with 10.0.11 and 10.0.14   10.0.11 10.0.14 no readline5, no libedit builds with bundled, Ctrl+R works, Ctrl+left/right don't builds with bundled, Ctrl+R works, Ctrl+left/right don't no readline5, libedit builds with bundled, Ctrl+R works, Ctrl+left/right don't links with libedit, Ctrl+R and Ctrl+left/right don't work readline5-devel links with readline, Ctrl+R and Ctrl+left/right work links with readline, Ctrl+R and Ctrl+left/right work I also observed the history problems after switching from readline to libedit and back. So, the way you described the current behavior is consistent with 10.0.14 linked with libedit; but if Ctrl+left/right worked with your 10.0.11, it seems you actually had readline5 at that point? On the other hand, you mentioned that you reverted to 10.0.11, and apparently it works again? That's why I'm still curious about your INFO_BIN and ldd mysql on both versions, if you don't mind. Side observations for Sergei Golubchik 's consideration: as we already briefly discussed, I think it would be good to have some indication in cmake configuration when it resorts to using the bundled readline – now it doesn't set WITH_READLINE, even though the option means exactly that. It becomes especially confusing when there is readline6 in the system – cmake finds it, sets READLINE_LIBRARY and such, but doesn't use it at the end. it's somewhat strange that Ctrl-left/right work with the system readline but don't work with the bundled one, is it expected?
            Hide
            Christian Christian Quast added a comment -

            Unfortunately, I cannot provide the build information as I installed the RPM packages provided by the Database OBS. I don't know much about OBS or building rpm packages in general but what I could find is the file build.incl which seems to contain build instructions. As far as I can tell it supports both building MySQL using auto tools and using cmake. In the cmake part I see

            ...
            -DWITH_READLINE=0                                            \
            -DWITH_LIBEDIT=0                                             
            ...
            

            However, this hasn't changed between the mariadb_100 and maridb. In fact, the files are identical.

            The results running of ldd (I guess the mariadb_100 build uses the bundled libreadline 5, openSUSE 13.1 installs version 6 by default as I only installed libreadline5 manually after I opened this report) :

            mariadb_100-client-10.0.11-5.3.x86_64
            $ ldd /usr/bin/mysql
                    linux-vdso.so.1 (0x00007fff683fe000)
                    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6529bd5000)
                    libncurses.so.5 => /lib64/libncurses.so.5 (0x00007f65299ae000)
                    libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f652977a000)
                    libz.so.1 => /lib64/libz.so.1 (0x00007f6529564000)
                    libssl.so.1.0.0 => /lib64/libssl.so.1.0.0 (0x00007f65292fd000)
                    libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 (0x00007f6528f12000)
                    libdl.so.2 => /lib64/libdl.so.2 (0x00007f6528d0e000)
                    libm.so.6 => /lib64/libm.so.6 (0x00007f6528a0b000)
                    libc.so.6 => /lib64/libc.so.6 (0x00007f652865d000)
                    /lib64/ld-linux-x86-64.so.2 (0x00007f6529df3000)
            
            mariadb-client-10.0.14-1.1.x86_64
            $ ldd /usr/bin/mysql
                    linux-vdso.so.1 (0x00007fffe6385000)
                    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc83993b000)
                    libedit.so.0 => /usr/lib64/libedit.so.0 (0x00007fc839703000)
                    libncurses.so.5 => /lib64/libncurses.so.5 (0x00007fc8394dc000)
                    libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007fc8392a8000)
                    libz.so.1 => /lib64/libz.so.1 (0x00007fc839092000)
                    libssl.so.1.0.0 => /lib64/libssl.so.1.0.0 (0x00007fc838e2b000)
                    libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 (0x00007fc838a40000)
                    libdl.so.2 => /lib64/libdl.so.2 (0x00007fc83883c000)
                    libm.so.6 => /lib64/libm.so.6 (0x00007fc838539000)
                    libc.so.6 => /lib64/libc.so.6 (0x00007fc83818b000)
                    /lib64/ld-linux-x86-64.so.2 (0x00007fc839b59000)
                    libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007fc837f61000)
            

            I also reported this issue at http://bugzilla.opensuse.org/show_bug.cgi?id=902396

            Show
            Christian Christian Quast added a comment - Unfortunately, I cannot provide the build information as I installed the RPM packages provided by the Database OBS . I don't know much about OBS or building rpm packages in general but what I could find is the file build.incl which seems to contain build instructions. As far as I can tell it supports both building MySQL using auto tools and using cmake. In the cmake part I see ... -DWITH_READLINE=0 \ -DWITH_LIBEDIT=0 ... However, this hasn't changed between the mariadb_100 and maridb. In fact, the files are identical. The results running of ldd (I guess the mariadb_100 build uses the bundled libreadline 5, openSUSE 13.1 installs version 6 by default as I only installed libreadline5 manually after I opened this report) : mariadb_100-client-10.0.11-5.3.x86_64 $ ldd /usr/bin/mysql linux-vdso.so.1 (0x00007fff683fe000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6529bd5000) libncurses.so.5 => /lib64/libncurses.so.5 (0x00007f65299ae000) libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f652977a000) libz.so.1 => /lib64/libz.so.1 (0x00007f6529564000) libssl.so.1.0.0 => /lib64/libssl.so.1.0.0 (0x00007f65292fd000) libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 (0x00007f6528f12000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f6528d0e000) libm.so.6 => /lib64/libm.so.6 (0x00007f6528a0b000) libc.so.6 => /lib64/libc.so.6 (0x00007f652865d000) /lib64/ld-linux-x86-64.so.2 (0x00007f6529df3000) mariadb-client-10.0.14-1.1.x86_64 $ ldd /usr/bin/mysql linux-vdso.so.1 (0x00007fffe6385000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc83993b000) libedit.so.0 => /usr/lib64/libedit.so.0 (0x00007fc839703000) libncurses.so.5 => /lib64/libncurses.so.5 (0x00007fc8394dc000) libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007fc8392a8000) libz.so.1 => /lib64/libz.so.1 (0x00007fc839092000) libssl.so.1.0.0 => /lib64/libssl.so.1.0.0 (0x00007fc838e2b000) libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 (0x00007fc838a40000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fc83883c000) libm.so.6 => /lib64/libm.so.6 (0x00007fc838539000) libc.so.6 => /lib64/libc.so.6 (0x00007fc83818b000) /lib64/ld-linux-x86-64.so.2 (0x00007fc839b59000) libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007fc837f61000) I also reported this issue at http://bugzilla.opensuse.org/show_bug.cgi?id=902396
            Hide
            elenst Elena Stepanova added a comment -

            OK, thanks for the info.

            Apparently openSUSE doesn't include INFO_BIN file into their packages. Anyway, it's not so important.
            So your 10.0.11 was indeed built with the bundled readline, and 10.0.14 with libedit. It explains bad control sequences and history in 10.0.14, but the question why ctrl+left/right work for you and don't work for me remains a mystery. Maybe it's something environmental, which will make it harder to investigate similar complaints in future.

            Sergei Golubchik, if there is nothing to do in the scope of this report, please just close it. I'm leaving it open to consider at least the question about visibility of the choice of bundled library in cmake options, and maybe also documenting available choices and their consequences, if not done yet.

            Show
            elenst Elena Stepanova added a comment - OK, thanks for the info. Apparently openSUSE doesn't include INFO_BIN file into their packages. Anyway, it's not so important. So your 10.0.11 was indeed built with the bundled readline, and 10.0.14 with libedit. It explains bad control sequences and history in 10.0.14, but the question why ctrl+left/right work for you and don't work for me remains a mystery. Maybe it's something environmental, which will make it harder to investigate similar complaints in future. Sergei Golubchik , if there is nothing to do in the scope of this report, please just close it. I'm leaving it open to consider at least the question about visibility of the choice of bundled library in cmake options, and maybe also documenting available choices and their consequences, if not done yet.

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                Christian Christian Quast
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: