2 # Renaming an existing column_name to same name.
3 # Create table t1(f1 int,f2 char(10));
4 # Alter table t1 rename column f2 to f2; It should be failed.
6 CREATEFILE
=${PWD}/sql
/Alter
/csql.conf
8 if [ -s "$CREATEFILE" ]
10 REL_PATH
=`pwd`/sql
/Alter
13 echo "create table t1(f1 int,f2 char(20));" >${REL_PATH}/createtable.sql
14 echo "insert into t1 values(1,'CSQL_LAKSHYA');" >>${REL_PATH}/createtable.sql
15 echo "echo alter table t1 rename column f2 to f2;" >${REL_PATH}/renamecolumn.sql
16 echo "alter table t1 rename column f2 to f2;" >>${REL_PATH}/renamecolumn.sql
17 echo "drop table t1;" >${REL_PATH}/dropt1.sql
19 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/dropt1.sql
>/dev
/null
2>&1
21 if [ "$VALGRIND" = "true" ]
23 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/createtable.sql
25 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/createtable.sql
28 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/dropt1.sql
29 rm -f ${REL_PATH}/createtable.sql
${REL_PATH}/renamecolumn.sql
30 rm -f ${REL_PATH}/dropt1.sql
35 $CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-l >${REL_PATH}/beforealter
37 if [ "$VALGRIND" = "true" ]
39 valgrind
--tool=memcheck
--leak-check=full
$CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/renamecolumn.sql
41 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/renamecolumn.sql
44 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/dropt1.sql
45 rm -f ${REL_PATH}/createtable.sql
${REL_PATH}/renamecolumn.sql
46 rm -f ${REL_PATH}/dropt1.sql
${REL_PATH}/beforealter
51 $CSQL_INSTALL_ROOT/bin
/catalog
-u root
-p manager
-l >${REL_PATH}/afteralter
53 diff ${REL_PATH}/beforealter
${REL_PATH}/afteralter
61 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/dropt1.sql
64 $CSQL_INSTALL_ROOT/bin
/csql
-s ${REL_PATH}/dropt1.sql
65 rm -f ${REL_PATH}/createtable.sql
${REL_PATH}/renamecolumn.sql
66 rm -f ${REL_PATH}/dropt1.sql ${REL_PATH}/beforealter ${REL_PATH}/afteralter
69 rm -f ${REL_PATH}/createtable.sql
${REL_PATH}/renamecolumn.sql
70 rm -f ${REL_PATH}/dropt1.sql ${REL_PATH}/beforealter ${REL_PATH}/afteralter