[前][次][番号順一覧][スレッド一覧]

mysql:3965

From: Noriyuki Sakimura <Noriyuki Sakimura <sakimura@xxxxxxxxxx>>
Date: Wed, 11 Jul 2001 10:46:44 +0900
Subject: [mysql 03965] 空の BDB テーブル検索で ERROR 1032

崎村です。
先日はBDBのパッチありがとうございました。>村上様
ところがBerkeleyDBでまた不可解な動作をしてしまいました。

 レコードが1件もないBDBタイプのテーブルをSELECTしようとすると
本来は Empty set となるものが、ある条件で ERROR 1032になってしまいます。
 条件は
 ・VARCHARとCHARのカラムが存在するレコード長が可変のBDB型テーブル
 ・テーブルが空の状態
 ・SELECTのWHERE句でCHARカラムに対し不等号'<'を使った絞り込み
を満たすと起こります。

以下採取情報です。
=========================================
環境
=========================================
OS:TurboLinux 6.1
MySQL:3.23.38(mysql-3.23.38.tar.gz) + [mysql 03760]のBDBパッチ
# uname -a
Linux linux01 2.2.18-1 #1 Wed Jan 17 20:25:02 JST 2001 i686 unknown

=========================================
mysqldump
=========================================
# mysqldump --no-data kinmudb TEST
# MySQL dump 8.13
#
# Host: localhost    Database: kinmudb
#--------------------------------------------------------
# Server version        3.23.38

#
# Table structure for table 'TEST'
#

CREATE TABLE TEST (
  STR_DATE varchar(8) NOT NULL default '',
  INFO_NOTE varchar(200) default NULL,
  PRIMARY KEY  (STR_DATE)
) TYPE=BerkeleyDB;

=========================================
実行結果
=========================================
mysql> select INFO_NOTE from TEST where STR_DATE = '20010610';
Empty set (0.00 sec)
mysql> select INFO_NOTE from TEST where STR_DATE < '20010610';   ← NG
ERROR 1032: Can't find record in 'TEST'
mysql> select INFO_NOTE from TEST where STR_DATE <='20010610';   ← NG
ERROR 1032: Can't find record in 'TEST'
mysql> select INFO_NOTE from TEST where STR_DATE >'20010610';
Empty set (0.00 sec)

=========================================
ホスト名.err
=========================================
何も出ません。

=========================================
mysqlbug
=========================================
SEND-PR: -*- send-pr -*-
SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
SEND-PR: will all comments (text enclosed in `<' and `>').
SEND-PR:
From: mysql
To: mysql@xxxxxxxxxx
Subject: [50 character or so descriptive subject here (for reference)]

>Description:
        <precise description of the problem (multiple lines)>
>How-To-Repeat:
        <code/input/activities to reproduce the problem (multiple lines)>
>Fix:
        <how to correct or work around the problem, if known (multiple lines)>

>Submitter-Id:  <submitter ID>
>Originator:
>Organization:
 <organization of PR author (multiple lines)>
>MySQL support: [none | licence | email support | extended email support ]
>Synopsis:      <synopsis of the problem (one line)>
>Severity:      <[ non-critical | serious | critical ] (one line)>
>Priority:      <[ low | medium | high ] (one line)>
>Category:      mysql
>Class:         <[ sw-bug | doc-bug | change-request | support ] (one line)>
>Release:       mysql-3.23.36 (Source distribution)
>Server: /usr/local/bin/mysqladmin  Ver 8.18 Distrib 3.23.36, for pc-linux-gnu on i686
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version          3.23.38
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /tmp/mysql.sock
Uptime:                 1 hour 20 sec

Threads: 5  Questions: 1708  Slow queries: 0  Opens: 43  Flush tables: 1  Open tables: 27 Queries per second avg: 0.472
>Environment:
        <machine, os, target, libraries (multiple lines)>
System: Linux linux01 2.2.18-1 #1 Wed Jan 17 20:25:02 JST 2001 i686 unknown
Architecture: i686

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i586-pc-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release)
Compilation info: CC='gcc'  CFLAGS=''  CXX='c++'  CXXFLAGS=''  LDFLAGS=''
LIBC:
lrwxrwxrwx   1 root     root           13 Mar 15 02:47 /lib/libc.so.6 -> libc-2.1.3.so
-rwxr-xr-x   1 root     root      5341824 Dec 15  2000 /lib/libc-2.1.3.so
-rw-r--r--   1 root     root     20788464 Dec 15  2000 /usr/lib/libc.a
-rw-r--r--   1 root     root          178 Dec 15  2000 /usr/lib/libc.so
Configure command: ./configure  --with-charset=ujis --with-extra-charsets=all --with-mysqld-user=mysql --with-berkeley-db

