# CrateDB 4.5 : SHOW CREATE TABLE problem on this version?

**URL:** https://community.cratedb.com/t/cratedb-4-5-show-create-table-problem-on-this-version/618
**Category:** CrateDB
**Created:** [April 7, 2021, 9:24pm UTC](https://community.cratedb.com/t/cratedb-4-5-show-create-table-problem-on-this-version/618 "2021-04-07T21:24:32Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![MikeMax](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/mikemax/32/249_2.png) [@MikeMax](https://community.cratedb.com/u/MikeMax)
#### Post date: [April 7, 2021, 9:24pm UTC](https://community.cratedb.com/t/cratedb-4-5-show-create-table-problem-on-this-version/618/1 "2021-04-07T21:24:32Z")

</div>

Hi,

I just tried a “SHOW CREATE TABLE” **on version 4.5** which can’t be replayed (i spare you the table parameters) :

```
CREATE TABLE IF NOT EXISTS "doc"."books" (
   "id" INTEGER,
   "author" TEXT,
   "author_ft" TEXT INDEX USING FULLTEXT WITH (
      analyzer = 'mysqllike'
   ),
   "book_title" TEXT,
   "column_name" TEXT,
   "book_title_ft" TEXT INDEX USING FULLTEXT WITH (
      analyzer = 'mysqllike'
   ),
   PRIMARY KEY ("id"),
   INDEX "author_ft" USING FULLTEXT ("author"),
   INDEX "book_title_ft" USING FULLTEXT ("book_title")
)
....

```

Indexes are specified Twice … so CrateDB says :

 ![image](https://us1.discourse-cdn.com/flex020/uploads/crate/original/1X/c1e5df8afea81861b0d8217412ade41df6354597.png)

But on **version 4.4.3** , the same table show me this for the SHOW CREATE TABLE statement :

```
CREATE TABLE IF NOT EXISTS "doc"."books" (
  "id" INTEGER,
  "author" TEXT,
  "book_title" TEXT,
  "column_name" TEXT,
  PRIMARY KEY ("id"),
  INDEX "author_ft" USING FULLTEXT ("author") WITH (
     analyzer = 'mysqllike'
  ),
  INDEX "book_title_ft" USING FULLTEXT ("book_title") WITH (
     analyzer = 'mysqllike'
  )
)
...

```

Which works fine.

So it seems the SHOW CREATE TABLE statement is buggy on the 4.5 version.

---

<div class="post-metadata">

### Author: ![MikeMax](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/mikemax/32/249_2.png) [@MikeMax](https://community.cratedb.com/u/MikeMax)
#### Post date: [April 8, 2021, 7:44am UTC](https://community.cratedb.com/t/cratedb-4-5-show-create-table-problem-on-this-version/618/2 "2021-04-08T07:44:40Z")

</div>

It seems that in 4.4.3, the ALTER… ADD COLUMN creates INDEX FULLTEXT columns as real columns …

Try to create this table :

```
CREATE TABLE IF NOT EXISTS "doc"."books" (
  "id" INTEGER,
  "author" TEXT,
  "book_title" TEXT,
  PRIMARY KEY ("id"),
  INDEX "author_ft" USING FULLTEXT ("author"),
  INDEX "book_title_ft" USING FULLTEXT ("book_title")
);

```

And then :

`ALTER TABLE "doc"."books" ADD COLUMN "column_name" TEXT;`

You will see that every fulltext indexed columns are now real columns … (seen on 4.4.3 and 4.5 but not verified on older version)

---

<div class="post-metadata">

### Author: ![MikeMax](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/mikemax/32/249_2.png) [@MikeMax](https://community.cratedb.com/u/MikeMax)
#### Post date: [April 8, 2021, 7:54am UTC](https://community.cratedb.com/t/cratedb-4-5-show-create-table-problem-on-this-version/618/3 "2021-04-08T07:54:29Z")

</div>

Issue added on github.

---

<div class="post-metadata">

### Author: ![jayeff](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/jayeff/32/271_2.png) [@jayeff](https://community.cratedb.com/u/jayeff)
#### Post date: [April 8, 2021, 8:08am UTC](https://community.cratedb.com/t/cratedb-4-5-show-create-table-problem-on-this-version/618/4 "2021-04-08T08:08:06Z")

</div>

@MikeMax: I can reproduce this behaviour with `CREATE TABLE` & `ADD COLUMN`.

Thanks for reporting it.

Github link: [Problem on SHOW CREATE TABLE (4.5) and ALTER ... ADD COLUMN (4.4.3 & 4.5) when fulltext index columns are present. · Issue #11216 · crate/crate · GitHub](https://github.com/crate/crate/issues/11216)

---

<div class="post-metadata">

### Author: ![jayeff](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/jayeff/32/271_2.png) [@jayeff](https://community.cratedb.com/u/jayeff)
#### Post date: [April 12, 2021, 5:23pm UTC](https://community.cratedb.com/t/cratedb-4-5-show-create-table-problem-on-this-version/618/5 "2021-04-12T17:23:15Z")

</div>

@MikeMax As you may have seen the issue was fixed and will be released with the next version of CrateDB

---

<div class="post-metadata">

### Author: ![MikeMax](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/mikemax/32/249_2.png) [@MikeMax](https://community.cratedb.com/u/MikeMax)
#### Post date: [April 12, 2021, 5:58pm UTC](https://community.cratedb.com/t/cratedb-4-5-show-create-table-problem-on-this-version/618/6 "2021-04-12T17:58:26Z")

</div>

Great ! thanks a lot 🙂
