using the nextval('sequence_name') in sql, the result maybe is not right

2018-09-26 Thread Wanglin
Hi, all:
PostgreSQL version : 10.3.  I use "nextval" in the sql , but I think the 
result is not right, maybe it is a bug.
   The test case as bellow:
   create sequence seq1;
select nextval('seq1');
create table tx1(id1 int, id2 int);
insert into tx1 select generate_series(1,100), random()*102;
explain verbose select * from tx1 where id2 = nextval('seq1');;
select * from tx1 where id2 = nextval('seq1');
postgres=# explain verbose select * from tx1 where id2 = nextval('seq1');; 
QUERY PLAN  Seq 
Scan on public.tx1 (cost=0.00..43.90 rows=11 width=8) Output: id1, id2 Filter: 
(tx1.id2 = nextval('seq1'::regclass)) (3 rows)


postgres=# select * from tx1 where id2 = nextval('seq1'); -- here, may be the 
result is not right id1 | id2 -+- 56 | 57 (1 row)


:: I think "nextval('seq1')" equal 2, so " select * from tx1 where id2 = 
nextval('seq1')" equals " select * from tx1 where id2 = 2", is it ?


Thanks,
Wanglin



[no subject]

2014-12-12 Thread wanglin

subscribe ceph-devel

--
To unsubscribe from this list: send the line unsubscribe ceph-devel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Python-Dev] make test

2013-01-08 Thread Xu Wanglin
 
When I run the test, i got these:
...  ...
testShareLocal (test.test_socket.TestSocketSharing) ... skipped 'Windows 
specific'
testTypes (test.test_socket.TestSocketSharing) ... skipped 'Windows specific'
==
ERROR: test_idna (test.test_socket.GeneralModuleTests)
--
Traceback (most recent call last):
  File /data/users/xwl/Python-3.3.0/Lib/test/test_socket.py, line 1183, in 
test_idna
socket.gethostbyname('испытание.python.org')
socket.gaierror: [Errno -3] Temporary failure in name resolution
--
Ran 483 tests in 24.816s
FAILED (errors=1, skipped=29)
test test_socket failed
make: *** [test] Error 1
Then I run the failing test manually, as the README guided:
[xwl@ordosz8003 ~/Python-3.3.0]$ ./python -m test -v test_idna
== CPython 3.3.0 (default, Jan 8 2013, 11:07:49) [GCC 4.1.2 20080704 (Red Hat 
4.1.2-46)]
==   Linux-2.6.18-164.el5-x86_64-with-redhat-5.4-Tikanga little-endian
==   /data/users/xwl/Python-3.3.0/build/test_python_17651
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1)
[1/1] test_idna
test test_idna crashed -- Traceback (most recent call last):
  File /data/users/xwl/Python-3.3.0/Lib/test/regrtest.py, line 1213, in 
runtest_inner
the_package = __import__(abstest, globals(), locals(), [])
ImportError: No module named 'test.test_idna'
1 test failed:
test_idna
[xwl@ordosz8003 ~/Python-3.3.0]$ pwd
/data/users/xwl/Python-3.3.0
[xwl@ordosz8003 ~/Python-3.3.0]$
 
Please help me to install this great software on my machine. Think you!
 
David.Xu
 ___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com