=========================================
SHOW VARIABLES (行端を加工しました)
=========================================
mysql> SHOW VARIABLES;
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Variable_name                   | Value
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ansi_mode                       | OFF
| back_log                        | 50
| basedir                         | /usr/local/mysql_3.23.38/
| bdb_cache_size                  | 16777216
| bdb_log_buffer_size             | 262144
| bdb_home                        | /usr/local/mysql_3.23.38/var/
| bdb_max_lock                    | 10000
| bdb_logdir                      |
| bdb_shared_data                 | OFF
| bdb_tmpdir                      | /tmp/
| bdb_version                     | Sleepycat Software: Berkeley DB 3.2.9a: (May  9, 2001)
| binlog_cache_size               | 65536
| character_set                   | ujis
| character_sets                  | ujis big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin1 latin2 latin5 swe7 usa7 win1250 win1251 win1251ukr sjis tis620
| concurrent_insert               | ON
| connect_timeout                 | 5
| datadir                         | /usr/local/mysql_3.23.38/var/
| delay_key_write                 | ON
| delayed_insert_limit            | 100
| delayed_insert_timeout          | 300
| delayed_queue_size              | 1000
| flush                           | OFF
| flush_time                      | 0
| have_bdb                        | YES
| have_gemini                     | NO
| have_innodb                     | YES
| have_isam                       | YES
| have_raid                       | NO
| have_ssl                        | NO
| init_file                       |
| innodb_data_file_path           | ibdata1
| innodb_data_home_dir            | /usr/local/mysql_3.23.38/var/
| innodb_flush_log_at_trx_commit  | ON
| innodb_log_arch_dir             | /usr/local/mysql_3.23.38/var/
| innodb_log_archive              | OFF
| innodb_log_group_home_dir       | /usr/local/mysql_3.23.38/var/
| interactive_timeout             | 28800
| join_buffer_size                | 258048
| key_buffer_size                 | 16773120
| language                        | /usr/local/mysql_3.23.38/share/mysql/english/
| large_files_support             | ON
| locked_in_memory                | OFF
| log                             | OFF
| log_update                      | OFF
| log_bin                         | OFF
| log_slave_updates               | OFF
| long_query_time                 | 10
| low_priority_updates            | OFF
| lower_case_table_names          | 0
| max_allowed_packet              | 1048576
| max_binlog_cache_size           | 4294967295
| max_binlog_size                 | 1073741824
| max_connections                 | 100
| max_connect_errors              | 10
| max_delayed_threads             | 20
| max_heap_table_size             | 33553408
| max_join_size                   | 4294967295
| max_sort_length                 | 1024
| max_user_connections            | 0
| max_tmp_tables                  | 32
| max_write_lock_count            | 4294967295
| myisam_recover_options          | OFF
| myisam_max_extra_sort_file_size | 256
| myisam_max_sort_file_size       | 2047
| myisam_sort_buffer_size         | 8388608
| net_buffer_length               | 16384
| net_read_timeout                | 30
| net_retry_count                 | 10
| net_write_timeout               | 60
| open_files_limit                | 0
| pid_file                        | /usr/local/mysql_3.23.38/var/linux01.pid
| port                            | 3306
| protocol_version                | 10
| record_buffer                   | 131072
| query_buffer_size               | 0
| safe_show_database              | OFF
| server_id                       | 0
| skip_locking                    | ON
| skip_networking                 | OFF
| skip_show_database              | OFF
| slow_launch_time                | 2
| socket                          | /tmp/mysql.sock
| sort_buffer                     | 4194296
| table_cache                     | 128
| table_type                      | MYISAM
| thread_cache_size               | 0
| thread_stack                    | 65536
| transaction_isolation           | READ-COMMITTED
| timezone                        | JST
| tmp_table_size                  | 4194296
| tmpdir                          | /tmp/
| version                         | 3.23.38
| wait_timeout                    | 28800
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
93 rows in set (0.00 sec)

