Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How set lower_case_table_names system variable #12

Closed
piantino opened this issue Jan 13, 2014 · 15 comments
Closed

How set lower_case_table_names system variable #12

piantino opened this issue Jan 13, 2014 · 15 comments

Comments

@piantino
Copy link

Hello,

I am trying fix the table names in lower case, in Ubuntu:

<plugin>
    <groupId>com.jcabi</groupId>
    <artifactId>jcabi-mysql-maven-plugin</artifactId>
    <version>0.4</version>
    <executions>
        <execution>
            <id>mysql-test</id>
            <goals>
                <goal>classify</goal>
                <goal>start</goal>
                <goal>stop</goal>
            </goals>
            <configuration>
                <port>${mysql.port}</port>
                <data>${project.build.directory}/mysql-data</data>
                <systemPropertyVariables>
                <lower_case_table_names>1</lower_case_table_names>
                </systemPropertyVariables>
            </configuration>
        </execution>
    </executions>
</plugin>

But not work...

It is possible set any this variable or set in "my.cnf" file?

@yegor256
Copy link
Member

Good question. Now it's not possible, but I can add this configuration option. How about this:

<plugin>
    <executions>
        <execution>
            <configuration>
                <options><![CDATA[
                lower_case_table_names=1
                ]]></options>
            </configuration>
        </execution>
    </executions>
</plugin>

@piantino
Copy link
Author

Very fast answer!

I think this resolve the problem, and possible others. I agree with the solution ;)
How I need resolve this fast, I will try others alternatives, if I found, i say.

Thanks

@yegor256
Copy link
Member

OK, I'll try to implement it today...

@dmarkov
Copy link

dmarkov commented Jan 15, 2014

@longtimeago This task is yours, please go ahead keeping in mind this. If any questions, don't hesitate to ask right here

@dmarkov
Copy link

dmarkov commented Jan 15, 2014

@longtimeago The cost of this task is 30 mins (this is exactly how much will be paid, not less not more), when the task is done

@longtimeago
Copy link
Contributor

@yegor256 Hi Yegor
I started to look through the project in context of the Issue #12 (lower_case_table_names) and figured out many unclear moments.

  1. How to debug integration test? I have weird situation then config options do not propagate to Mojo
  2. How to run integration tests separated from build, because build took a lot of time (downloading and unpacking artifacts ...)

I've added possibility to specify options on Instances module and test it in unit test
But the main problem is that I can't reproduce 'lower_case_table_names' issue in integration tests. What I've done for it:

  1. Added to basic-usage/pom.xml
<options>
      <option>lower_case_table_names=1</option>
</options>
  1. Added options parameter to AbstractMysqlMojo
    @Parameter(
        required = false
    )
    private transient List<String> options;
  1. Added getter for the property and log options. But in integration tests we this list is always empty ...
    Have I missed something?

@yegor256
Copy link
Member

First, let's use plain text (like in my example above) instead of list of strings. This will give us much more flexibility in the future.

Second, I would recommend you to test it that way:

  1. Create a new maven invoker test, a new directory in src/it, say src/it/with-options
  2. Add some fake and broken configuration to it:
<configuration>
                <options><![CDATA[
                intentionally broken, should fail the build
                ]]></options>
            </configuration>
  1. in src/it/with-options/verify.groovy check that the build actually failed and we have an error message from MySQL in logs

In order to save some time don't do clean on every run. Just run mvn install

@longtimeago
Copy link
Contributor

Thank you very much! I'll check this tonight

longtimeago pushed a commit to longtimeago/jcabi-mysql-maven-plugin that referenced this issue Jan 17, 2014
longtimeago pushed a commit to longtimeago/jcabi-mysql-maven-plugin that referenced this issue Jan 19, 2014
longtimeago pushed a commit to longtimeago/jcabi-mysql-maven-plugin that referenced this issue Jan 19, 2014
ghost pushed a commit that referenced this issue Jan 19, 2014
#13: pull request Issue #12 Plugin configuration options become available
@longtimeago
Copy link
Contributor

@yegor256 Please, close the issue. Thank you!

@yegor256
Copy link
Member

it's not mine :) let me release a new version to Maven Central and then we ask @piantino to check how it works..

yegor256 pushed a commit that referenced this issue Jan 19, 2014
@longtimeago
Copy link
Contributor

yep, sorry :)

@yegor256
Copy link
Member

@piantino we implemented this feature (see https://github.com/jcabi/jcabi-mysql-maven-plugin/releases/tag/jcabi-0.5) and released version 0.5 to Maven Central. Please let us know whether this is what you were looking for.

@piantino
Copy link
Author

@yegor256 I did like the example http://mysql.jcabi.com/example-options.html and worked perfectly.
Thank you very much!

@yegor256
Copy link
Member

@piantino could you please close this ticket?

@dmarkov
Copy link

dmarkov commented Jan 20, 2014

@longtimeago 30 mins added to your account (payment number DA2120678), many thanks for your contribution!

longtimeago pushed a commit to longtimeago/jcabi-mysql-maven-plugin that referenced this issue Jan 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants