From 51942b7efe09da2dfab08a43f5bae9c3e32245e8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Jan 2007 15:43:21 +0100 Subject: [PATCH] Add test's from Matthias for assigning one variable from another using let --- mysql-test/r/mysqltest.result | 9 +++++++++ mysql-test/t/mysqltest.test | 30 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 12a35fcf48b..e1ebed8cacd 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -269,6 +269,15 @@ mysqltest: At line 1: Missing assignment operator in let 1 # Execute: echo $success ; 1 +# Check if let $B = $A is an assignment per value. +let $A = initial value of A; +let $B = initial value of B; +let $B = $A +# Content of $A is: initial value of B +let $A = changed value of A; +# Content of $B is: initial value of B +let $B = changed value of B; +# Content of $A is: changed value of A mysqltest: At line 1: Missing required argument 'filename' to command 'source' mysqltest: At line 1: Could not open file ./non_existingFile mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 7da84543e6d..e0d5591fc4f 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -688,6 +688,36 @@ echo # success: $success ; --echo # Execute: echo \$success ; echo $success ; + +# ---------------------------------------------------------------------------- +# Test to assign let from variable +# let $=$; +# ---------------------------------------------------------------------------- + +--echo # Check if let \$B = \$A is an assignment per value. + +# Basic preparations: +--echo let \$A = initial value of A; +let $A = initial value of A; +# --echo # Content of \$A is: $A +--echo let \$B = initial value of B; +let $B = initial value of B; +# --echo # Content of \$B is: $B + +# Assign $B to $A: +--echo let \$B = \$A +let $A = $B; +--echo # Content of \$A is: $A + +# Changes of $B must NOT affect $A and Changes of $A must NOT affect $B ! +--echo let \$A = changed value of A; +let $A = changed value of A; +--echo # Content of \$B is: $B + +--echo let \$B = changed value of B; +let $B = changed value of B; +--echo # Content of \$A is: $A + # ---------------------------------------------------------------------------- # Test to assign let from query # let $=``;