=========================================
EXPLAIN
=========================================
mysql> explain select INFO_NOTE from TEST where STR_DATE <= '20010610';
+-------+-------+---------------+---------+---------+------+------+------------+
| table | type  | possible_keys | key     | key_len | ref  | rows | Extra      |
+-------+-------+---------------+---------+---------+------+------+------------+
| TEST  | range | PRIMARY       | PRIMARY |       8 | NULL |    1 | where used |
+-------+-------+---------------+---------+---------+------+------+------------+
1 row in set (0.00 sec)

mysql> FLUSH STATUS;
Query OK, 0 rows affected (0.00 sec)

mysql> select INFO_NOTE from TEST where STR_DATE <= '20010610';
ERROR 1032: Can't find record in 'TEST'
mysql> SHOW STATUS;
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| Aborted_clients          | 0     |
| Aborted_connects         | 0     |
| Bytes_received           | 76    |
| Bytes_sent               | 82    |
| Connections              | 46    |
| Created_tmp_disk_tables  | 0     |
| Created_tmp_tables       | 0     |
| Created_tmp_files        | 0     |
| Delayed_insert_threads   | 0     |
| Delayed_writes           | 0     |
| Delayed_errors           | 0     |
| Flush_commands           | 1     |
| Handler_delete           | 0     |
| Handler_read_first       | 1     |
| Handler_read_key         | 0     |
| Handler_read_next        | 0     |
| Handler_read_prev        | 0     |
| Handler_read_rnd         | 0     |
| Handler_read_rnd_next    | 0     |
| Handler_update           | 0     |
| Handler_write            | 0     |
| Key_blocks_used          | 155   |
| Key_read_requests        | 0     |
| Key_reads                | 0     |
| Key_write_requests       | 0     |
| Key_writes               | 0     |
| Max_used_connections     | 0     |
| Not_flushed_key_blocks   | 0     |
| Not_flushed_delayed_rows | 0     |
| Open_tables              | 27    |
| Open_files               | 27    |
| Open_streams             | 0     |
| Opened_tables            | 0     |
| Questions                | 1761  |
| Select_full_join         | 0     |
| Select_full_range_join   | 0     |
| Select_range             | 1     |
| Select_range_check       | 0     |
| Select_scan              | 0     |
| Slave_running            | OFF   |
| Slave_open_temp_tables   | 0     |
| Slow_launch_threads      | 0     |
| Slow_queries             | 0     |
| Sort_merge_passes        | 0     |
| Sort_range               | 0     |
| Sort_rows                | 0     |
| Sort_scan                | 0     |
| Table_locks_immediate    | 1     |
| Table_locks_waited       | 0     |
| Threads_cached           | 0     |
| Threads_created          | 45    |
| Threads_connected        | 3     |
| Threads_running          | 1     |
| Uptime                   | 4771  |
+--------------------------+-------+
54 rows in set (0.00 sec)

 改善策ありましたらどうぞ宜しくお願い致します。
----------------------------------------------------------------------
ソフネック株式会社 佐賀開発室  崎村 典行 sakimura@xxxxxxxxxx
http://www.sofnec.co.jp/
本社(恵比寿) tel:03-5475-7381 fax:03-5475-7382
佐賀開発室   tel:0952-34-4032 fax:0952-34-4034

[前][次][番号順一覧][スレッド一覧]

->    3965 2001-07-11 10:46 [Noriyuki Sakimura <s] 空の BDB テーブル検索で ERROR 1032      
      3972 2001-07-11 18:43 ┣[崎村 典行 <sakimura@]                                       
      4067 2001-07-27 10:20 ┣[Noriyuki Sakimura <s]                                       
      4320 2001-09-14 20:10 ┗[<takeshi@xxxxxxxxxx>]                                       
      4328 2001-09-17 16:44  ┗[Noriyuki Sakimura <s]