obclient icon indicating copy to clipboard operation
obclient copied to clipboard

键盘输入异常

Open protectione055 opened this issue 2 years ago • 10 comments

系统:Ubuntu 20.04.5 LTS 内核版本:5.15.0-50-generic OceanBase版本:开源3.1.1 obclient版本:Ver Distrib 10.4.18-MariaDB, for Linux (x86_64) using readline 5.1

遇到了和 #8 类似的问题。使用obclient -uxxx@xxx -h127.0.0.1 -P 2881 -c -Doceanbase连接到observer后敲击功能键会输出空格。使用mysql-client测试过以后,并没有发现同样的问题。

protectione055 avatar Nov 14 '22 07:11 protectione055

OS: ubuntu server 22.04.2 OB: OB-server-4.1.0 问题相同,稳定复现 image

kztao avatar Apr 12 '23 02:04 kztao

root@MQBOOK:~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.2 LTS Release: 22.04 Codename: jammy

root@MQBOOK:~# obclient --version obclient Ver Distrib 10.4.18-MariaDB, for Linux (x86_64) using readline 5.1

When obclient is used, the backspace key on the keyboard is abnormal 。 If the mysql client is used, no problem is found. image

meiq4096 avatar May 29 '23 02:05 meiq4096

@kztao @meiq4096 @protectione055 Thanks for your feedback.

The developer is working on this issue, he is try to find out the root cause.

Later he will give us some feedback.

longdafeng avatar May 29 '23 03:05 longdafeng

@unique5945 @longdafeng @meiq4096 @protectione055 @kztao The issue is caused by obclient using the readline library to implement input capability, which depends on the Curses library. However, Curses has different implementations on CentOS and Ubuntu. If the library is dynamically linked, it can work on both CentOS and Ubuntu, but both systems need to have Curses installed. Currently, obclient is statically compiled on CentOS, so running it directly on Ubuntu can cause problems.

kongchengzhuge avatar May 30 '23 12:05 kongchengzhuge

If using dynamically linked, it is likely to bring compatibility issues. How does mysql resolve this problem? @kongchengzhuge

longdafeng avatar May 30 '23 13:05 longdafeng

Is MySQL on Ubuntu installed using a method similar to apt? If so, then this method is similar to compiling on Ubuntu and there should be no issues with dependencies. @longdafeng @meiq4096

kongchengzhuge avatar May 31 '23 01:05 kongchengzhuge

After checking the dependencies of the MySQL package on my local machine, I found that MySQL is dynamically linked.

ldd /usr/bin/mysql linux-vdso.so.1 => (0x00007fff35edf000) /lib/libsysconf-alipay.so (0x00007f6175fc5000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6175d91000) libz.so.1 => /lib64/libz.so.1 (0x00007f6175b7b000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f6175977000) libssl.so.10 => /lib64/libssl.so.10 (0x00007f6175705000) libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f61752a1000) libncurses.so.5 => /lib64/libncurses.so.5 (0x00007f617507a000) libtinfo.so.5 => /lib64/libtinfo.so.5 (0x00007f6174e50000) libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f6174b48000) libm.so.6 => /lib64/libm.so.6 (0x00007f6174846000) libc.so.6 => /lib64/libc.so.6 (0x00007f6174478000) /lib64/ld-linux-x86-64.so.2 (0x00007f617672e000) libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f617422a000) libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f6173f41000) libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f6173d3d000) libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f6173b09000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f61738f3000) libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f61736e2000) libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f61734de000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f61732c4000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f617309c000) libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f6172e3b000)

kongchengzhuge avatar May 31 '23 02:05 kongchengzhuge

root@MQBOOK:~# ldd /usr/bin/mysql
        linux-vdso.so.1 (0x00007fff875f2000)
        libedit.so.2 => /lib/x86_64-linux-gnu/libedit.so.2 (0x00007ff479667000)
        libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007ff479598000)
        libssl.so.3 => /lib/x86_64-linux-gnu/libssl.so.3 (0x00007ff4794f4000)
        libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007ff4790b2000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007ff47909e000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff478e74000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff478e52000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff478c2a000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ff479d53000)
        libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007ff478bf8000)
        libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007ff478be0000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff478af9000)
        libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007ff478aea000)
root@MQBOOK:~#
root@MQBOOK:~# apt list --installed |grep mysql

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

mysql-client-8.0/jammy-security,jammy-updates,now 8.0.33-0ubuntu0.22.04.2 amd64 [installed,automatic]
mysql-client-core-8.0/jammy-security,jammy-updates,now 8.0.33-0ubuntu0.22.04.2 amd64 [installed,automatic]
mysql-client/jammy-security,jammy-updates,now 8.0.33-0ubuntu0.22.04.2 all [installed]
mysql-common/jammy,now 5.8+1.0.8 all [installed,automatic]
root@MQBOOK:~# mysql --version
mysql  Ver 8.0.33-0ubuntu0.22.04.2 for Linux on x86_64 ((Ubuntu))

meiq4096 avatar Jun 05 '23 01:06 meiq4096

@kongchengzhuge @meiq4096 @longdafeng Is there any solution? I need to use obclient on ubuntu22.04/debian11

jiangtao69039 avatar Jan 18 '24 02:01 jiangtao69039

在debian上构建的过程记录了一下, 我自己能成功构建出obclient并且解决了输入异常的问题 https://zhuanlan.zhihu.com/p/678874871

jiangtao69039 avatar Jan 20 '24 08:01 jiangtao69039