Server IP : 172.67.216.182 / Your IP : 108.162.226.11 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/mysql-test/suite/ndb_memcache/t/ |
Upload File : |
# The include statement below is a temp one for tests that are yet to #be ported to run with InnoDB, #but needs to be kept for tests that would need MyISAM in future. --source include/force_myisam_default.inc ################################################################ # Test access via unique index # # Write-access via unique index is subject to some restrictions: # # (1) Inserts are not allowed; they will fail with NOT_FOUND # (2) Updates that do not contain the PK column are allowed # (3) Updates that contain the PK column are allowed if the PK value # does not change, but attempts to change the PK fail with NOT_STORED. --source include/have_ndb.inc --source suite/ndb_memcache/include/have_memcache.inc --source suite/ndb_memcache/include/memcached_wait_for_ready.inc --source suite/ndb_memcache/include/misc_tables.inc --perl use strict; use Carp; use lib "lib"; use My::Memcache; my $port = $ENV{NDB_MEMCACHED_1_PORT} or die "Need NDB_MEMCACHED_1_PORT"; my $mc = My::Memcache->new(); my $r = $mc->connect("localhost",$port); # 1: SET on primary key $mc->set("tup:1","key1\tSuperbe!") || $mc->fail("Failed test 1.A"); $mc->set("tup:2","key2\tIncroyable!") || $mc->fail("Failed test 1.B"); $mc->set("tup:3","key3\tTres bien fait"); $mc->set("tup:4","key4\tPas mal"); # 2: GET on primary key ($mc->get("tup:1") == "key1\tSuperbe!") || $mc->fail("Failed test 2.A"); ($mc->get("tup:2") == "key2\tIncroyable!")|| $mc->fail("Failed test 2.B"); # 3: GET via unique key (two value columns) ($mc->get("tur:key1") == "1\tSuperbe!") || $mc->fail("Failed test 3."); # 4: GET via unique key (one value column) ($mc->get("tui:key2") == "Incroyable!") || $mc->fail("Failed test 4."); # 5. SET via unique key (one value column, not part of primary key) $mc->set("tui:key3", "Assez bien") || $mc->fail("Failed test 5.A"); $mc->set("tui:key4", "Pas trop mal...") || $mc->fail("Failed test 5.B"); # 6. REPLACE via unique key (one value column, not part of primary key) $mc->replace("tui:key2", "Passable") || $mc->fail("Failed test 6"); # 7. Inserts via unique key access fail with NOT_FOUND: # (A) SET ($mc->set("tui:key5", "rien") == 0) || $mc->fail("Test 7.A SET should fail"); ($mc->{error} =~ "NOT_FOUND") || $mc->fail("Test 7.A expected NOT_FOUND"); # (B) ADD ($mc->add("tui:key6", "rien") == 0) || $mc->fail("Test 7.B ADD should fail"); ($mc->{error} =~ "NOT_FOUND") || $mc->fail("Test 7.B expected NOT_FOUND"); # 8. Update via unique key succeeds if PK is equal to old PK $mc->set("tur:key1", "1\tQuotidien") || $mc->fail("Failed test 8.A"); ($mc->get("tui:key1") == "Quotidien") || $mc->fail("Failed test 8.B"); # 9. Attempt to change PK fails with NOT_STORED ($mc->set("tur:key3", "5\tJamais!") == 0) || $mc->fail("Test 9 SET should fail."); ($mc->{error} =~ "NOT_STORED") || $mc->fail("Test 9 expected NOT_STORED"); # 10. This is the final test in the ndb_memcache suite; send a "stats errors" # request so that the server will flush its log file. $mc->stats("errors"); EOF # At the end of the test the values should be # 1 Quotidien # 2 Passable # 3 Assez bien # 4 Pas trop mal... --sorted_result SELECT * FROM ndbmemcache.test_unique_idx; DELETE FROM ndbmemcache.test_unique_idx;