在ets中查找不存在的表(t3)后,将删除所有用户创建的表(t1和t2)。它是一个错误还是只是 ets 的一个奇怪的功能?
这是 Eshell 中的代码。
Eshell V5.9.1 (abort with ^G)
1> ets:new(t1, [named_table]).
t1
2> ets:new(t2, [named_table]).
t2
3> ets:all().
[t2,t1,8207,4110,13,file_io_servers,inet_hosts_file_byaddr,
inet_hosts_file_byname,inet_hosts_byaddr,inet_hosts_byname,
inet_cache,inet_db,global_pid_ids,global_pid_names,
global_names_ext,global_names,global_locks,ac_tab]
4> ets:insert(t1, {1,2}).
true
5> ets:lookup(t1, 1).
[{1,2}]
6> ets:lookup(t2, 1).
[]
7> ets:all().
[t2,t1,8207,4110,13,file_io_servers,inet_hosts_file_byaddr,
inet_hosts_file_byname,inet_hosts_byaddr,inet_hosts_byname,
inet_cache,inet_db,global_pid_ids,global_pid_names,
global_names_ext,global_names,global_locks,ac_tab]
8> ets:lookup(t3, 1).
** exception error: bad argument
in function ets:lookup/2
called as ets:lookup(t3,1)
9> ets:all().
[8207,4110,13,file_io_servers,inet_hosts_file_byaddr,
inet_hosts_file_byname,inet_hosts_byaddr,inet_hosts_byname,
inet_cache,inet_db,global_pid_ids,global_pid_names,
global_names_ext,global_names,global_locks,ac_tab]
10>
谁能告诉我这里有什么问题?