title: spring boot pagination size element not working with native query in repository
body: <p>I am not able to segment data coming from repository in pages. Currently <code>List</code> coming from repository has 14 elements. When I try to segment it with <code>size</code> 5 on each page, the code does not work. It throws exception (mentioned below).</p>
  
  <p><strong>JPA Repository method with native query</strong></p>
  
  <pre><code>@Query(value= "select date(start_date) as DATEE, sum(case when subscription_from in ('IVR','SMS') and remarks like '%Change Song%' then 1 else 0 end) as song_change from subscription group by date(start_date) \n#pageable\n",nativeQuery=true)
      Page&lt;Object[]&gt; getSongChangeCount2(Pageable page);
  </code></pre>
  
  <p><strong>REST Template calling repository</strong></p>
  
  <pre><code>@Override
  public SongChangeCountView getSongChangeCount(int pageNo) {
      logger.info("getAllCrbtData method:----------------");
      RestTemplate restTemplate = new RestTemplate();
      String ROOT_URI = IPADDRESS + "songChangeCounts?page=" + pageNo
              + "&amp;size=5"; // here the total size coming is 14. when I change size to more than 14.. code works. but less than 14 it does not work. why so?
      ResponseEntity&lt;SongChangeCountView&gt; response = restTemplate
              .getForEntity(ROOT_URI, SongChangeCountView.class);
      SongChangeCountView songChangeCountView = (SongChangeCountView) response
              .getBody();
      return songChangeCountView;
  }
  </code></pre>
  
  <p>in above code when I change url with size to 5 (which is less than the maximum list size), the code throws below exception.</p>
  
  <p><strong>Exception</strong></p>
  
  <pre><code>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group) from subscription group by date(start_date) 
  #pageable' at line 1
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_181]
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_181]
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_181]
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_181]
      at com.mysql.jdbc.Util.handleNewInstance(Util.java:406) ~[mysql-connector-java-5.1.6.jar:na]
      at com.mysql.jdbc.Util.getInstance(Util.java:381) ~[mysql-connector-java-5.1.6.jar:na]
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030) ~[mysql-connector-java-5.1.6.jar:na]
      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) ~[mysql-connector-java-5.1.6.jar:na]
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491) ~[mysql-connector-java-5.1.6.jar:na]
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423) ~[mysql-connector-java-5.1.6.jar:na]
  </code></pre>
  
  <p>What is this exception telling about? What should be the appropriate way to resolve this issue.?</p>